/*
 * Decompiled with CFR 0.152.
 * 
 * Could not load the following classes:
 *  org.springframework.beans.factory.annotation.Autowired
 *  org.springframework.stereotype.Service
 */
package com.hst.taxService.service.imp;

import com.hst.common.domain.TaxCommonReturnDomain;
import com.hst.common.service.imp.BaseBusinessServiceImp;
import com.hst.framework.constants.WebConstants;
import com.hst.framework.util.HstToolsUtil;
import com.hst.taxService.dao.HxzgSbCommonDao;
import com.hst.taxService.domain.HxzgSbPlZfDoamin;
import com.hst.taxService.domain.gt3.HxzgSbSbZfRequestDomain;
import com.hst.taxService.service.Gt3CommonAppService;
import com.hst.taxService.service.HxzgSbService;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class HxzgSbServiceImp
extends BaseBusinessServiceImp
implements HxzgSbService {
    @Autowired
    private HxzgSbCommonDao dao;

    @Override
    public void sbplzf() throws Exception {
        List<HxzgSbPlZfDoamin> dataList = this.dao.querySbxx();
        try {
            HxzgSbSbZfRequestDomain request = null;
            for (HxzgSbPlZfDoamin temp : dataList) {
                Gt3CommonAppService service = this.getGt3Service();
                request = new HxzgSbSbZfRequestDomain();
                request.setBid("GT3.HxzgSbSbZf");
                request.setSjry(WebConstants.GT3_SHHBSPT_SJRY);
                request.setSjjg(WebConstants.GT3_SHHBSPT_SJJG);
                request.setDjxh(temp.getDjxh());
                request.setPzxh(temp.getPzxh());
                request.setYzpzzlDm(temp.getYzpzzldm());
                request.setSkssqq(temp.getSkssqq());
                request.setSkssqz(temp.getSkssqz());
                request.setSbuuid(temp.getSbuuid());
                TaxCommonReturnDomain response = service.hxzgSbSbZf(request);
                if ("00".equals(response.getCode())) {
                    temp.setCzbz("Y");
                } else {
                    temp.setCzbz("N");
                    if (!HstToolsUtil.isNullOrEmpty(response.getMess())) {
                        if (response.getMess().length() < 3000) {
                            temp.setZfsbyy(response.getMess().replaceAll("%", "%25"));
                        } else {
                            temp.setZfsbyy(response.getMess().substring(0, 3000).replaceAll("%", "%25"));
                        }
                    }
                }
                this.dao.updateSbxx(temp);
            }
        }
        catch (Exception e) {
            e.getStackTrace();
            _logger.error((Object)"\u7533\u62a5\u4f5c\u5e9f\u63a5\u53e3\u51fa\u9519");
        }
    }

    public Gt3CommonAppService getGt3Service() {
        return (Gt3CommonAppService)WebConstants.WEB_APP_CONTEXT.getBean("gt3CommonAppServiceImp");
    }
}
