This commit is contained in:
linfso 2025-06-18 15:04:33 +08:00
parent 58e904c23a
commit 3b35c592bf

View File

@ -209,6 +209,8 @@ public class EmisWaybillAjustApplyServiceImpl extends EmisBaseService implements
throw new EmisBizError(EmisBizErrorType.FAIL,"已审核!"); throw new EmisBizError(EmisBizErrorType.FAIL,"已审核!");
} }
emisWaybillAjustApply.setBlDestConfirmed("1"); emisWaybillAjustApply.setBlDestConfirmed("1");
emisWaybillAjustApply.setDestConfirmManCode(getCurrentUser().getEmpCode()); emisWaybillAjustApply.setDestConfirmManCode(getCurrentUser().getEmpCode());
@ -242,6 +244,8 @@ public class EmisWaybillAjustApplyServiceImpl extends EmisBaseService implements
@Override @Override
public int auditCenterPass(EmisWaybillAjustApply emisWaybillAjustApply) throws EmisBizError { public int auditCenterPass(EmisWaybillAjustApply emisWaybillAjustApply) throws EmisBizError {
boolean isDZZS=false;
// 重新从数据库取信息 // 重新从数据库取信息
emisWaybillAjustApply = emisWaybillAjustApplyMapper.selectEmisWaybillAjustApplyById(emisWaybillAjustApply.getId()); emisWaybillAjustApply = emisWaybillAjustApplyMapper.selectEmisWaybillAjustApplyById(emisWaybillAjustApply.getId());
@ -252,59 +256,75 @@ public class EmisWaybillAjustApplyServiceImpl extends EmisBaseService implements
emisWaybillAjustApply.setBlCenterConfirmed("1"); emisWaybillAjustApply.setBlCenterConfirmed("1");
emisWaybillAjustApply.setCenterConfirmManCode(getCurrentUser().getEmpCode()); emisWaybillAjustApply.setCenterConfirmManCode(getCurrentUser().getEmpCode());
// 判断申请人是否是[单证专属]岗位
SysUser opUser = getEmisStaffByCode(emisWaybillAjustApply.getApplyManCode());
// 获取账单状态,若账单处于非未确认状态,不允许审核 if (opUser != null) {
List<EmisSettleSubBill> emisSettleSubBillList=getSettleSubBillListByBillCode(emisWaybillAjustApply.getBillCode()); // 判断申请人是否是单证专属
if(!CollectionUtils.isEmpty(emisSettleSubBillList)){ List<Long> postIds = postMapper.selectPostListByUserId(opUser.getUserId());
if (!CollectionUtils.isEmpty(postIds)) {
if(emisSettleSubBillList.size()>1){ for (Long poId : postIds) {
throw new EmisBizError(EmisBizErrorType.FAIL,"已拆子账单,不允许修改!"); if (poId == 18) {
isDZZS = true;
break;
}
}
}
} }
for (EmisSettleSubBill emisSettleSubBill:emisSettleSubBillList) { // 非单证专属则判断
if("1".equals(emisSettleSubBill.getBlConfirmCenter())){ if(!isDZZS) {
throw new EmisBizError(EmisBizErrorType.FAIL,"财务已确认账单,不允许审核,请先取消财务确认!"); // 获取账单状态,若账单处于非未确认状态,不允许审核
List<EmisSettleSubBill> emisSettleSubBillList = getSettleSubBillListByBillCode(emisWaybillAjustApply.getBillCode());
if (!CollectionUtils.isEmpty(emisSettleSubBillList)) {
if (emisSettleSubBillList.size() > 1) {
throw new EmisBizError(EmisBizErrorType.FAIL, "已拆子账单,不允许修改!");
}
for (EmisSettleSubBill emisSettleSubBill : emisSettleSubBillList) {
if ("1".equals(emisSettleSubBill.getBlConfirmCenter())) {
throw new EmisBizError(EmisBizErrorType.FAIL, "财务已确认账单,不允许审核,请先取消财务确认!");
} }
// 如果已定制账单,并且新的销售联系人、回款联系人不一致,必须从定制账单中移除 // 如果已定制账单,并且新的销售联系人、回款联系人不一致,必须从定制账单中移除
if("1".equals(emisSettleSubBill.getBlMerge())){ if ("1".equals(emisSettleSubBill.getBlMerge())) {
// 判断是否调整销售联系人或回款联系人,如调整,需要先从账单里移除 // 判断是否调整销售联系人或回款联系人,如调整,需要先从账单里移除
String newDataStr=emisWaybillAjustApply.getJsonData(); String newDataStr = emisWaybillAjustApply.getJsonData();
JSONObject jObj = JSONObject.parseObject(newDataStr); JSONObject jObj = JSONObject.parseObject(newDataStr);
JSONObject jobjOldValue=jObj.getJSONObject("oldValue"); JSONObject jobjOldValue = jObj.getJSONObject("oldValue");
JSONObject jobjNewValue=jObj.getJSONObject("newValue"); JSONObject jobjNewValue = jObj.getJSONObject("newValue");
String oldPaymentType = jobjOldValue.getString("paymentType"); String oldPaymentType = jobjOldValue.getString("paymentType");
String oldCustNo = jobjOldValue.getString("custNo"); String oldCustNo = jobjOldValue.getString("custNo");
String oldPayee=emisSettleSubBill.getPayee(); String oldPayee = emisSettleSubBill.getPayee();
String oldSalesmen=emisSettleSubBill.getSalesmen(); String oldSalesmen = emisSettleSubBill.getSalesmen();
String newPaymentType = jobjNewValue.getString("paymentType"); String newPaymentType = jobjNewValue.getString("paymentType");
String newCustNo = jobjNewValue.getString("custNo"); String newCustNo = jobjNewValue.getString("custNo");
String newPayee=jobjNewValue.getString("payee"); String newPayee = jobjNewValue.getString("payee");
String newSalesmen=jobjNewValue.getString("salesmen"); String newSalesmen = jobjNewValue.getString("salesmen");
if( !oldPayee.equals(newPayee) || !oldSalesmen.equals(newSalesmen) ){ if (!oldPayee.equals(newPayee) || !oldSalesmen.equals(newSalesmen)) {
throw new EmisBizError(EmisBizErrorType.FAIL,"已定制账单,销售联系/回款联系人发生改变,请从原账单移除,单号:"+emisSettleSubBill.getBillNo()); throw new EmisBizError(EmisBizErrorType.FAIL, "已定制账单,销售联系/回款联系人发生改变,请从原账单移除,单号:" + emisSettleSubBill.getBillNo());
} }
// bug: 1412 支付方式发生改变,需要从账单中移除 // bug: 1412 支付方式发生改变,需要从账单中移除
if( !oldPaymentType.equals(newPaymentType)){ if (!oldPaymentType.equals(newPaymentType)) {
throw new EmisBizError(EmisBizErrorType.FAIL,"已定制账单,支付方式发生改变,请从原账单移除,单号:"+emisSettleSubBill.getBillNo()); throw new EmisBizError(EmisBizErrorType.FAIL, "已定制账单,支付方式发生改变,请从原账单移除,单号:" + emisSettleSubBill.getBillNo());
} }
// bug: 1412 月结客户发生改变,都需要从账单中移除 // bug: 1412 月结客户发生改变,都需要从账单中移除
if(!StringUtils.isEmpty(newCustNo)){ if (!StringUtils.isEmpty(newCustNo)) {
if( !newCustNo.equals(oldCustNo)){ if (!newCustNo.equals(oldCustNo)) {
throw new EmisBizError(EmisBizErrorType.FAIL,"已定制账单,月结客户发生改变,请从原账单移除,单号:"+emisSettleSubBill.getBillNo()); throw new EmisBizError(EmisBizErrorType.FAIL, "已定制账单,月结客户发生改变,请从原账单移除,单号:" + emisSettleSubBill.getBillNo());
} }
} }
} }
} }
} }
}
// 运单更新 // 运单更新
JSONObject jsonObject = JSONObject.parseObject(emisWaybillAjustApply.getJsonData()); JSONObject jsonObject = JSONObject.parseObject(emisWaybillAjustApply.getJsonData());
@ -342,24 +362,9 @@ public class EmisWaybillAjustApplyServiceImpl extends EmisBaseService implements
// 审核通过 // 审核通过
emisWaybillAjustApplyMapper.auditCenterPass(emisWaybillAjustApply); emisWaybillAjustApplyMapper.auditCenterPass(emisWaybillAjustApply);
// 财务中心费用审核:数据部人员通过岗位登记的费用申请:修改项目“运费调整”,财务审批通过后数据直接修改不用再进行层层审核; //bug:1610 财务中心费用审核:数据部人员通过岗位登记的费用申请:修改项目“运费调整”,财务审批通过后数据直接修改不用再进行层层审核;
// 运费调整类型 // 运费调整类型
if("9".equals(emisWaybillAjustApply.getApplyType())){ if("9".equals(emisWaybillAjustApply.getApplyType())){
SysUser opUser=getEmisStaffByCode(emisWaybillAjustApply.getApplyManCode());
if(opUser!=null){
// 判断申请人是否是单证专属
boolean isDZZS=false;
List<Long> postIds=postMapper.selectPostListByUserId(opUser.getUserId());
if(!CollectionUtils.isEmpty(postIds)){
for(Long poId:postIds){
if(poId==18){
isDZZS=true;
break;
}
}
}
// 若是单证专属则自动确认账单 // 若是单证专属则自动确认账单
if(isDZZS) { if(isDZZS) {
// 自动确认账单 // 自动确认账单
@ -410,9 +415,6 @@ public class EmisWaybillAjustApplyServiceImpl extends EmisBaseService implements
} }
} }
}
return 1; return 1;
} }