LAPTOP-FO2T5SIU\35838 il y a 11 mois
Parent
commit
1b0cdf001c

+ 5 - 0
pro-base/src/main/java/com/idea/invoice/controller/InvoiceManageController.java

@@ -183,6 +183,11 @@ public class InvoiceManageController extends BaseController {
             model.setNcCode(code);
             modelService.updateByPrimaryKeySelective(model);
         } else if ("false".equals(success)) {
+            model.setSendStatus("2");
+            model.setSubmitTime(new Date());
+            model.setSubmitUser(ShiroUtils.getUserId());
+            model.setNcJson(result);
+            modelService.updateByPrimaryKeySelective(model);
             return AjaxResult.error(504, jsonObject.getString("message"));
         }
 

+ 4 - 0
pro-base/src/main/java/com/idea/invoice/mapper/InvoiceManageExtendMapper.java

@@ -13,4 +13,8 @@ public interface InvoiceManageExtendMapper {
 
     List<InvoiceManage> selectNeedRefreshStatusList();
 
+    InvoiceManage needUpdateNo(String ncCode);
+
+    InvoiceManage needUpdateCarryOverStatus(String ncCode);
+
 }

+ 53 - 101
pro-base/src/main/java/com/idea/invoice/service/InvoiceManageService.java

@@ -345,7 +345,7 @@ public class InvoiceManageService implements BaseService<InvoiceManage, InvoiceM
         invoiceManage.setInvoiceHeaderNumber(buyer.getIdentityCard());
         // TODO: 2024/10/17 商品编码目前为空 对接接口后调整
 //        invoiceManage.setInvoiceGoodsCode(InvoiceConstant.INVOICE_GOODS_CODE_ADVANCE_PAYMENT);
-        invoiceManage.setInvoiceGoodsName(invoiceGoodsName + room.getGroupName());
+        invoiceManage.setInvoiceGoodsName("*不动产*" + room.getGroupName());
         invoiceManage.setSpecifications(room.getBuildName() + "-" + room.getRoomNo());
         invoiceManage.setInvoiceCount(new BigDecimal(contract.getActualBuildArea().toString()));
         invoiceManage.setInvoiceAmount(contract.getBuyerMoney());
@@ -418,19 +418,21 @@ public class InvoiceManageService implements BaseService<InvoiceManage, InvoiceM
                 for (InvoiceBank invoiceBank : bankList) {
                     if (StringUtils.isNotEmpty(invoiceBank.getSuitFloor())) {
                         String[] floors = invoiceBank.getSuitFloor().split(",");
+                        List<String> suitCostTypes = Arrays.asList(invoiceBank.getSuitCostType().split(","));
+                        List<String> taxRates = Arrays.asList(invoiceBank.getTaxRate().split(","));
                         for (String floor : floors) {
                             if (parkRoom.getDiscId().contains(floor)) {
                                 result = invoiceBank.getBankName() + invoiceBank.getBankBranchName() + invoiceBank.getBankNumber();
                                 jsonObject.put("invoiceSellerBank", result);
-                                // 预收款发票税率默认为0
-                                jsonObject.put("invoiceTax", "0");
+                                int index = suitCostTypes.indexOf(dictLabel);
+                                String taxRate = taxRates.get(index);
+                                jsonObject.put("invoiceTax", taxRate);
                                 break;
                             }
                         }
                     }
                 }
             }
-
         }
 
         return jsonObject;
@@ -489,104 +491,49 @@ public class InvoiceManageService implements BaseService<InvoiceManage, InvoiceM
             }
         }
 
-
-        // TODO: 2024/12/18 预收款发票 细节待定 可能不需要新增
-//        // 预收款发票 调收款单接口
-//        if ("1".equals(newRecord.getType())) {
-//
-//            Double invoiceTax = Double.parseDouble(model.getInvoiceTax()) * 100;
-//
-//            JSONObject json = new JSONObject();
-//            JSONObject ar_gatherbill = new JSONObject();
-//            String srcsystemid = model.getId();
-//            String billdate = DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, new Date());
-//            ar_gatherbill.put("srcsystemid", srcsystemid); //外系统标识,必选
-//            ar_gatherbill.put("pk_tradetype", InvoiceConstant.INVOICE_BUSINESS_F2_Cxx_06); //交易类型,必选
-//            ar_gatherbill.put("pk_org", parkInfo.getOrganizationalCode()); //组织编码,必选
-//            ar_gatherbill.put("billdate", billdate); //单据日期
-//            ar_gatherbill.put("def2", srcsystemid); //外系统单据号,必填,
-//            ar_gatherbill.put("def18", "2"); //销售发票类型,1-全电专票,2-全电普票
-//            ar_gatherbill.put("def8", model.getRemark()); // 发票备注
-//            json.put("ar_gatherbill", ar_gatherbill);
-//
-//            JSONArray ar_gatheritem = new JSONArray();
-//            JSONObject ar_gatheritemJson = new JSONObject();
-//            ar_gatheritemJson.put("srcsystemid", srcsystemid); //外系统子表标识
-//            ar_gatheritemJson.put("objtype", "0"); //0=客户,1=供应商--判断customer和supplier是否必填,必选
-//            ar_gatheritemJson.put("customer", model.getInvoiceHeaderNumber()); //客商的纳税人识别号
-//            ar_gatheritemJson.put("money_de", model.getInvoiceAmount()); //金额,必选
-//            ar_gatheritemJson.put("taxrate", invoiceTax); //税率,必选,无税传0
-//            // TODO: 2024/12/18 待定
-//            ar_gatheritemJson.put("pk_balatype", ); // //结算方式,必选,看云文档结算方式(电汇、现金、POS)
-//            ar_gatheritemJson.put("pk_recpaytype", "001"); //收款业务类型,必选,(默认001)
-//            ar_gatheritemJson.put("prepay", "1"); //收款性质应收款时传"0",收款性质预收款时传"1"(默认=1)
-//            // TODO: 2024/12/18 数据库字段目前为空 需处理
-//            ar_gatheritemJson.put("recaccount", model.getInvoiceSellerBankNumber()); //收款银行账号,必填
-//            ar_gatheritemJson.put("fphm", ""); //发票号码,非必选
-//            ar_gatheritemJson.put("scomment",customerManagement.getBuyerName()); //客户名称,必选
-//            // TODO: 2024/12/18 待定
-//            ar_gatheritemJson.put("pk_subjcode",InvoiceConstant.INVOICE_PAYMENT_TYPE_AJ026); //收支项目编码
-//            // TODO: 2024/12/18 待定
-//            ar_gatheritemJson.put("hg",); //票据类型,必选,看云文档票据类型(收据)
-//            ar_gatheritemJson.put("checkno",srcsystemid); //票据号,必选(收据号)
-//            ar_gatheritemJson.put("def9", InvoiceConstant.INVOICE_BUSINESS_FORMAT_001); //业态,必选,看云文档业态
-//            ar_gatheritemJson.put("def11", parkRoom.getId()); //转出前房号编码,收除了诚意金之外的首期等需要选(收据中的房号字段)
-//            ar_gatheritemJson.put("def10", parkInfo.getArchiveCode()); //项目档案编码,看云文档项目档案对照(项目管理中新增项目档案编号)
-//            ar_gatheritemJson.put("def21", "7-21-1301"); //开票的规格型号,7-21-1301
-//            ar_gatheritemJson.put("material", material); //物料
-//
-//            ar_gatheritem.add(ar_gatheritemJson);
-//            json.put("ar_recitem", ar_gatheritem);
-//
-//            result = InvoiceUtil.gatheringbillAdd(json);
-//        }
-        // 正式发票 调收款单接口
-        if ("2".equals(newRecord.getType())) {
-            String def26 = "江苏省无锡市";
-            if (StringUtils.isNotEmpty(parkInfo.getRegionalismCode())) {
-                String dictLabel = sysDictService.getDictLabel("REGIONALISM_CODE", parkInfo.getRegionalismCode());
-                def26 = def26 + dictLabel;
-            }
-            def26 = def26 + parkInfo.getGroupName() + roomResponse.getDiscName() + roomResponse.getBuildName()
-                    + "号" + roomResponse.getRoomNo() + "室";
-
-
-            Double invoiceTax = Double.parseDouble(model.getInvoiceTax()) * 100;
-            JSONObject json = new JSONObject();
-            JSONObject ar_recbill = new JSONObject();
-            String srcsystemid = model.getId();
-            String billdate = DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, new Date());
-            ar_recbill.put("srcsystemid", srcsystemid); //外系统标识,必选
-            ar_recbill.put("pk_tradetype", InvoiceConstant.INVOICE_BUSINESS_F0_Cxx_05); //交易类型,必选
-            ar_recbill.put("pk_org", parkInfo.getOrganizationalCode()); //组织编码,必选
-            ar_recbill.put("billdate", billdate); //单据日期
-            ar_recbill.put("def2", srcsystemid); //外系统单据号,必填,
-            ar_recbill.put("def18", "2"); //销售发票类型,1-全电专票,2-全电普票
-            ar_recbill.put("def23", "E05"); //特殊票种标识,默认是E05
-            ar_recbill.put("def24", "0"); //征税方式,必填,默认0
-            ar_recbill.put("def26", def26); //不动产地址 必填
-            ar_recbill.put("def25", "N"); // 跨地市标志,必填,Y--是;N---否
-            json.put("ar_recbill", ar_recbill);
-
-            JSONArray ar_recitem = new JSONArray();
-            JSONObject ar_recitemJson = new JSONObject();
-            ar_recitemJson.put("srcsystemid", srcsystemid); //外系统子表标识
-            ar_recitemJson.put("scomment", model.getRemark()); //摘要,非必选
-            ar_recitemJson.put("objtype", "0"); //0=客户,1=供应商--判断customer和supplier是否必填,必选
-            ar_recitemJson.put("customer", model.getInvoiceHeaderNumber()); //客商的纳税人识别号
-            ar_recitemJson.put("money_de", model.getInvoiceAmount()); //金额,必选
-            ar_recitemJson.put("taxrate", invoiceTax); //税率,必选,无税传0
-            ar_recitemJson.put("pk_subjcode", InvoiceConstant.INVOICE_PAYMENT_TYPE_AJ003); //收支项目编码,非必选
-            ar_recitemJson.put("def11", parkRoom.getId()); //转出前房号编码,收除了诚意金之外的首期等需要选
-            ar_recitemJson.put("def9", InvoiceConstant.INVOICE_BUSINESS_FORMAT_001); //业态,必选,看云文档业态
-            ar_recitemJson.put("def7", parkInfo.getProjectCode()); //房产工程项目,必选,看云文档
-            ar_recitemJson.put("def8", parkRoom.getBuildId()); //楼栋,必选,看云文档
-            ar_recitemJson.put("material", material); //物料
-            ar_recitem.add(ar_recitemJson);
-            json.put("ar_recitem", ar_recitem);
-            result = InvoiceUtil.recbillAdd(json);
-
+        String def26 = "江苏省无锡市";
+        if (StringUtils.isNotEmpty(parkInfo.getRegionalismCode())) {
+            String dictLabel = sysDictService.getDictLabel("REGIONALISM_CODE", parkInfo.getRegionalismCode());
+            def26 = def26 + dictLabel;
         }
+        def26 = def26 + parkInfo.getGroupName() + roomResponse.getDiscName() + roomResponse.getBuildName()
+                + "号" + roomResponse.getRoomNo() + "室";
+
+
+        Double invoiceTax = Double.parseDouble(model.getInvoiceTax()) * 100;
+        JSONObject json = new JSONObject();
+        JSONObject ar_recbill = new JSONObject();
+        String srcsystemid = model.getId();
+        String billdate = DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, new Date());
+        ar_recbill.put("srcsystemid", srcsystemid); //外系统标识,必选
+        ar_recbill.put("pk_tradetype", InvoiceConstant.INVOICE_BUSINESS_F0_Cxx_05); //交易类型,必选
+        ar_recbill.put("pk_org", parkInfo.getOrganizationalCode()); //组织编码,必选
+        ar_recbill.put("billdate", billdate); //单据日期
+        ar_recbill.put("def2", srcsystemid); //外系统单据号,必填,
+        ar_recbill.put("def18", "2"); //销售发票类型,1-全电专票,2-全电普票
+        ar_recbill.put("def23", "E05"); //特殊票种标识,默认是E05
+        ar_recbill.put("def24", "0"); //征税方式,必填,默认0
+        ar_recbill.put("def26", def26); //不动产地址 必填
+        ar_recbill.put("def25", "N"); // 跨地市标志,必填,Y--是;N---否
+        json.put("ar_recbill", ar_recbill);
+
+        JSONArray ar_recitem = new JSONArray();
+        JSONObject ar_recitemJson = new JSONObject();
+        ar_recitemJson.put("srcsystemid", srcsystemid); //外系统子表标识
+        ar_recitemJson.put("scomment", model.getRemark()); //摘要,非必选
+        ar_recitemJson.put("objtype", "0"); //0=客户,1=供应商--判断customer和supplier是否必填,必选
+        ar_recitemJson.put("customer", model.getInvoiceHeaderNumber()); //客商的纳税人识别号
+        ar_recitemJson.put("money_de", model.getInvoiceAmount()); //金额,必选
+        ar_recitemJson.put("taxrate", invoiceTax); //税率,必选,无税传0
+        ar_recitemJson.put("pk_subjcode", InvoiceConstant.INVOICE_PAYMENT_TYPE_AJ003); //收支项目编码,非必选
+        ar_recitemJson.put("def11", parkRoom.getId()); //转出前房号编码,收除了诚意金之外的首期等需要选
+        ar_recitemJson.put("def9", InvoiceConstant.INVOICE_BUSINESS_FORMAT_001); //业态,必选,看云文档业态
+        ar_recitemJson.put("def7", parkInfo.getProjectCode()); //房产工程项目,必选,看云文档
+        ar_recitemJson.put("def8", parkRoom.getBuildId()); //楼栋,必选,看云文档
+        ar_recitemJson.put("material", material); //物料
+        ar_recitem.add(ar_recitemJson);
+        json.put("ar_recitem", ar_recitem);
+        result = InvoiceUtil.recbillAdd(json);
 
         return result;
 
@@ -622,6 +569,11 @@ public class InvoiceManageService implements BaseService<InvoiceManage, InvoiceM
                     invoiceManage.setNcCode(code);
                     invoiceManageService.updateByPrimaryKeySelective(invoiceManage);
                 } else if ("false".equals(success)) {
+                    invoiceManage.setSendStatus("2");
+                    invoiceManage.setSubmitTime(new Date());
+                    invoiceManage.setSubmitUser(ShiroUtils.getUserId());
+                    invoiceManage.setNcJson(result);
+                    invoiceManageService.updateByPrimaryKeySelective(invoiceManage);
                     throw new RuntimeException(jsonObject.getString("message"));
                 }
             }

+ 74 - 2
pro-base/src/main/java/com/idea/invoice/task/InvoiceTask.java

@@ -15,7 +15,9 @@ import com.idea.buildManage.service.ParkRoomService;
 import com.idea.customerManagement.dto.CustomerManagementDto;
 import com.idea.customerManagement.model.Buyer;
 import com.idea.customerManagement.service.CustomerManagementService;
+import com.idea.invoice.mapper.InvoiceManageExtendMapper;
 import com.idea.invoice.model.InvoiceManage;
+import com.idea.invoice.model.InvoiceManageExample;
 import com.idea.invoice.service.InvoiceManageService;
 import com.idea.invoice.util.InvoiceConstant;
 import com.idea.invoice.util.InvoiceUtil;
@@ -27,8 +29,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Component;
 
-import java.util.Date;
-import java.util.List;
+import java.util.*;
 import java.util.stream.Collectors;
 
 @Slf4j
@@ -47,6 +48,8 @@ public class InvoiceTask {
     private ParkRoomService roomService;
     @Autowired
     private CustomerManagementService customerManagementService;
+    @Autowired
+    private InvoiceManageExtendMapper invoiceManageExtendMapper;
 
 
 
@@ -193,4 +196,73 @@ public class InvoiceTask {
     }
 
 
+    /**
+     * 查询发票状态
+     */
+    //    @Scheduled(cron = "0 0 0 1/1 * ?")
+    public void invoiceQuery(){
+
+        InvoiceManageExample example = new InvoiceManageExample();
+        example.createCriteria().andSendStatusEqualTo("1");
+        List<InvoiceManage> invoiceManages = invoiceManageService.selectByExample(example);
+        StringBuilder builder = new StringBuilder();
+        for(InvoiceManage invoiceManage : invoiceManages){
+            builder.append(invoiceManage.getNcCode()).append(",");
+        }
+        if(builder.length() > 0){
+            builder.deleteCharAt(builder.length()-1);
+        }
+        String billNo = builder.toString();
+        JSONObject json = new JSONObject();
+        json.put("billno",billNo);
+        Map<String, String> invoiceNoMap = new HashMap<>();
+        Map<String, String> statusMap = new HashMap<>();
+
+        try {
+            String result = InvoiceUtil.invoiceQuery(json);
+            JSONObject jsonObject = JSONObject.parseObject(result);
+            if(jsonObject.getString("success").equals("true")){
+                JSONArray array = jsonObject.getJSONArray("data");
+                for(int i=0;i<array.size();i++){
+                    JSONObject data = array.getJSONObject(i);
+                    // TODO: 2024/12/23 结转状态字段目前没有 
+                    String carryOverStatus = data.getString("结转状态字段");
+                    String invoiceno = data.getString("invoiceno");
+                    statusMap.put("billno", carryOverStatus);
+                    if(StringUtils.isNotEmpty(invoiceno)){
+                        invoiceNoMap.put("invoiceno", invoiceno);
+                    }
+                }
+            }
+        }catch (Exception e){
+            log.error("查询发票状态失败",e);
+        }
+
+        // 更新发票号
+        for (Map.Entry<String, String> entry : statusMap.entrySet()) {
+            String ncCode = entry.getKey();
+            String status = entry.getValue();
+            InvoiceManage invoiceManage = invoiceManageExtendMapper.needUpdateCarryOverStatus(ncCode);
+            invoiceManage.setCarryOverStatus(status);
+            invoiceManageService.updateByPrimaryKeySelective(invoiceManage);
+        }
+
+        // 更新结转状态
+        for (Map.Entry<String, String> entry : invoiceNoMap.entrySet()) {
+            String ncCode = entry.getKey();
+            String invoiceNo = entry.getValue();
+            InvoiceManage invoiceManage = invoiceManageExtendMapper.needUpdateNo(ncCode);
+            invoiceManage.setInvoiceNo(invoiceNo);
+            invoiceManageService.updateByPrimaryKeySelective(invoiceManage);
+        }
+
+    }
+
+
+
+
+
+
+
+
 }

+ 2 - 0
pro-base/src/main/java/com/idea/invoice/util/InvoiceUtil.java

@@ -94,6 +94,7 @@ public class InvoiceUtil {
         APICurUtils util = new APICurUtils();
         String token = InvoiceUtil.getToken(util);
         util.setApiUrl("nccloud/api/wxyy/uapbd/defdoc/add");
+        log.info("楼栋或房间新增传参:{}", json.toJSONString());
         String result = util.getAPIRetrun(token, json.toJSONString());
         log.info("楼栋或房间新增结果:{}", result);
         return result;
@@ -111,6 +112,7 @@ public class InvoiceUtil {
         JSONObject json = new JSONObject();
 //        json.put("pk_org", pk_org);
         json.put("code", pk_defdoclist);
+        log.info("楼栋或房间查看传参:{}", json.toJSONString());
         String result = util.getAPIRetrun(token, json.toJSONString());
         log.info("楼栋或房间查看:{}", result);
     }

+ 42 - 24
pro-base/src/main/java/com/idea/paymentManagement/service/PayLogService.java

@@ -199,28 +199,38 @@ public class PayLogService implements BaseService<PayLog, PayLogExample> {
                 // 全部收款
                 contractManage.setCollectionStatus(2);
 
-                // 查询该合同是否已生成 正式发票
+                // 先查询该合同在 提前开票中 是否有推送成功的
                 InvoiceManageExample invoiceManageExample = new InvoiceManageExample();
                 invoiceManageExample.createCriteria().andTypeEqualTo("1")
                         .andContractIdEqualTo(model.getContractId())
-                        .andPaymentTypeEqualTo("1");
+                        .andSendStatusEqualTo("1");
                 List<InvoiceManage> invoiceManages = invoiceManageService.selectByExample(invoiceManageExample);
-                if (CollectionUtils.isEmpty(invoiceManages)) {
-                    // 新增待推送的开票信息
-                    InvoiceManageDto invoiceManage = invoiceManageService.getInfoByContract(model.getContractId(),
-                            "*不动产*", 1);
-                    // 正式发票
-                    invoiceManage.setType("2");
-                    // 房款
-                    invoiceManage.setPaymentType("1");
-                    invoiceManage.setSendStatus("0");
-                    invoiceManage.setInvoiceStatus("0");
-                    invoiceManage.setInvoiceTax(null);
-                    invoiceManage.setRemark(null);
-                    invoiceManage.setCreateUser(userId);
-                    invoiceManage.setCreateTime(new Date());
-                    invoiceManageService.insertSelective(invoiceManage);
+                // 不存在推送成功的 则新增 正式发票
+                if(CollectionUtils.isEmpty(invoiceManages)){
+                    // 查询该合同是否已生成 正式发票
+                    invoiceManageExample = new InvoiceManageExample();
+                    invoiceManageExample.createCriteria().andTypeEqualTo("2")
+                            .andContractIdEqualTo(model.getContractId())
+                            .andPaymentTypeEqualTo("1");
+                    List<InvoiceManage> formalInvoiceManages = invoiceManageService.selectByExample(invoiceManageExample);
+                    if (CollectionUtils.isEmpty(formalInvoiceManages)) {
+                        // 新增待推送的开票信息
+                        InvoiceManageDto invoiceManage = invoiceManageService.getInfoByContract(model.getContractId(),
+                                "*不动产*", 1);
+                        // 正式发票
+                        invoiceManage.setType("2");
+                        // 房款
+                        invoiceManage.setPaymentType("1");
+                        invoiceManage.setSendStatus("0");
+                        invoiceManage.setInvoiceStatus("0");
+                        invoiceManage.setInvoiceTax(null);
+                        invoiceManage.setRemark(null);
+                        invoiceManage.setCreateUser(userId);
+                        invoiceManage.setCreateTime(new Date());
+                        invoiceManageService.insertSelective(invoiceManage);
+                    }
                 }
+
             }
         }
         contractManageMapper.updateByPrimaryKeySelective(contractManage);
@@ -248,10 +258,10 @@ public class PayLogService implements BaseService<PayLog, PayLogExample> {
                 receiptType = "";
                 break;
             case 5: // 楼款
-                receiptType = "";
+                receiptType = "7";
                 break;
             case 6: // 补差款
-                receiptType = "";
+                receiptType = "8";
                 break;
             case 7: // 意向金
                 receiptType = "1";
@@ -271,11 +281,19 @@ public class PayLogService implements BaseService<PayLog, PayLogExample> {
         String discId = customerManagement.getDiscId();
         Integer contentType = model.getContentType();
         String type = "";
-        if (contentType == 2) {
-            type = "SQ";
-        }
-        if (contentType == 3) {
-            type = "YHAJ";
+        switch (contentType) {
+            case 2:
+                type = "SQ";
+                break;
+            case 3:
+                type = "YHAJ";
+                break;
+            case 5:
+                type = "LK";
+                break;
+            case 6:
+                type = "BCK";
+                break;
         }
         // 查找这个小区已收取 首期或银行按揭的 数据量
         Integer count = extendMapper.countByGroupId(groupId, String.valueOf(contentType));

+ 1 - 1
pro-base/src/main/resources/mybatis/buildManage/MnpBuildingExtendMapper.xml

@@ -33,7 +33,7 @@
     left JOIN park_info on mnp_building.group_id = park_info.id
     left JOIN park_floor_disc on mnp_building.disc_id = park_floor_disc.id
     <where>
-        and mnp_building.del_flag != '0'
+        and mnp_building.del_flag != '1'
       <if test="buildNum != null and buildNum != '' ">
         and mnp_building.build_num like  concat('%',#{buildNum},'%')
       </if>

+ 1 - 1
pro-base/src/main/resources/mybatis/buildManage/ParkRoomExtendMapper.xml

@@ -9,7 +9,7 @@
     left join park_floor_disc d on d.id = r.disc_id
     left join park_info p on p.id = r.group_id
     <where>
-        and r.del_flag != '0'
+        and r.del_flag != '1'
       <if test="roomUseStr != null and roomUseStr != ''">
         and r.room_use in (${roomUseStr})
       </if>

+ 10 - 0
pro-base/src/main/resources/mybatis/invoice/InvoiceManageExtendMapper.xml

@@ -56,5 +56,15 @@
         select * from invoice_manage where nc_code is null or nc_code = ''
     </select>
 
+    <select id="needUpdateNo" resultType="com.idea.invoice.model.InvoiceManage">
+        select * from invoice_manage
+        where nc_code = #{ncCode} and ifnull(invoice_status,'') = ''
+    </select>
+
+    <select id="needUpdateCarryOverStatus" resultType="com.idea.invoice.model.InvoiceManage">
+        select * from invoice_manage
+        where nc_code = #{ncCode} and ifnull(carry_over_status,'') = ''
+    </select>
+
 
 </mapper>