/*
 * Decompiled with CFR 0.152.
 * 
 * Could not load the following classes:
 *  javax.annotation.Resource
 *  org.apache.commons.logging.Log
 *  org.apache.commons.logging.LogFactory
 *  org.apache.struts2.convention.annotation.Action
 *  org.apache.struts2.convention.annotation.Result
 *  org.springframework.context.annotation.Scope
 *  org.springframework.stereotype.Controller
 */
package com.hst.taxService.action;

import com.hst.common.action.ExtendAction;
import com.hst.common.service.BaseBusinessService;
import com.hst.framework.util.HstDateUtil;
import com.hst.framework.util.HstToolsUtil;
import com.hst.taxService.domain.xshs.TaskJkSbDomain;
import com.hst.taxService.domain.xshs.TaxXshsCommDomain;
import com.hst.taxService.service.XshsCommonService;
import java.util.Date;
import java.util.List;
import javax.annotation.Resource;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Result;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

@Controller
@Scope(value="prototype")
@Action(value="/service/plSb", results={@Result(name="doService", type="json")})
public class TaxPlSbAction
extends ExtendAction {
    private static final long serialVersionUID = 1L;
    private TaxXshsCommDomain domain;
    public static Log _logger = LogFactory.getLog(TaxPlSbAction.class);

    public String doService() throws Exception {
        XshsCommonService service = (XshsCommonService)this.getService();
        String tdId = this.getDomain().getTdId();
        List<TaskJkSbDomain> dataList = null;
        TaskJkSbDomain taskJkSbDomain = null;
        try {
            if (HstToolsUtil.isNullOrEmpty(tdId)) {
                this.getDomain().setRetJson("\u901a\u9053id\u4e3a\u7a7a");
                return "doService";
            }
            try {
                int num = 0;
                while (true) {
                    dataList = null;
                    dataList = service.queryTaskSb(tdId);
                    if (dataList == null) break;
                    if (dataList.isEmpty()) {
                        break;
                    }
                    taskJkSbDomain = dataList.get(0);
                    try {
                        try {
                            taskJkSbDomain.setKssj(HstDateUtil.format(new Date(), "yyyy-MM-dd HH:mm:ss"));
                            _logger.error((Object)("\u901a\u9053id\uff1a" + taskJkSbDomain.getTdId() + ",\u7ed3\u7b97\u5e8f\u53f7:" + taskJkSbDomain.getKsjsXh() + "\u6267\u884c\u5230" + ++num));
                            taskJkSbDomain.setCode("00");
                            if ("1".equals(taskJkSbDomain.getSzlb())) {
                                service.doZzsSb(taskJkSbDomain);
                            } else if ("2".equals(taskJkSbDomain.getSzlb())) {
                                service.doFjsSb(taskJkSbDomain);
                            } else if ("3".equals(taskJkSbDomain.getSzlb())) {
                                if ("1".equals(taskJkSbDomain.getSbfs())) {
                                    service.doGrsdsSb(taskJkSbDomain);
                                } else if ("2".equals(taskJkSbDomain.getSbfs())) {
                                    service.doFjsSb(taskJkSbDomain);
                                }
                            }
                            _logger.error((Object)("\u901a\u9053id\uff1a" + taskJkSbDomain.getTdId() + ",\u7ed3\u7b97\u5e8f\u53f7:" + taskJkSbDomain.getKsjsXh() + ",\u6267\u884c\u7ed3\u675f"));
                        }
                        catch (Exception e) {
                            taskJkSbDomain.setCode("01");
                            taskJkSbDomain.setMess(e.getMessage());
                            _logger.error((Object)("\u901a\u9053id\uff1a" + taskJkSbDomain.getTdId() + ",\u7ed3\u7b97\u5e8f\u53f7:" + taskJkSbDomain.getKsjsXh() + ",\u9519\u8bef\u4fe1\u606f:" + e.getMessage()));
                            taskJkSbDomain.setJssj(HstDateUtil.format(new Date(), "yyyy-MM-dd HH:mm:ss"));
                            service.updateTaskYxjg(taskJkSbDomain);
                            continue;
                        }
                    }
                    catch (Throwable throwable) {
                        taskJkSbDomain.setJssj(HstDateUtil.format(new Date(), "yyyy-MM-dd HH:mm:ss"));
                        service.updateTaskYxjg(taskJkSbDomain);
                        throw throwable;
                    }
                    taskJkSbDomain.setJssj(HstDateUtil.format(new Date(), "yyyy-MM-dd HH:mm:ss"));
                    service.updateTaskYxjg(taskJkSbDomain);
                }
            }
            catch (Exception e) {
                _logger.error((Object)("\u901a\u9053id\uff1a" + e.getMessage()));
            }
        }
        finally {
            taskJkSbDomain = null;
            dataList = null;
        }
        return "doService";
    }

    @Override
    @Resource(name="xshsCommonServiceImp")
    public void setService(BaseBusinessService service) {
        super.setService(service);
    }

    @Override
    public TaxXshsCommDomain getDomain() {
        if (this.domain == null) {
            this.domain = new TaxXshsCommDomain();
        }
        return this.domain;
    }

    public void setDomain(TaxXshsCommDomain domain) {
        this.domain = domain;
    }
}
