md
This commit is contained in:
parent
a8258cc29a
commit
caf68be50f
@ -28,6 +28,9 @@ public interface EmisSettleSubBillMapper extends BaseMapper<EmisSettleSubBill>
|
||||
*/
|
||||
public EmisSettleSubBill selectEmisSettleSubBillById(Long id);
|
||||
|
||||
|
||||
public EmisSettleSubBill selectSettleSubBillByBillCode(String billCode);
|
||||
|
||||
/**
|
||||
* 查询列表
|
||||
*
|
||||
|
||||
@ -959,7 +959,14 @@ public class EmisBaseService {
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取运单主账单信息
|
||||
* @param billCode
|
||||
* @return
|
||||
*/
|
||||
public EmisSettleSubBill getSettleSubBillByBillCode(String billCode){
|
||||
return emisSettleSubBillMapper.selectSettleSubBillByBillCode(billCode);
|
||||
}
|
||||
/**
|
||||
* 财务账单确认
|
||||
* @param emisSettleSubBill
|
||||
@ -1528,36 +1535,7 @@ public class EmisBaseService {
|
||||
String packTypeEn="";
|
||||
if(!StringUtils.isEmpty(waybill.getPackType())){
|
||||
packType=DictUtils.getDictLabel("emis_tab_packing_type",waybill.getPackType());
|
||||
// try {
|
||||
// packTypeEn= TransUtils.langTrans(packType,"zh-cn","en");
|
||||
// } catch (Exception e) {
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
|
||||
// 包装类型英文翻译
|
||||
/*
|
||||
|
||||
文件
|
||||
1
|
||||
1
|
||||
文件
|
||||
纸箱
|
||||
2
|
||||
2
|
||||
纸箱
|
||||
木箱
|
||||
3
|
||||
3
|
||||
木箱
|
||||
编织袋
|
||||
4
|
||||
4
|
||||
编织袋
|
||||
其它
|
||||
5
|
||||
5
|
||||
其它
|
||||
* */
|
||||
String [] packTypeArr = waybill.getPackType().split(",");
|
||||
if(packTypeArr.length>0){
|
||||
for(String type:packTypeArr){
|
||||
@ -1584,6 +1562,9 @@ public class EmisBaseService {
|
||||
order.put("packType",packType);
|
||||
order.put("packTypeEn",packTypeEn);
|
||||
|
||||
// 货值
|
||||
order.put("realValue",waybill.getRealValue());
|
||||
|
||||
|
||||
String paymentType="";
|
||||
if(!StringUtils.isEmpty(waybill.getPaymentType())){
|
||||
@ -2122,19 +2103,10 @@ public class EmisBaseService {
|
||||
//(2)当天开单次日上午9点后未锁帐,总部/财务中心修改;
|
||||
//(3)若运单已签收、已确认账单、已收款、已锁帐,登记申请审批后进行修改;
|
||||
|
||||
if("1".equals(emisWaybill.getBlBill())
|
||||
|| ScanType.SIGNED.opCode.equals(emisWaybill.getWaybillStatus())
|
||||
|| PaymentStatus.PAID.statusCode.equals(emisWaybill.getPaymentStatus())
|
||||
|| PaymentStatus.PAID_SOME.statusCode.equals(emisWaybill.getPaymentStatus())
|
||||
){
|
||||
return true;
|
||||
}
|
||||
|
||||
// 创建时间<服务器0点 次日9点锁账
|
||||
Date createTime = emisWaybill.getCreateTime();
|
||||
|
||||
Date now = new Date();
|
||||
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
int todayHour = calendar.get(Calendar.HOUR_OF_DAY);
|
||||
|
||||
@ -2161,6 +2133,32 @@ public class EmisBaseService {
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean checkDBBillIsLock(EmisWaybill emisWaybill) throws EmisBizError{
|
||||
// 判断是否已超时及锁账
|
||||
if(emisWaybill!=null ) {
|
||||
|
||||
if( PaymentStatus.PAID.statusCode.equals(emisWaybill.getPaymentStatus())
|
||||
|| PaymentStatus.PAID_SOME.statusCode.equals(emisWaybill.getPaymentStatus())
|
||||
){
|
||||
throw new EmisBizError(EmisBizErrorType.BILL_LOCK, "已付款,不允许修改");
|
||||
}
|
||||
|
||||
if ("1".equals(emisWaybill.getBlSign())) {
|
||||
throw new EmisBizError(EmisBizErrorType.BILL_LOCK, "已签收,不允许修改");
|
||||
}
|
||||
|
||||
if (isBillLock(emisWaybill)) {
|
||||
throw new EmisBizError(EmisBizErrorType.BILL_LOCK, "已锁账,不允许修改");
|
||||
}
|
||||
|
||||
if (isOutTimeLock(emisWaybill)) {
|
||||
throw new EmisBizError(EmisBizErrorType.BILL_LOCK, "已超时,不允许修改");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断账单锁账
|
||||
* @param emisWaybill
|
||||
@ -2168,6 +2166,16 @@ public class EmisBaseService {
|
||||
*/
|
||||
public boolean isBillLock(EmisWaybill emisWaybill) {
|
||||
|
||||
// 财务已确认账单不允许修改
|
||||
EmisSettleSubBill emisSettleSubBill=getSettleSubBillByBillCode(emisWaybill.getBillCode());
|
||||
if(emisSettleSubBill!=null){
|
||||
if("1".emisSettleSubBill.getBlConfirm()){
|
||||
// 财务确认出账明细锁账
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
// 系统锁账
|
||||
EmisSiteBillControl emisSiteBillControl = new EmisSiteBillControl();
|
||||
emisSiteBillControl.setSendSiteCode(emisWaybill.getSendCenterCode());
|
||||
emisSiteBillControl.setDestSiteCode(emisWaybill.getDestinationCenterCode());
|
||||
|
||||
@ -249,6 +249,9 @@ public class EmisTmsScanRecordServiceImpl extends EmisBaseService implements IEm
|
||||
scanResultItem.setBillCode(scanBillCode);
|
||||
scanResultItem.getData().putAll(scanDataItem);
|
||||
|
||||
// 判断是否是合包
|
||||
|
||||
|
||||
// 获取主单号
|
||||
String mainBillCode = getMainBillCode(scanBillCode);
|
||||
|
||||
|
||||
@ -161,26 +161,14 @@ public class EmisWaybillServiceImpl extends EmisBaseService implements IEmisWayb
|
||||
*/
|
||||
public WaybillOrder cvtEmisWaybillToWaybillOrder(EmisWaybill dbEmisWaybill) throws EmisBizError{
|
||||
|
||||
// 设置运单锁单指令
|
||||
boolean isLock=isOutTimeLock(dbEmisWaybill);
|
||||
if(isLock){
|
||||
// 检查是否锁单,打锁单标识
|
||||
dbEmisWaybill.setLockFlag("F");
|
||||
dbEmisWaybill.setLockReason("");
|
||||
try{
|
||||
checkDBBillIsLock(dbEmisWaybill);
|
||||
}catch(EmisBizError ex){
|
||||
dbEmisWaybill.setLockFlag("T");
|
||||
dbEmisWaybill.setLockReason("不允许修改");
|
||||
}else{
|
||||
dbEmisWaybill.setLockFlag("F");
|
||||
}
|
||||
|
||||
if("1".equals(dbEmisWaybill.getBlSign())){
|
||||
dbEmisWaybill.setLockFlag("T");
|
||||
dbEmisWaybill.setLockReason("已签收,不允许修改");
|
||||
}
|
||||
|
||||
boolean isBillLock=isBillLock(dbEmisWaybill);
|
||||
if(isBillLock){
|
||||
dbEmisWaybill.setLockFlag("T");
|
||||
dbEmisWaybill.setLockReason("已锁账,不允许修改");
|
||||
}else{
|
||||
dbEmisWaybill.setLockFlag("F");
|
||||
dbEmisWaybill.setLockReason(ex.getMessage());
|
||||
}
|
||||
|
||||
// 收费项
|
||||
@ -563,22 +551,9 @@ public class EmisWaybillServiceImpl extends EmisBaseService implements IEmisWayb
|
||||
}
|
||||
// 运单修改
|
||||
else{
|
||||
// 判断是否已超时及锁账
|
||||
if(emisWaybillOld!=null ) {
|
||||
|
||||
if (isOutTimeLock(emisWaybillOld)) {
|
||||
throw new EmisBizError(EmisBizErrorType.BILL_LOCK, "已超时,不允许修改");
|
||||
}
|
||||
|
||||
if ("1".equals(emisWaybillOld.getBlSign())) {
|
||||
throw new EmisBizError(EmisBizErrorType.BILL_LOCK, "已签收,不允许修改");
|
||||
}
|
||||
|
||||
if (isBillLock(emisWaybillOld)) {
|
||||
throw new EmisBizError(EmisBizErrorType.BILL_LOCK, "锁账,不允许修改");
|
||||
}
|
||||
}
|
||||
|
||||
// 检查是否已锁单
|
||||
checkDBBillIsLock(emisWaybillOld);
|
||||
|
||||
emisWaybillSave.setId(emisWaybillOld.getId());
|
||||
// 把历史发货日期带过来用于重新计算预估到到时间
|
||||
@ -591,6 +566,8 @@ public class EmisWaybillServiceImpl extends EmisBaseService implements IEmisWayb
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 取消订单
|
||||
* @param emisWaybill
|
||||
|
||||
@ -122,6 +122,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
from emis_settle_sub_bill a
|
||||
where a.id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="selectSettleSubBillByBillCode" parameterType="String" resultMap="EmisSettleSubBillResult">
|
||||
select id, bill_no, parent_bill_no, settle_bill_no, bill_code, bill_date, bill_fee, currency, settle_type, bl_split, bill_month, cust_no, customer_code, customer_name, bl_confirm, confirm_date, confirm_site, confirm_man_code, bl_site_confirm, confirm_note, site_confirm_date, site_confirm_man_code, site_confirm_note, del_flag, create_by, create_time, update_by, update_time, create_site, update_site
|
||||
from emis_settle_sub_bill a
|
||||
where a.del_flag='0' and a.bill_code = #{billCode} and a.parent_bill_no='0' limit 1
|
||||
</select>
|
||||
|
||||
<insert id="insertEmisSettleSubBill" parameterType="EmisSettleSubBill" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into emis_settle_sub_bill
|
||||
|
||||
Loading…
Reference in New Issue
Block a user