Commit 6d4d3df6 by liuyang

Merge branch 'dev' of http://git.pseer.com:8800/platform/hg-smart into dev-ly

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