|  | @@ -789,8 +789,6 @@ public class TFeeServiceImpl implements ITFeeService {
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |          TFee tFee = JSONArray.parseObject(tfee, TFee.class);
 | 
	
		
			
				|  |  | -        // 声明业务编号 list
 | 
	
		
			
				|  |  | -        List<String> fSrcBillnos = new ArrayList<>();
 | 
	
		
			
				|  |  |          String billstatus = "";
 | 
	
		
			
				|  |  |          if (isApprove) {
 | 
	
		
			
				|  |  |              billstatus = "4";
 | 
	
	
		
			
				|  | @@ -817,13 +815,14 @@ public class TFeeServiceImpl implements ITFeeService {
 | 
	
		
			
				|  |  |          // 删除从表
 | 
	
		
			
				|  |  |          //tFeeDoMapper.deleteByFPid(tFee.getfId());
 | 
	
		
			
				|  |  |          messageMap.put("tFee", tFee);
 | 
	
		
			
				|  |  | -        // fSrcBillnos.add(tFee.getfSrcBillno());
 | 
	
		
			
				|  |  | +        // 声明业务编号 list
 | 
	
		
			
				|  |  | +        List<String> fSrcBillnos = new ArrayList<>();
 | 
	
		
			
				|  |  |          //  财务从表
 | 
	
		
			
				|  |  |          if (StringUtils.isNotNull(tfeeDo) && !"[]".equals(tfeeDo)) {
 | 
	
		
			
				|  |  |              JSONArray jsonDrArray = JSONArray.parseArray(tfeeDo);
 | 
	
		
			
				|  |  |              List<TFeeDo> tFeeDoList = JSONObject.parseArray(jsonDrArray.toJSONString(), TFeeDo.class);
 | 
	
		
			
				|  |  |              for (TFeeDo tFeeDo : tFeeDoList) {
 | 
	
		
			
				|  |  | -                if (StringUtils.isNull(tFeeDo.getfId())) {
 | 
	
		
			
				|  |  | +                if (StringUtils.isNull(tFeeDo.getfId())) { // 走新建
 | 
	
		
			
				|  |  |                      Map<String, Object> map = this.judgeMoney(tFeeDo.getfSrcid(), tFeeDo.getfAmt(), fBilltype, tFeeDo.getfFeeid());
 | 
	
		
			
				|  |  |                      if (!(Boolean) map.get("flag")) {
 | 
	
		
			
				|  |  |                          TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
 | 
	
	
		
			
				|  | @@ -838,11 +837,16 @@ public class TFeeServiceImpl implements ITFeeService {
 | 
	
		
			
				|  |  |                          fSrcBillnos.add(tFeeDo.getfSrcBillno());
 | 
	
		
			
				|  |  |                      }
 | 
	
		
			
				|  |  |                      tFeeDoMapper.insertTFeeDo(tFeeDo);
 | 
	
		
			
				|  |  | -                } else {
 | 
	
		
			
				|  |  | -                    // 走了修改
 | 
	
		
			
				|  |  | -                    tFeeDo.setUpdateBy(loginUser.getUser().getUserName());
 | 
	
		
			
				|  |  | -                    tFeeDo.setUpdateTime(new Date());
 | 
	
		
			
				|  |  | -                    tFeeDoMapper.updateTFeeDo(tFeeDo);
 | 
	
		
			
				|  |  | +                } else { // 走修改
 | 
	
		
			
				|  |  | +                    // 根据传递的 tFeeDo的 id 获取到该条数据,避免直接传递是数据直接覆盖
 | 
	
		
			
				|  |  | +                    TFeeDo tfDo = tFeeDoMapper.selectTFeeDoById(tFeeDo.getfId());
 | 
	
		
			
				|  |  | +                    if (StringUtils.isNotNull(tfDo.getfSrcBillno())){
 | 
	
		
			
				|  |  | +                        // 装载业务编号
 | 
	
		
			
				|  |  | +                        fSrcBillnos.add(tfDo.getfSrcBillno());
 | 
	
		
			
				|  |  | +                    }
 | 
	
		
			
				|  |  | +                    tfDo.setUpdateBy(loginUser.getUser().getUserName());
 | 
	
		
			
				|  |  | +                    tfDo.setUpdateTime(new Date());
 | 
	
		
			
				|  |  | +                    tFeeDoMapper.updateTFeeDo(tfDo);
 | 
	
		
			
				|  |  |                  }
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |          }
 |