Commit 3224bd3f by liuyang

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

parents e2dba8ba f7b2be3a
......@@ -51,7 +51,7 @@ public class ServiceHGCG002A extends ServiceBase {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.SPEC_NAME_BLOCK_ID));
EiInfoUtils.addBlock(inInfo,"userByCompany", UserSessionUtils.getUserByCompany(UserSessionUtils.getAccountCode()), User.class);
EiInfoUtils.addBlock(inInfo,"roleCompany", UserSessionUtils.getRoleCompany(), Company.class);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGCG001().eiMetadata);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGCG001A().eiMetadata);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
......@@ -72,7 +72,7 @@ public class ServiceHGCG002A extends ServiceBase {
HGCGUtils.HgCg001.setCondition(queryRow);
// 仅审核通过
queryRow.put(HGCG001.FIELD_STATUS, HGConstant.CgPlanStatus.S_2);
inInfo = super.query(inInfo, HGCG001.QUERY, new HGCG001());
inInfo = super.query(inInfo, HGCG001A.QUERY, new HGCG001A());
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
......@@ -131,9 +131,8 @@ public class ServiceHGCG002A extends ServiceBase {
for (Map resultRow : resultRows) {
String planNo = MapUtils.getString(resultRow, HGCG001.FIELD_PLAN_NO);
HGCG001 dbCg001 = dbCg001Map.get(planNo);
HGCG002 newCg002 = BeanUtils.copy(dbCg001, HGCG002.class);
Long maxId = (Long) super.dao.get(HGCG002.MAX_ID,null,null);
newCg002.setId(maxId+1);
HGCG002 newCg002 = new HGCG002();
BeanUtils.copyProperties(dbCg001, newCg002,"id","createdBy","createdName","createdTime","updatedBy","updatedName","updatedTime");
newCg002.setContractDate(DateUtils.shortDate());
newCg002.setContractNo(SequenceGenerator.getNextSequence(HGConstant.SequenceId.CG_CONTRACT_NO));
newCg002.setSupCode(MapUtils.getString(resultRow, HGCG002.FIELD_SUP_CODE));
......
......@@ -129,8 +129,6 @@ public class ServiceHGCG003A extends ServiceBase {
private void confirmData(List<HGCG002B> fCg002Bs, Map<Long, HGCG002B> dbCg002BMap, HGCG002 cg002) {
HGCG002B hgcg002B = fCg002Bs.get(0);
HGCG003 newCg003 = BeanUtils.copy(hgcg002B, HGCG003.class);
Long maxId = (Long) super.dao.get(HGCG003.MAX_ID,null,null);
newCg003.setId(maxId+1);
newCg003.setReceiveDate(DateUtils.shortDate());
newCg003.setReceiveNo(SequenceGenerator.getNextSequence(HGConstant.SequenceId.CG_RECEIVE_NO));
BigDecimal bcReceiveQtySum = fCg002Bs.stream().map(HGCG002B::getBcReceiveQty).reduce(BigDecimal.ZERO,BigDecimal::add);
......
......@@ -178,6 +178,9 @@
#specId#, #spec#, #material#, #unit#, #length#, #width#, #thick#,
#planQty#, #planUnitWeight#, #planWeight#, #status#, #inventTypeDetail#, #materialPlanId#, #source#
)
<selectKey resultClass="long" keyProperty="id">
SELECT MAX(ID) AS "id" FROM ${hggpSchema}.HGCG001
</selectKey>
</insert>
<delete id="delete">
......
......@@ -111,6 +111,112 @@
</isNotEmpty>
</sql>
<sql id="conditionByContract">
AND a.DELETE_FLAG = 0
<isNotEmpty prepend=" AND " property="id">
a.ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="accountCode">
a.ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
a.DEP_CODE = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
a.CREATED_BY = #createdBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdName">
a.CREATED_NAME = #createdName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
a.CREATED_TIME = #createdTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy">
a.UPDATED_BY = #updatedBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedName">
a.UPDATED_NAME = #updatedName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime">
a.UPDATED_TIME = #updatedTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deleteFlag">
a.DELETE_FLAG = #deleteFlag#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
a.COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyName">
a.COMPANY_NAME = #companyName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="planDate">
a.PLAN_DATE = #planDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="planNo">
a.PLAN_NO = #planNo#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventType">
a.INVENT_TYPE = #inventType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventCode">
a.INVENT_CODE = #inventCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventName">
a.INVENT_NAME = #inventName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="spec">
a.SPEC = #spec#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="material">
a.MATERIAL = #material#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="unit">
a.UNIT = #unit#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="length">
a.LENGTH = #length#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="width">
a.WIDTH = #width#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="thick">
a.THICK = #thick#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="planQty">
a.PLAN_QTY = #planQty#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="planUnitWeight">
a.PLAN_UNIT_WEIGHT = #planUnitWeight#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="planWeight">
a.PLAN_WEIGHT = #planWeight#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="purQty">
a.PUR_QTY = #purQty#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="purUnitWeight">
a.PUR_UNIT_WEIGHT = #purUnitWeight#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="purWeight">
a.PUR_WEIGHT = #purWeight#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="materialPlanId">
a.MATERIAL_PLAN_ID = #materialPlanId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventTypeDetail">
a.INVENT_TYPE_DETAIL = #inventTypeDetail#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="primaryId">
a.PRIMARY_ID = #primaryId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="id">
a.ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="ids">
a.ID IN <iterate open="(" close=")" conjunction="," property="ids">#ids[]#</iterate>
</isNotEmpty>
</sql>
<select id="query" parameterClass="java.util.HashMap"
resultClass="com.baosight.hggp.hg.cg.domain.HGCG001A">
SELECT
......@@ -148,13 +254,12 @@
PRIMARY_ID as "primaryId" <!-- 主表id -->
FROM ${hggpSchema}.HGCG001A WHERE 1=1
<include refid="condition" />
<include refid="idCondition"/>
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
ID asc
ID desc
</isEmpty>
</dynamic>
......@@ -165,6 +270,54 @@
<include refid="condition" />
</select>
<select id="queryByContract" parameterClass="java.util.HashMap"
resultClass="com.baosight.hggp.hg.cg.domain.HGCG001A">
SELECT
a.ID as "id",
a.ACCOUNT_CODE as "accountCode", <!-- 企业编码 -->
a.DEP_CODE as "depCode", <!-- 部门编码 -->
a.CREATED_BY as "createdBy", <!-- 记录创建者 -->
a.CREATED_NAME as "createdName", <!-- 记录创建名称 -->
a.CREATED_TIME as "createdTime", <!-- 记录创建时间 -->
a.UPDATED_BY as "updatedBy", <!-- 记录修改者 -->
a.UPDATED_NAME as "updatedName", <!-- 记录修改名称 -->
a.UPDATED_TIME as "updatedTime", <!-- 记录修改时间 -->
a.DELETE_FLAG as "deleteFlag", <!-- 0-未删除,1-已删除 -->
a.COMPANY_CODE as "companyCode", <!-- 公司编码 -->
a.COMPANY_NAME as "companyName", <!-- 公司名称 -->
a.PLAN_DATE as "planDate", <!-- 计划日期 -->
a.PLAN_NO as "planNo", <!-- 计划单号 -->
a.INVENT_TYPE as "inventType", <!-- 存货类型 -->
a.INVENT_CODE as "inventCode", <!-- 存货编码 -->
a.INVENT_NAME as "inventName", <!-- 存货名称 -->
a.SPEC as "spec", <!-- 规格 -->
a.MATERIAL as "material", <!-- 材质 -->
a.UNIT as "unit", <!-- 单位 -->
a.LENGTH as "length", <!-- 长度 -->
a.WIDTH as "width", <!-- 宽度 -->
a.THICK as "thick", <!-- 厚度 -->
a.PLAN_QTY as "planQty", <!-- 计划数量 -->
a.PLAN_UNIT_WEIGHT as "planUnitWeight", <!-- 计划单重 -->
a.PLAN_WEIGHT as "planWeight", <!-- 计划重量 -->
a.PUR_QTY as "purQty", <!-- 采购数量 -->
a.PUR_UNIT_WEIGHT as "purUnitWeight", <!-- 采购单重 -->
a.PUR_WEIGHT as "purWeight", <!-- 采购重量 -->
a.MATERIAL_PLAN_ID as "materialPlanId", <!-- 材料计划id -->
a.INVENT_TYPE_DETAIL as "inventTypeDetail", <!-- 存货类型大类 -->
a.PRIMARY_ID as "primaryId" <!-- 主表id -->
FROM ${hggpSchema}.HGCG001A a WHERE 1=1
<include refid="conditionByContract" />
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
ID desc
</isEmpty>
</dynamic>
</select>
<insert id="insert">
INSERT INTO ${hggpSchema}.HGCG001A (ID,
ACCOUNT_CODE, <!-- 企业编码 -->
......
......@@ -220,6 +220,9 @@
#purQty#, #purUnitWeight#, #purWeight#, #status#,
#price#, #amount#, #taxIncludeAmount#, #taxAmount#, #taxRate#, #inventTypeDetail#, #source#
)
<selectKey resultClass="long" keyProperty="id">
SELECT MAX(ID) AS "id" FROM ${hggpSchema}.HGCG002
</selectKey>
</insert>
<delete id="delete">
......
......@@ -219,6 +219,9 @@
#unit#, #length#, #width#, #thick#, #receiveQty#, #receiveUnitWeight#,
#receiveWeight#,#price#, #amount#, #status#,#inventTypeDetail#,#isInvoicing#, #source#
)
<selectKey resultClass="long" keyProperty="id">
SELECT MAX(ID) AS "id" FROM ${hggpSchema}.HGCG003
</selectKey>
</insert>
<delete id="delete">
......
......@@ -162,6 +162,7 @@ public class ServiceHGKC005 extends ServiceEPBase {
for (int i = 0; i < resultRows.size(); i++) {
HGKC005 fKc005 = new HGKC005();
fKc005.fromMap(resultRows.get(i));
AssertUtils.isTrue(fKc005.getSubmitStatus().compareTo(HGConstant.ProductStatus.YTJ) == 0 , "已提交数据不嫩修改");
AssertUtils.isEmpty(fKc005.getInventCode(), "存货类型不能为空");
AssertUtils.isEmpty(fKc005.getWhCode(), "仓库名称不能为空");
AssertUtils.isEmpty(fKc005.getInventCode(), "存货名称不能为空");
......@@ -309,8 +310,6 @@ public class ServiceHGKC005 extends ServiceEPBase {
//如果差异数量小于0则为盘亏,生成出库单
if(hgkc005.getDiffAmount().compareTo(BigDecimal.ZERO) < 0){
HGKC007 hgkc007 = new HGKC007();
Long maxId = (Long) super.dao.get(HGKC007.MAX_ID,null,null);
hgkc007.setId(maxId+1);
hgkc007.setOtherOutNo(SequenceGenerator.getNextSequence(HGConstant.SequenceId.OTHER_OUT_NO));
hgkc007.setCompanyCode(userVO.getUsercode());
hgkc007.setCompanyName(userVO.getUsername());
......@@ -350,8 +349,6 @@ public class ServiceHGKC005 extends ServiceEPBase {
//如果差异数量大于0则为盘盈,生成入库单
if(hgkc005.getDiffAmount().compareTo(BigDecimal.ZERO) > 0){
HGKC006 hgkc006 = new HGKC006();
Long maxId = (Long) super.dao.get(HGKC006.MAX_ID,null,null);
hgkc006.setId(maxId+1);
hgkc006.setOtherEnterNo(SequenceGenerator.getNextSequence(HGConstant.SequenceId.OTHER_ENTER_NO));
hgkc006.setCompanyCode(userVO.getUsercode());
hgkc006.setCompanyName(userVO.getUsername());
......
......@@ -168,6 +168,9 @@
SOURCE <!-- 数据来源 -->
)
VALUES (#id#, #accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #deleteFlag#, #companyCode#, #companyName#, #otherEnterDate#, #otherEnterNo#, #whCode#, #whName#, #otherEnterNoOld#, #remark#, #factoryCode#, #prodOrderNo#, #prodTaskNo#, #projCode#, #projName#, #submitStatus#, #sourceCode#, #source#)
<selectKey resultClass="long" keyProperty="id">
SELECT MAX(ID) AS "id" FROM ${hggpSchema}.HGKC006
</selectKey>
</insert>
......
......@@ -161,6 +161,9 @@
SOURCE <!-- 数据来源 -->
)
VALUES (#id#, #accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #deleteFlag#, #companyCode#, #companyName#, #otherOutDate#, #otherOutNo#, #whCode#, #whName#, #otherOutNoOld#, #remark#, #factoryCode#, #prodOrderNo#, #prodTaskNo#, #projCode#, #projName#, #submitStatus#, #sourceCode#, #source#)
<selectKey resultClass="long" keyProperty="id">
SELECT MAX(ID) AS "id" FROM ${hggpSchema}.HGKC007
</selectKey>
</insert>
<delete id="delete">
......
......@@ -110,11 +110,8 @@ public class ServiceHGSC004 extends ServiceBase {
});
DaoUtils.updateBatch(HGSC004A.UPDATE, hgsc004AList);
}else {
Long maxId = (Long) super.dao.get(HGSC004.MAX_ID,null,null);
hgsc004.setId(maxId+1);
hgsc004.setMaterialStatus(HGConstant.MaterialStatus.WTJ);
DaoUtils.insert(HGSC004.INSERT, hgsc004);
this.insertTree(hgsc004);
}
......
......@@ -218,11 +218,11 @@ public class ServiceHGSC004A extends ServiceBase {
//主表全部提交时需要有改变状态
if(hgsc004.getMaterialStatus().intValue() == HGConstant.MaterialStatus.QBTJ){
hgsc004a.setChangeType(HGConstant.ChangeType.ZJ);
Long maxId = (Long) super.dao.get(HGSC004A.MAX_ID,null,null);
hgsc004a.setId(maxId+1);
DaoUtils.insert(HGSC004A.INSERT, hgsc004a);
HGSCTools.THGSC004B.save(null,hgsc004a);
}
}else{
DaoUtils.insert(HGSC004A.INSERT, hgsc004a);
}
}
......
......@@ -238,9 +238,7 @@ public class ServiceHGSC009A extends ServiceBase {
if(Objects.nonNull(sc009)){
HGCG001 hgcg001 = new HGCG001();
BeanUtils.copyProperties(sc009,hgcg001,"id","createdBy","createdName","createdTime","updatedBy","updatedName","updatedTime");
Long maxId = (Long) super.dao.get(HGCG001.MAX_ID,null,null);
hgcg001.setMaterialPlanId(sc009.getId());
hgcg001.setId(maxId+1);
hgcg001.setStatus(HGConstant.CgPlanStatus.S_0);
hgcg001.setPlanNo(SequenceGenerator.getNextSequence(HGConstant.SequenceId.CG_PLAN_NO));
hgcg001.setPlanDate(DateUtils.formatShort(DateUtils.date()));
......
......@@ -171,6 +171,9 @@
updated_time <!-- 更新时间 -->
)
VALUES (#id#, #blueprintId#, #companyCode#, #companyName#, #depCode#, #depName#, #blueprintCode#, #blueprintName#, #projCode#, #projName#, #materialStatus#, #delStatus#, #approvalStatus#, #accountCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#)
<selectKey resultClass="long" keyProperty="id">
SELECT MAX(ID) AS "id" FROM ${hggpSchema}.HGSC004
</selectKey>
</insert>
<delete id="delete">
......
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