| 
					
				 | 
			
			
				@@ -37,13 +37,12 @@ import java.util.*; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 /** 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  * 财务主Service业务层处理 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- *  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ * 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  * @author ruoyi 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  * @date 2021-03-12 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 @Service 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-public class FTmsaccbillsServiceImpl implements IFTmsaccbillsService 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+public class FTmsaccbillsServiceImpl implements IFTmsaccbillsService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     @Autowired 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     private FTmsaccbillsMapper fTmsaccbillsMapper; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -74,18 +73,6 @@ public class FTmsaccbillsServiceImpl implements IFTmsaccbillsService 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     @Autowired 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     private ISysDictDataService iSysDictDataService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    /** 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-     * 查询财务主 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-     *  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-     * @param id 财务主ID 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-     * @return 财务主 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-     */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    @Override 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    public FTmsaccbills selectFTmsaccbillsById(Long id) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        return fTmsaccbillsMapper.selectFTmsaccbillsById(id); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     @Override 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     public Map<String, Object> selectFTmsaccbillsAndItemsById(Long fId) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         Map<String, Object> map = new HashMap<>(); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -100,50 +87,50 @@ public class FTmsaccbillsServiceImpl implements IFTmsaccbillsService 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         // 查询从表数据 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         FTmsaccbillsitems fTmsaccbillsitems = new FTmsaccbillsitems(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         fTmsaccbillsitems.setFPid(fId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        List<FTmsaccbillsitems> fTmsaccbillsitemsList=  fTmsaccbillsitemsMapper.selectFTmsaccbillsitemsList(fTmsaccbillsitems); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        List<Map<String, Object>> feeDoList=new ArrayList<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        List<FTmsaccbillsitems> fTmsaccbillsitemsList = fTmsaccbillsitemsMapper.selectFTmsaccbillsitemsList(fTmsaccbillsitems); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        List<Map<String, Object>> feeDoList = new ArrayList<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         if (StringUtils.isNotEmpty(fTmsaccbillsitemsList)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            for (FTmsaccbillsitems  fees : fTmsaccbillsitemsList) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            for (FTmsaccbillsitems fees : fTmsaccbillsitemsList) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 Map<String, Object> map1 = new HashMap<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 // 主表数 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 Ftmsorderbills ftmsorderbills = ftmsorderbillsMapper.selectftmsorderbillsById(fees.getFSrcpid()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 Ftmsorderbillsfees ftmsorderbillsfees = ftmsorderbillsfeesMapper.selectFTmsorderbillsfeesById(fees.getFSrcid()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 TFees tFees = new TFees(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                if(null!=ftmsorderbillsfees.getfFeeid()){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                     tFees= tFeesMapper.selectTFeesById(ftmsorderbillsfees.getfFeeid()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                if (null != ftmsorderbillsfees.getfFeeid()) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    tFees = tFeesMapper.selectTFeesById(ftmsorderbillsfees.getfFeeid()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 // 字典宝 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                SysDictData sysDictData =new SysDictData(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                SysDictData sysDictData = new SysDictData(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 sysDictData.setDictType("data_unitfees"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 sysDictData.setDictValue(String.valueOf(ftmsorderbillsfees.getfFeeunitid())); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 sysDictData.setStatus("0"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 List<SysDictData> sysDictDataList = iSysDictDataService.selectDictDataList(sysDictData); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                map1.put("fSrcpid",fees.getFSrcpid());  //  主表ID 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                map1.put("fName",ftmsorderbills.getCorpId());//  客户 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                map1.put("fSrcpid", fees.getFSrcpid());  //  主表ID 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                map1.put("fName", ftmsorderbills.getCorpId());//  客户 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 corpsId.add(ftmsorderbills.getCorpId()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                map1.put("fSrcid",fees.getFSrcid()); // 费用ID 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                map1.put("fFeesName",ftmsorderbillsfees.getfCorpid());// 结算单位 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                map1.put("fSrcid", fees.getFSrcid()); // 费用ID 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                map1.put("fFeesName", ftmsorderbillsfees.getfCorpid());// 结算单位 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 corpsId.add(ftmsorderbillsfees.getfCorpid()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                map1.put("fMblno",ftmsorderbills.getMblno()); //提单号 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                map1.put("fProductName",ftmsorderbillsfees.getfProductName()); //提单号 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                map1.put("createTime",ftmsorderbillsfees.getCreateTime()); //业务日期 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                map1.put("actId",ftmsorderbillsfees.getActId()); // 业务类型 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                map1.put("billType",ftmsorderbills.getBillType()); // 作业类型 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                if(null!=tFees.getfName()){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    map1.put("fFeeName",tFees.getfName()); // 作业类型 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                }else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    map1.put("fFeeName",null); // 作业类型 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                map1.put("fMblno", ftmsorderbills.getMblno()); //提单号 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                map1.put("fProductName", ftmsorderbillsfees.getfProductName()); //提单号 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                map1.put("createTime", ftmsorderbillsfees.getCreateTime()); //业务日期 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                map1.put("actId", ftmsorderbillsfees.getActId()); // 业务类型 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                map1.put("billType", ftmsorderbills.getBillType()); // 作业类型 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                if (null != tFees.getfName()) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    map1.put("fFeeName", tFees.getfName()); // 作业类型 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    map1.put("fFeeName", null); // 作业类型 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 feesId.add(ftmsorderbillsfees.getfFeeunitid()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                map1.put("fSrcdc",fees.getDc()); // 收付 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                map1.put("fAmt",fees.getAmtOrg()); // 数量 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                map1.put("fAmtdr",fees.getAmtCur()); // 金额 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                map1.put("fQty",ftmsorderbillsfees.getfQty()); // 数量 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                map1.put("fAmount",fees.getAmtOrg()); // 金额 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                map1.put("fFeeunitid",sysDictDataList.get(0).getDictLabel()); //计价单位 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                map1.put("loadDate",ftmsorderbills.getLoadDate()); // 计费开始日期 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                map1.put("unLoadDate",ftmsorderbills.getUnLoadDate()); //计费截止日期 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                map1.put("fSrcdc", fees.getDc()); // 收付 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                map1.put("fAmt", fees.getAmtOrg()); // 数量 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                map1.put("fAmtdr", fees.getAmtCur()); // 金额 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                map1.put("fQty", ftmsorderbillsfees.getfQty()); // 数量 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                map1.put("fAmount", fees.getAmtOrg()); // 金额 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                map1.put("fFeeunitid", sysDictDataList.get(0).getDictLabel()); //计价单位 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                map1.put("loadDate", ftmsorderbills.getLoadDate()); // 计费开始日期 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                map1.put("unLoadDate", ftmsorderbills.getUnLoadDate()); //计费截止日期 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 feeDoList.add(map1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -163,86 +150,46 @@ public class FTmsaccbillsServiceImpl implements IFTmsaccbillsService 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 feesList.add(tFees); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        map.put("tFee",fTmsaccbills); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        map.put("corps",corpsList); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        map.put("tFee", fTmsaccbills); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        map.put("corps", corpsList); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         map.put("feesList", feesList); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        map.put("feeDoList",feeDoList); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        map.put("feeDoList", feeDoList); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         return map; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    /** 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-     * 查询财务主列表 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-     *  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-     * @param fTmsaccbills 财务主 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-     * @return 财务主 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-     */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    @Override 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    public List<FTmsaccbills> selectFTmsaccbillsList(FTmsaccbills fTmsaccbills) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        return fTmsaccbillsMapper.selectFTmsaccbillsList(fTmsaccbills); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     @Override 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     public List<Map<String, Object>> selectFTmsaccbillsMapList(FTmsaccbills fTmsaccbills) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         return fTmsaccbillsMapper.selectFTmsaccbillsMapList(fTmsaccbills); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     /** 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-     * 新增财务主 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-     *  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-     * @param fTmsaccbills 财务主 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-     * @return 结果 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-     */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    @Override 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    public int insertFTmsaccbills(FTmsaccbills fTmsaccbills) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        fTmsaccbills.setCreateTime(DateUtils.getNowDate()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        return fTmsaccbillsMapper.insertFTmsaccbills(fTmsaccbills); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    /** 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-     * 修改财务主 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-     *  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-     * @param fTmsaccbills 财务主 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-     * @return 结果 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-     */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    @Override 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    public int updateFTmsaccbills(FTmsaccbills fTmsaccbills) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        fTmsaccbills.setUpdateTime(DateUtils.getNowDate()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        return fTmsaccbillsMapper.updateFTmsaccbills(fTmsaccbills); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    /** 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				      * 批量删除财务主 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-     *  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     * 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				      * @param ids 需要删除的财务主ID 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				      * @return 结果 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				      */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     @Override 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    public int deleteFTmsaccbillsByIds(Long[] ids) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    public int deleteFTmsaccbillsByIds(Long[] ids) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         return fTmsaccbillsMapper.deleteFTmsaccbillsByIds(ids); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     /** 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				      * 删除财务主信息 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-     *  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     * 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				      * @param id 财务主ID 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				      * @return 结果 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				      */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     @Override 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    public int deleteFTmsaccbillsById(Long id) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    public int deleteFTmsaccbillsById(Long id) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         return fTmsaccbillsMapper.deleteFTmsaccbillsById(id); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     @Override 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     public List<Map<String, Object>> fTmsaccbillsList(FTmsaccbillsFees fTmsaccbillsFees, String billsType) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        List<Map<String, Object>> mapList =new ArrayList<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        if(billsType.equals("DZ")){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        List<Map<String, Object>> mapList = new ArrayList<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if (billsType.equals("SFDZ")) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             mapList = fTmsaccbillsMapper.fTmsaccbillsListAccamount(fTmsaccbillsFees); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        } else{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             mapList = fTmsaccbillsMapper.fTmsaccbillsList(fTmsaccbillsFees); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         return mapList; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -303,13 +250,13 @@ public class FTmsaccbillsServiceImpl implements IFTmsaccbillsService 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     @Override 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     public AjaxResult queryRemove(Long fId) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        FTmsaccbills tFee=fTmsaccbillsMapper.selectFTmsaccbillsById(fId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        FTmsaccbills tFee = fTmsaccbillsMapper.selectFTmsaccbillsById(fId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         FTmsaccbillsitems tFeeDo = new FTmsaccbillsitems(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         tFeeDo.setFSrcid(tFee.getId()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        List<FTmsaccbillsitems> tFeeDoList=  fTmsaccbillsitemsMapper.selectFTmsaccbillsitemsList(tFeeDo); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        if( StringUtils.isNull(tFee)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        List<FTmsaccbillsitems> tFeeDoList = fTmsaccbillsitemsMapper.selectFTmsaccbillsitemsList(tFeeDo); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if (StringUtils.isNull(tFee)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             return AjaxResult.success("0"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        } else if(StringUtils.isNotNull(tFee) && StringUtils.isEmpty(tFeeDoList) ){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } else if (StringUtils.isNotNull(tFee) && StringUtils.isEmpty(tFeeDoList)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             return AjaxResult.success("1"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             return AjaxResult.success("2"); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -322,6 +269,20 @@ public class FTmsaccbillsServiceImpl implements IFTmsaccbillsService 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         fTmsaccbills.setFBillstatus(4L); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         if (StringUtils.isNull(fTmsaccbills.getId())) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             // 如果是新数据 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            // 业务编码 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            BillnoDel billnoDel = new BillnoDel(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            billnoDel.setBillType(fBilltype); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            List<BillnoDel> billnoDels = billnoDelMapper.selectBillnoDelList(billnoDel); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            if (StringUtils.isNotEmpty(billnoDels)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                // 如果有数据在删除列表 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                billnoDelMapper.deleteBillnoDelById(billnoDels.get(0).getId()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                fTmsaccbills.setFBillno(billnoDels.get(0).getBillNo()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                // 生成流水号 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                Date time = new Date(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                String billNo = billnoSerialServiceImpl.getBillNo(fBilltype, time); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                fTmsaccbills.setFBillno(billNo); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             fTmsaccbills.setCreateBy(loginUser.getUser().getUserName()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             fTmsaccbills.setCreateTime(new Date()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             // 业务编码 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -334,44 +295,38 @@ public class FTmsaccbillsServiceImpl implements IFTmsaccbillsService 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             fTmsaccbills.setUpdateBy(loginUser.getUser().getUserName()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             fTmsaccbills.setUpdateTime(new Date()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             fTmsaccbillsMapper.updateFTmsaccbills(fTmsaccbills); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            // 删除从表 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            fTmsaccbillsitemsMapper.deleteByFPid(fTmsaccbills.getId()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        // 删除从表 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        fTmsaccbillsitemsMapper.deleteByFPid(fTmsaccbills.getId()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         //  财务从表 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        if (StringUtils.isNotNull(tfeeDo)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            JSONArray jsonDrArray = JSONArray.parseArray(tfeeDo); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            List<FTmsaccbillsitems> tFeeDoList = JSONObject.parseArray(jsonDrArray.toJSONString(), FTmsaccbillsitems.class); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            for (FTmsaccbillsitems tFeeDo : tFeeDoList) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                tFeeDo.setFSrcid(fTmsaccbills.getId()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                tFeeDo.setCreateBy(loginUser.getUser().getUserName()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                tFeeDo.setCreateTime(new Date()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                fTmsaccbillsitemsMapper.insertFTmsaccbillsitems(tFeeDo); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        if (StringUtils.isNotNull(tfeeDo) && !"[]".equals(tfeeDo)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            JSONArray jsonDrArray = JSONArray.parseArray(tfeeDo); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            List<FTmsaccbillsitems> tFeeDoList = JSONObject.parseArray(jsonDrArray.toJSONString(), FTmsaccbillsitems.class); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            for (FTmsaccbillsitems tFeeDo  : tFeeDoList) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                // 跟新费用明细 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                int m = updateBillsFees(fTmsaccbills.getId(),tFeeDo,fBilltype); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                if (m == 0) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    return AjaxResult.error("更新费用明细失败"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        JSONArray jsonDrArray = JSONArray.parseArray(tfeeDo); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        List<FTmsaccbillsitems> tFeeDoList = JSONObject.parseArray(jsonDrArray.toJSONString(), FTmsaccbillsitems.class); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        for (FTmsaccbillsitems tFeeDo : tFeeDoList) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            tFeeDo.setCreateTime(new Date()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            tFeeDo.setFSrcid(fTmsaccbills.getId()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            tFeeDo.setCreateBy(loginUser.getUser().getUserName()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            fTmsaccbillsitemsMapper.insertFTmsaccbillsitems(tFeeDo); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            // 跟新费用明细 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            int m = updateBillsFees(fTmsaccbills.getId(), tFeeDo, fBilltype); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            if (m == 0) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                return AjaxResult.error("更新费用明细失败"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         AjaxResult ajaxResult = tfeeFollow(fTmsaccbills.getId(), 6L); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        Long code = Long.valueOf(String.valueOf(ajaxResult.get("code"))).longValue(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        String code = ajaxResult.get("code").toString(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if ("500".equals(code)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         return ajaxResult; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     @Transactional 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    public  int  updateBillsFees(Long fid,FTmsaccbillsitems tFeeDo,String billsType){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    public int updateBillsFees(Long fid, FTmsaccbillsitems tFeeDo, String billsType) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         // 查询从表数据 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         FTmsaccbills tFee = fTmsaccbillsMapper.selectFTmsaccbillsById(fid); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        if(billsType.equals("JSSF") || billsType.equals("JSFF")){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            billsType="DC"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if (billsType.equals("SFDZ") || billsType.equals("JSFF")) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            billsType = "DZ"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         Map<String, Object> map = new HashMap<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         map.put("tFee", tFee); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -393,11 +348,7 @@ public class FTmsaccbillsServiceImpl implements IFTmsaccbillsService 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             return AjaxResult.error("更新财务明细状态失败,请联系管理员"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        try{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            int itemUpdateResult = fTmsaccbillsitemsMapper.tfeeDoFollowUpdate(fPid,fettle); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        } catch (Exception exception){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            return AjaxResult.error("更新财务明细状态失败,请联系管理员"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        fTmsaccbillsitemsMapper.tfeeDoFollowUpdate(fPid, fettle); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         return AjaxResult.success(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 } 
			 |