|
@@ -237,6 +237,10 @@ public class TFeeServiceImpl implements ITFeeService {
|
|
|
map1.put("fFeeunitid", sysDictDataList.get(0).getDictLabel());
|
|
|
map1.put("fQty", tWarehousebillsfees.getfQty());
|
|
|
map1.put("fUnitprice", tWarehousebillsfees.getfUnitprice());
|
|
|
+ System.err.println("业务编号:" + fees.getfSrcBillno());
|
|
|
+ map1.put("fBillno",fees.getfSrcBillno());// 业务编号(单据编号)
|
|
|
+ System.err.println("发票号:" + fees.getfInvoiceNo());
|
|
|
+ map1.put("invoiceNo",fees.getfInvoiceNo());// 发票号
|
|
|
if (StringUtils.isNotEmpty(tWarehousebillsfees.getfBilltype()) && tWarehousebillsfees.getfBilltype().equals("KHDD")) {
|
|
|
map1.put("fBusinessType", "船运订单");
|
|
|
} else if (CollectionUtils.isNotEmpty(sysDictDataListIn)) {
|
|
@@ -398,18 +402,25 @@ public class TFeeServiceImpl implements ITFeeService {
|
|
|
tFee = tFeeMapper.selectTFeeById(fPid);
|
|
|
tFee.setSrcBillNo(tFee.getfBillno());
|
|
|
// 删除从表
|
|
|
- tFeeDoMapper.deleteByFPid(fPid);
|
|
|
+ // tFeeDoMapper.deleteByFPid(fPid);
|
|
|
}
|
|
|
// 财务从表
|
|
|
if (StringUtils.isNotNull(tfeeDo)) {
|
|
|
JSONArray jsonDrArray = JSONArray.parseArray(tfeeDo);
|
|
|
List<TFeeDo> tFeeDoList = JSONObject.parseArray(jsonDrArray.toJSONString(), TFeeDo.class);
|
|
|
for (TFeeDo tFeeDo : tFeeDoList) {
|
|
|
- tFeeDo.setfPid(fPid);
|
|
|
- tFeeDo.setCreateBy(loginUser.getUser().getUserName());
|
|
|
- tFeeDo.setCreateTime(new Date());
|
|
|
- tFeeDo.setfStatus("2");
|
|
|
- tFeeDoMapper.insertTFeeDo(tFeeDo);
|
|
|
+ if (StringUtils.isNull(tFeeDo.getfId())) {
|
|
|
+ tFeeDo.setfPid(fPid);
|
|
|
+ tFeeDo.setCreateBy(loginUser.getUser().getUserName());
|
|
|
+ tFeeDo.setCreateTime(new Date());
|
|
|
+ tFeeDo.setfStatus("2");
|
|
|
+ tFeeDoMapper.insertTFeeDo(tFeeDo);
|
|
|
+ } else {
|
|
|
+ // 走了修改
|
|
|
+ tFeeDo.setUpdateBy(loginUser.getUser().getUserName());
|
|
|
+ tFeeDo.setUpdateTime(new Date());
|
|
|
+ tFeeDoMapper.updateTFeeDo(tFeeDo);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
List<FinancialTFeeDoExcel> list = tFeeDoMapper.selectFinancialTFeeDo(fPid);
|
|
@@ -798,6 +809,15 @@ public class TFeeServiceImpl implements ITFeeService {
|
|
|
tFeeDoMapper.insertTFeeDo(tFeeDo);
|
|
|
}
|
|
|
}
|
|
|
+ // 点击对账、收费、付费提交审核时去掉费用
|
|
|
+ if (actId >= 210 && actId <= 230) {
|
|
|
+ AjaxResult ajaxResult = this.billsfeesFollow(tFee.getfId());
|
|
|
+ String code = ajaxResult.get("code").toString();
|
|
|
+ if ("500".equals(code)) {
|
|
|
+ TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
|
|
+ return ajaxResult;
|
|
|
+ }
|
|
|
+ }
|
|
|
//凯和收费提交审核时去掉钱
|
|
|
if (actId >= 430 && actId <= 450){
|
|
|
AjaxResult ajaxResult = this.billsfeesFollow(tFee.getfId());
|
|
@@ -819,17 +839,17 @@ public class TFeeServiceImpl implements ITFeeService {
|
|
|
auditItems.setRefno1(String.valueOf(tFee.getfCorpid())); // 货权方
|
|
|
auditItems.setRefno2(fBilltype);// 财务类型
|
|
|
auditItems.setRefno3(tFee.gettMblno());// 提单号
|
|
|
- auditItems.setSendUserId(loginUser.getUser().getUserId());
|
|
|
- auditItems.setSendName(loginUser.getUsername());
|
|
|
- auditItems.setSendTime(new Date());
|
|
|
- auditItems.setAuditUserId(loginUser.getUser().getUserId());
|
|
|
- auditItems.setAuditItem(new Date());
|
|
|
- auditItems.setAuditOpTime(new Date());
|
|
|
- auditItems.setFidStatus("f_billstatus");
|
|
|
- auditItems.setTimes(1L);
|
|
|
+ auditItems.setSendUserId(loginUser.getUser().getUserId()); // 请核人 ID
|
|
|
+ auditItems.setSendName(loginUser.getUsername()); // 请核人名称
|
|
|
+ auditItems.setSendTime(new Date()); // 请核时间
|
|
|
+ auditItems.setAuditUserId(loginUser.getUser().getUserId());// 审核人 ID
|
|
|
+ auditItems.setAuditItem(new Date());// 审核通过时间
|
|
|
+ auditItems.setAuditOpTime(new Date());// 审核时间
|
|
|
+ auditItems.setFidStatus("f_billstatus");// 存储对应审批字段
|
|
|
+ auditItems.setTimes(1L);// 第几次提交审批
|
|
|
auditItems.setAuditMsg("提交");
|
|
|
- auditItems.setAuditStatus("O");
|
|
|
- AjaxResult approvalFlow = auditItemsService.createApprovalFlow(auditItems);
|
|
|
+ auditItems.setAuditStatus("O");// 提交状态
|
|
|
+ AjaxResult approvalFlow = auditItemsService.createApprovalFlow(auditItems);// 生成审批流
|
|
|
Long code = Long.valueOf(String.valueOf(approvalFlow.get("code"))).longValue();
|
|
|
if (code.equals(500L)) {
|
|
|
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
|
@@ -1182,6 +1202,32 @@ public class TFeeServiceImpl implements ITFeeService {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
+ * 账单管理撤销对账、收费、付费
|
|
|
+ * @param fPid
|
|
|
+ * @param fBillType
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Transactional
|
|
|
+ public AjaxResult updateDSFMoney(Long fPid,String fBillType){
|
|
|
+ if (StringUtils.isNull(fPid)) {
|
|
|
+ return AjaxResult.error("费用明细更新状态未找到主表信息,请与管理员联系");
|
|
|
+ }
|
|
|
+ TFee tFee = tFeeMapper.selectTFeeById(fPid);
|
|
|
+ // 获取从表数据
|
|
|
+ TFeeDo tFeeDo = new TFeeDo();
|
|
|
+ tFeeDo.setfPid(fPid);
|
|
|
+ List<TFeeDo> tFeeDos = tFeeDoMapper.selectTFeeDoList(tFeeDo);
|
|
|
+ for (TFeeDo tFeeDo1 : tFeeDos) {
|
|
|
+ int m = updateBillsFees(fPid, tFeeDo1, fBillType);
|
|
|
+ if (m == 0) {
|
|
|
+ TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
|
|
+ return AjaxResult.error("更新费用明细失败");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return AjaxResult.success();
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
* 凯和撤销收费 付费 对账
|
|
|
* @param fPid
|
|
|
* @param fBillType
|