Commit 05d658c5 by 宋祥

1.汉光反馈问题修复:售后服务、日常巡检单日期正序排;其他入库提交无效问题;调拨单确认失败;库存盘点提交失败

parent 647dec31
......@@ -98,7 +98,7 @@
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
ID DESC
AFTER_SALE_DATE ASC
</isEmpty>
</dynamic>
</sql>
......
......@@ -25,7 +25,6 @@ import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.DateUtils;
import com.baosight.hggp.util.EiInfoUtils;
import com.baosight.hggp.util.ErrorCodeUtils;
import com.baosight.hggp.util.ExcelUtils;
import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.ObjectUtils;
......@@ -307,11 +306,7 @@ public class ServiceHGKC005 extends ServiceEPBase {
inInfo.setMsgByKey("ep.1000", new String[]{String.valueOf(i), I18nMessages.getText("label.update", "提交")});
} catch (PlatException e) {
e.printStackTrace();
inInfo.setStatus(EiConstant.STATUS_FAILURE);
ErrorCodeUtils.handleUpdateException(inInfo,i,e);
logError("修改失败", e.getMessage());
return inInfo;
LogUtils.setMsg(inInfo, e, "提交失败");
}
return inInfo;
}
......
......@@ -8,17 +8,21 @@ import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.core.tools.Iplat4jTools;
import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.cw.tools.HGCWTools;
import com.baosight.hggp.hg.kc.domain.*;
import com.baosight.hggp.hg.kc.domain.HGKC006;
import com.baosight.hggp.hg.kc.domain.HGKC006A;
import com.baosight.hggp.hg.kc.tools.HGKCTools;
import com.baosight.hggp.hg.kc.utils.HGKCUtils;
import com.baosight.hggp.hg.xs.domain.Company;
import com.baosight.hggp.hg.xs.tools.HGXSTools;
import com.baosight.hggp.hg.xs.utils.HGXSUtils;
import com.baosight.hggp.hg.yx.domain.HGYX001;
import com.baosight.hggp.util.*;
import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.DateUtils;
import com.baosight.hggp.util.EiInfoUtils;
import com.baosight.hggp.util.ExcelUtils;
import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.contants.ACConstants;
import com.baosight.iplat4j.core.ei.EiBlock;
import com.baosight.iplat4j.core.ei.EiConstant;
......@@ -26,9 +30,13 @@ import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.service.impl.ServiceBase;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import org.springframework.util.CollectionUtils;
import java.util.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
/**
* 其他入库单
......@@ -177,28 +185,22 @@ public class ServiceHGKC006 extends ServiceBase {
hgkc006 = HGKCTools.HgKc006.getById(hgkc006.getId());
//查看是否能获取到账期,获取不到就提示
HGCWTools.HgCw001.getAccountPeriod(hgkc006.getCompanyCode(),hgkc006.getOtherEnterDate());
HGCWTools.HgCw001.getAccountPeriod(hgkc006.getCompanyCode(), hgkc006.getOtherEnterDate());
hgkc006.setSubmitStatus(HGConstant.SubmitStatus.S1);
DaoUtils.update(HGKC006.CHECK, hgkc006.toMap());
}
List<HGKC006A> hgkc006AList = HGKCTools.HgKc006A.getHgkc006aList(hgkc006.getId());
AssertUtils.isEmpty(hgkc006AList, "没有明细信息无法提交");
if(!CollectionUtils.isEmpty(hgkc006AList)){
for(HGKC006A hgkc006A : hgkc006AList){
//增加库存
HGKCUtils.HgKc010.updateInv(hgkc006A.getCompanyCode(),hgkc006A.getWhCode(),
hgkc006A.getInventCode(),hgkc006A.getInvQty(),
hgkc006A.getInvUnitWeight(),hgkc006A.getInvWeight());
}
for (HGKC006A hgkc006A : hgkc006AList) {
//增加库存
HGKCUtils.HgKc010.updateInv(hgkc006A.getCompanyCode(), hgkc006A.getWhCode(),
hgkc006A.getInventCode(), hgkc006A.getInvQty(),
hgkc006A.getInvUnitWeight(), hgkc006A.getInvWeight());
}
eiInfo.setStatus(EiConstant.STATUS_SUCCESS);
eiInfo.setMsg("提交成功!");
} catch (PlatException e) {
//eiInfo.setStatus(EiConstant.STATUS_FAILURE);
//eiInfo.setMsg("提交失败,原因参见详细错误描述!");
//eiInfo.setDetailMsg(e.getMessage());
LogUtils.setDetailMsg(eiInfo, e, "提交失败");
//logError("提交失败!", e.getMessage());
return eiInfo;
}
return eiInfo;
}
......
......@@ -268,7 +268,7 @@
-->
<insert id="insert">
INSERT INTO ${hggpSchema}.HGKC013A (ID, <!-- ID -->
INSERT INTO ${hggpSchema}.HGKC013A (
ACCOUNT_CODE, <!-- 企业编码 -->
DEP_CODE, <!-- 部门编码 -->
CREATED_BY, <!-- 记录创建者 -->
......@@ -296,7 +296,7 @@
PARENT_ID, <!-- 调度单ID -->
INVENT_TYPE_DETAIL
)
VALUES (#id#, #accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#,
VALUES (#accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#,
#updatedTime#, #deleteFlag#, #calloutWhCode#, #calloutWhName#, #callinWhCode#, #callinWhName#, #inventRecordId#,
#inventType#, #inventCode#, #inventName#, #spec#, #length#, #width#, #thick#, #quantity#, #unitWeight#,
#weight#, #parentId#,#inventTypeDetail#)
......
......@@ -818,21 +818,26 @@ public class HGKCTools {
public static void generateHgkc006(HGKC006 hgkc006) {
checkData(hgkc006);
DaoUtils.insert(HGKC006.INSERT, hgkc006);
checkDetailData(hgkc006);
DaoUtils.insertBatch(HGKC006A.INSERT, hgkc006.getDetailList());
}
private static void checkData(HGKC006 hgkc006) {
AssertUtils.isEmpty(hgkc006.getDetailList(), "其它入库单明细不能为空");
AssertUtils.isTrue(Objects.isNull(hgkc006.getId()) || hgkc006.getId() <= 0, "其它入库单ID不能为空!");
AssertUtils.isTrue(Objects.isNull(hgkc006.getSource()) || hgkc006.getSource() <= 0, "其它入库单数据来源不能为空!");
AssertUtils.isTrue(StringUtils.isBlank(hgkc006.getWhCode()), "其它入库单仓库不能为空!");
}
private static void checkDetailData(HGKC006 hgkc006) {
AssertUtils.isTrue(Objects.isNull(hgkc006.getId()) || hgkc006.getId() <= 0, "其它入库单ID不能为空!");
hgkc006.getDetailList().forEach(o -> {
o.setPrimaryId(hgkc006.getId());
AssertUtils.isTrue(StringUtils.isBlank(o.getWhCode()), "其它入库单明细仓库不能为空!");
AssertUtils.isTrue(StringUtils.isBlank(o.getInventCode()), "其它入库单明细存货编码不能为空!");
AssertUtils.isTrue(StringUtils.isBlank(o.getInventName()), "其它入库单明细存货名称不能为空!");
AssertUtils.isTrue(o.getInvQty().compareTo(BigDecimal.ZERO) <= 0, "其它入库单明细数量不能小于等于0!");
AssertUtils.isTrue(o.getInvUnitWeight().compareTo(BigDecimal.ZERO) <= 0, "其它入库单明细单重小于等于0!");
AssertUtils.isTrue(o.getInvWeight().compareTo(BigDecimal.ZERO) <= 0, "其它入库单明细总重小于等于0!");
// AssertUtils.isTrue(o.getInvUnitWeight().compareTo(BigDecimal.ZERO) <= 0, "其它入库单明细单重小于等于0!");
// AssertUtils.isTrue(o.getInvWeight().compareTo(BigDecimal.ZERO) <= 0, "其它入库单明细总重小于等于0!");
});
}
}
......
......@@ -192,7 +192,7 @@
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
id desc
check_date asc
</isEmpty>
</dynamic>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment