Commit c1c9904b by liuyang

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

parents 3beb5ae2 ee2940b9
...@@ -7,9 +7,16 @@ import java.util.HashMap; ...@@ -7,9 +7,16 @@ import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
/**
* 产品类型枚举
*
* @author:songx
* @date:2024/9/10,8:43
*/
public enum ProductTypeEnum { public enum ProductTypeEnum {
STRUCT(1,"构建"),
PART(2,"零件"); STRUCT(1, "构件"),
PART(2, "零件");
private Integer code; private Integer code;
...@@ -36,9 +43,9 @@ public enum ProductTypeEnum { ...@@ -36,9 +43,9 @@ public enum ProductTypeEnum {
return block; return block;
} }
public static ProductTypeEnum getEnumByCode(Integer code){ public static ProductTypeEnum getEnumByCode(Integer code) {
for (ProductTypeEnum en : ProductTypeEnum.values()){ for (ProductTypeEnum en : ProductTypeEnum.values()) {
if(code.compareTo(en.code)==0){ if (code.compareTo(en.code) == 0) {
return en; return en;
} }
} }
......
...@@ -57,6 +57,20 @@ public class CommonConstant { ...@@ -57,6 +57,20 @@ public class CommonConstant {
} }
/** /**
* 排序类型
*
* @author:songx
* @date:2024/1/20,15:04
*/
public static class SortType {
// 正序
public static final String ASC = "asc";
// 倒序
public static final String DESC = "desc";
}
/**
* 设备计划状态 * 设备计划状态
* *
* @author:songx * @author:songx
......
...@@ -63,7 +63,7 @@ public class ServiceHGKC008A extends ServiceBase { ...@@ -63,7 +63,7 @@ public class ServiceHGKC008A extends ServiceBase {
String receiveId = inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGKC008A.FIELD_RECEIVE_ID); String receiveId = inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGKC008A.FIELD_RECEIVE_ID);
//查看明细是否都删除了,都删除了得修改主表信息 //查看明细是否都删除了,都删除了得修改主表信息
HGKCTools.HgKc008A.checkMainData(ids,Long.valueOf(receiveId)); HGKCTools.HgKc008A.checkMainData(ids, Long.valueOf(receiveId));
inInfo = this.query(inInfo); inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT); inInfo.setStatus(EiConstant.STATUS_DEFAULT);
...@@ -74,19 +74,21 @@ public class ServiceHGKC008A extends ServiceBase { ...@@ -74,19 +74,21 @@ public class ServiceHGKC008A extends ServiceBase {
return inInfo; return inInfo;
} }
public EiInfo save(EiInfo inInfo){ /**
* @param inInfo
* @return
*/
public EiInfo save(EiInfo inInfo) {
try { try {
Map resultMap = EiInfoUtils.getFirstRow(inInfo,EiConstant.resultBlock); HGKC008A fKc008a = MapUtils.toDaoEPBase(inInfo, HGKC008A.class);
HGKC008A hgkc008a = new HGKC008A();
hgkc008a.fromMap(resultMap);
//查询领料单 //查询领料单
HGKC008 hgkc008 = HGKCTools.HgKc008.getById(hgkc008a.getReceiveId()); HGKC008 dbKc008 = HGKCTools.HgKc008.getById(fKc008a.getReceiveId());
this.checkSaveData(hgkc008a,hgkc008); this.checkSaveData(fKc008a, dbKc008);
this.setData(hgkc008a,hgkc008); this.setData(fKc008a, dbKc008);
if(Objects.nonNull(hgkc008a.getId())&&hgkc008a.getId()!=0){ if (Objects.nonNull(fKc008a.getId()) && fKc008a.getId() != 0) {
DaoUtils.update(HGKC008A.UPDATE, hgkc008a); DaoUtils.update(HGKC008A.UPDATE, fKc008a);
}else { } else {
DaoUtils.insert(HGKC008A.INSERT, hgkc008a); DaoUtils.insert(HGKC008A.INSERT, fKc008a);
} }
inInfo.setStatus(EiConstant.STATUS_DEFAULT); inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("保存成功!"); inInfo.setMsg("保存成功!");
...@@ -98,22 +100,23 @@ public class ServiceHGKC008A extends ServiceBase { ...@@ -98,22 +100,23 @@ public class ServiceHGKC008A extends ServiceBase {
/** /**
* 给明细赋值 * 给明细赋值
*
* @param hgkc008a * @param hgkc008a
* @param hgkc008 * @param hgkc008
*/ */
private void setData(HGKC008A hgkc008a, HGKC008 hgkc008) { private void setData(HGKC008A hgkc008a, HGKC008 hgkc008) {
if(Objects.nonNull(hgkc008)){ if (Objects.nonNull(hgkc008)) {
hgkc008a.setProjCode(hgkc008.getProjCode()); hgkc008a.setProjCode(hgkc008.getProjCode());
hgkc008a.setProjName(hgkc008.getProjName()); hgkc008a.setProjName(hgkc008.getProjName());
hgkc008a.setWhCode(hgkc008.getWhCode()); hgkc008a.setWhCode(hgkc008.getWhCode());
hgkc008a.setWhName(hgkc008.getWhName()); hgkc008a.setWhName(hgkc008.getWhName());
hgkc008a.setCompanyCode(hgkc008.getCompanyCode()); hgkc008a.setCompanyCode(hgkc008.getCompanyCode());
hgkc008a.setCompanyName(hgkc008.getCompanyName()); hgkc008a.setCompanyName(hgkc008.getCompanyName());
if(hgkc008.getReceiveType().compareTo(HGConstant.ReceiveType.DEFAULT) == 0){ if (hgkc008.getReceiveType().compareTo(HGConstant.ReceiveType.DEFAULT) == 0) {
//如果明细里面有负数的,主表就是退库 //如果明细里面有负数的,主表就是退库
if(hgkc008a.getInvQty().compareTo(BigDecimal.ZERO) < 0){ if (hgkc008a.getInvQty().compareTo(BigDecimal.ZERO) < 0) {
hgkc008.setReceiveType(HGConstant.ReceiveType.TK); hgkc008.setReceiveType(HGConstant.ReceiveType.TK);
}else{ } else {
hgkc008.setReceiveType(HGConstant.ReceiveType.ZC); hgkc008.setReceiveType(HGConstant.ReceiveType.ZC);
} }
DaoUtils.update(HGKC008.UPDATE_RECEIVE_TYPE, hgkc008); DaoUtils.update(HGKC008.UPDATE_RECEIVE_TYPE, hgkc008);
...@@ -124,23 +127,22 @@ public class ServiceHGKC008A extends ServiceBase { ...@@ -124,23 +127,22 @@ public class ServiceHGKC008A extends ServiceBase {
/** /**
* 校验保存的数据 * 校验保存的数据
* *
* @param hgkc008a * @param fKc008a
* @param hgkc008 * @param dbKc008
*/ */
private void checkSaveData(HGKC008A hgkc008a, HGKC008 hgkc008) { private void checkSaveData(HGKC008A fKc008a, HGKC008 dbKc008) {
AssertUtils.isEmpty(UserSessionUtils.getAccountCode(), "当前用户未绑定公司,无法操作数据,请联系管理员!"); AssertUtils.isEmpty(UserSessionUtils.getAccountCode(), "当前用户未绑定公司,无法操作数据,请联系管理员!");
AssertUtils.isEmpty(UserSessionUtils.getOrgId(), "当前用户未绑定部门,无法操作数据,请联系管理员!"); AssertUtils.isEmpty(UserSessionUtils.getOrgId(), "当前用户未绑定部门,无法操作数据,请联系管理员!");
AssertUtils.isNull(hgkc008a.getReceiveId(), "未获取到生产领料单ID信息"); AssertUtils.isNull(fKc008a.getReceiveId(), "未获取到生产领料单ID信息");
AssertUtils.isTrue(hgkc008a.getInvWeight().compareTo(BigDecimal.ZERO) == 0, "重量不能为0"); AssertUtils.isTrue(fKc008a.getInvWeight().compareTo(BigDecimal.ZERO) == 0, "重量不能为0");
if(Objects.nonNull(hgkc008a.getId())&&hgkc008a.getId()!=0){ if (Objects.nonNull(fKc008a.getId()) && fKc008a.getId() != 0) {
if(hgkc008.getReceiveType().compareTo(HGConstant.ReceiveType.ZC) == 0){ if (dbKc008.getReceiveType().compareTo(HGConstant.ReceiveType.ZC) == 0) {
AssertUtils.isTrue(hgkc008a.getInvQty().compareTo(BigDecimal.ZERO) < 0, "此生产领料单为正常类型,数量不能小于0"); AssertUtils.isTrue(fKc008a.getInvQty().compareTo(BigDecimal.ZERO) < 0, "此生产领料单为正常类型,数量不能小于0");
} }
if(hgkc008.getReceiveType().compareTo(HGConstant.ReceiveType.TK) == 0){ if (dbKc008.getReceiveType().compareTo(HGConstant.ReceiveType.TK) == 0) {
AssertUtils.isTrue(hgkc008a.getInvQty().compareTo(BigDecimal.ZERO) > 0, "此生产领料单为退库类型,数量不能大于0"); AssertUtils.isTrue(fKc008a.getInvQty().compareTo(BigDecimal.ZERO) > 0, "此生产领料单为退库类型,数量不能大于0");
} }
} }
} }
} }
......
...@@ -25,6 +25,28 @@ public class HgScSqlConstant { ...@@ -25,6 +25,28 @@ public class HgScSqlConstant {
/** /**
* *
* @author:songx * @author:songx
* @date:2024/9/10,10:17
*/
public static class HgSc005 {
// 修改排产状态
public static final String UPDATE_IS_SCHEDULE = "HGSC005.updateIsSchedule";
}
/**
*
* @author:songx
* @date:2024/9/10,9:59
*/
public static class HgSc005A {
// 修改计划时间
public static final String UPDATE_PLAN_DATE = "HGSC005A.updatePlanDate";
}
/**
*
* @author:songx
* @date:2024/9/8,9:41 * @date:2024/9/8,9:41
*/ */
public static class HgSc007 { public static class HgSc007 {
......
...@@ -4,6 +4,7 @@ import com.baosight.hggp.aspect.annotation.OperationLogAnnotation; ...@@ -4,6 +4,7 @@ import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.DdynamicEnum; import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.constant.CommonConstant; import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoUtils; import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.hg.sc.constant.HgScSqlConstant;
import com.baosight.hggp.hg.sc.domain.HGSC005; import com.baosight.hggp.hg.sc.domain.HGSC005;
import com.baosight.hggp.hg.sc.domain.HGSC005A; import com.baosight.hggp.hg.sc.domain.HGSC005A;
import com.baosight.hggp.hg.sc.tools.HGSCTools; import com.baosight.hggp.hg.sc.tools.HGSCTools;
...@@ -125,15 +126,16 @@ public class ServiceHGSC005A extends ServiceBase { ...@@ -125,15 +126,16 @@ public class ServiceHGSC005A extends ServiceBase {
* @return * @return
*/ */
@OperationLogAnnotation(operModul = "生产计划详情", operType = "排产", operDesc = "排产") @OperationLogAnnotation(operModul = "生产计划详情", operType = "排产", operDesc = "排产")
public EiInfo scheduleEx(EiInfo inInfo) { public EiInfo scheduleAsc(EiInfo inInfo) {
try { try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo); Map queryMap = EiInfoUtils.getFirstRow(inInfo);
String planCode = MapUtils.getString(queryMap, "planCode"); String planCode = MapUtils.getString(queryMap, "planCode");
HGSC005 dbSc005 = HGSCTools.THGSC005.queryByPlanCode(planCode); HGSC005 dbSc005 = HGSCTools.THGSC005.queryByPlanCode(planCode);
this.checkScheduleData(dbSc005); this.checkScheduleData(dbSc005);
int count = HGSCTools.THGSC005A.schedule(queryMap, "A"); // 排产计算
int count = HGSCTools.THGSC005A.schedule(dbSc005, queryMap, CommonConstant.SortType.ASC);
dbSc005.setIsSchedule(CommonConstant.YesNo.YES_1); dbSc005.setIsSchedule(CommonConstant.YesNo.YES_1);
DaoUtils.update(HGSC005.UPDATE, dbSc005); DaoUtils.update(HgScSqlConstant.HgSc005.UPDATE_IS_SCHEDULE, dbSc005);
inInfo = this.query(inInfo); inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT); inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + count + "]条数据排产成功!"); inInfo.setMsg("操作成功!本次对[" + count + "]条数据排产成功!");
...@@ -156,9 +158,9 @@ public class ServiceHGSC005A extends ServiceBase { ...@@ -156,9 +158,9 @@ public class ServiceHGSC005A extends ServiceBase {
String planCode = MapUtils.getString(queryMap, "planCode"); String planCode = MapUtils.getString(queryMap, "planCode");
HGSC005 dbSc005 = HGSCTools.THGSC005.queryByPlanCode(planCode); HGSC005 dbSc005 = HGSCTools.THGSC005.queryByPlanCode(planCode);
this.checkScheduleData(dbSc005); this.checkScheduleData(dbSc005);
int count = HGSCTools.THGSC005A.schedule(queryMap, "D"); int count = HGSCTools.THGSC005A.schedule(dbSc005, queryMap, CommonConstant.SortType.DESC);
dbSc005.setIsSchedule(CommonConstant.YesNo.YES_1); dbSc005.setIsSchedule(CommonConstant.YesNo.YES_1);
DaoUtils.update(HGSC005.UPDATE, dbSc005); DaoUtils.update(HgScSqlConstant.HgSc005.UPDATE_IS_SCHEDULE, dbSc005);
inInfo = this.query(inInfo); inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT); inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + count + "]条数据排产成功!"); inInfo.setMsg("操作成功!本次对[" + count + "]条数据排产成功!");
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN" "http://ibatis.apache.org/dtd/sql-map-2.dtd"> <!-- table information <!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://www.ibatis.com/dtd/sql-map-2.dtd">
Generate time : 2024-05-16 16:50:12
Version : 1.0
schema : hggp
tableName : HGSC005
id BIGINT NOT NULL primarykey,
mat_id BIGINT NOT NULL,
company_code VARCHAR NOT NULL,
company_name VARCHAR NOT NULL,
proj_code VARCHAR,
proj_name VARCHAR,
plan_code VARCHAR,
commit_status TINYINT,
finish_date VARCHAR,
account_code VARCHAR NOT NULL,
dep_code VARCHAR,
dep_name VARCHAR,
created_by VARCHAR,
created_name VARCHAR,
created_time VARCHAR,
updated_by VARCHAR,
updated_name VARCHAR,
updated_time VARCHAR
-->
<sqlMap namespace="HGSC005"> <sqlMap namespace="HGSC005">
<sql id="column">
id as "id",
mat_id as "matId", <!-- 物料清单ID -->
company_code as "companyCode", <!-- 公司编码 -->
company_name as "companyName", <!-- 公司名称 -->
proj_code as "projCode", <!-- 项目编码 -->
proj_name as "projName", <!-- 项目名称 -->
plan_code as "planCode", <!-- 计划编码 -->
commit_status as "commitStatus", <!-- 提交状态 0:未提交;2:已提交 -->
is_schedule as "isSchedule", <!-- 是否排产 0:否;1:是 -->
finish_date as "finishDate", <!-- 完工日期 -->
account_code as "accountCode", <!-- 帐套 -->
dep_code as "depCode", <!-- 部门编码 -->
dep_name as "depName", <!-- 部门名称 -->
created_by as "createdBy", <!-- 创建人 -->
created_name as "createdName", <!-- 创建人名称 -->
created_time as "createdTime", <!-- 创建时间 -->
updated_by as "updatedBy", <!-- 更新人 -->
updated_name as "updatedName", <!-- 修改人名称 -->
updated_time as "updatedTime" <!-- 更新时间 -->
</sql>
<sql id="condition"> <sql id="condition">
<include refid="HGXSDataAuth.authCondition"/> <include refid="HGXSDataAuth.authCondition"/>
<isNotEmpty prepend=" AND " property="id"> <isNotEmpty prepend=" AND " property="id">
id = #id# id = #id#
</isNotEmpty> </isNotEmpty>
...@@ -86,34 +84,12 @@ ...@@ -86,34 +84,12 @@
updated_time = #updatedTime# updated_time = #updatedTime#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="matIds"> <isNotEmpty prepend=" AND " property="matIds">
mat_id NOT IN <iterate close=")" open="(" conjunction="," property="matIds">#matIds[]#</iterate> mat_id NOT IN
<iterate close=")" open="(" conjunction="," property="matIds">#matIds[]#</iterate>
</isNotEmpty> </isNotEmpty>
</sql> </sql>
<select id="query" parameterClass="java.util.HashMap" <sql id="orderBy">
resultClass="com.baosight.hggp.hg.sc.domain.HGSC005">
SELECT
id as "id",
mat_id as "matId", <!-- 物料清单ID -->
company_code as "companyCode", <!-- 公司编码 -->
company_name as "companyName", <!-- 公司名称 -->
proj_code as "projCode", <!-- 项目编码 -->
proj_name as "projName", <!-- 项目名称 -->
plan_code as "planCode", <!-- 计划编码 -->
commit_status as "commitStatus", <!-- 提交状态 0:未提交;2:已提交 -->
is_schedule as "isSchedule", <!-- 是否排产 0:否;1:是 -->
finish_date as "finishDate", <!-- 完工日期 -->
account_code as "accountCode", <!-- 帐套 -->
dep_code as "depCode", <!-- 部门编码 -->
dep_name as "depName", <!-- 部门名称 -->
created_by as "createdBy", <!-- 创建人 -->
created_name as "createdName", <!-- 创建人名称 -->
created_time as "createdTime", <!-- 创建时间 -->
updated_by as "updatedBy", <!-- 更新人 -->
updated_name as "updatedName", <!-- 修改人名称 -->
updated_time as "updatedTime" <!-- 更新时间 -->
FROM ${hggpSchema}.HGSC005 WHERE 1=1
<include refid="condition" />
<dynamic prepend="ORDER BY"> <dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy"> <isNotEmpty property="orderBy">
$orderBy$ $orderBy$
...@@ -122,73 +98,23 @@ ...@@ -122,73 +98,23 @@
id desc id desc
</isEmpty> </isEmpty>
</dynamic> </dynamic>
</sql>
<select id="query" resultClass="com.baosight.hggp.hg.sc.domain.HGSC005">
SELECT
<include refid="column"/>
FROM ${hggpSchema}.HGSC005 WHERE 1=1
<include refid="condition"/>
<include refid="orderBy"/>
</select> </select>
<select id="count" resultClass="int"> <select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hggpSchema}.HGSC005 WHERE 1=1 SELECT COUNT(*) FROM ${hggpSchema}.HGSC005 WHERE 1=1
<include refid="condition" /> <include refid="condition"/>
</select> </select>
<!--
<isNotEmpty prepend=" AND " property="id">
id = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="matId">
mat_id = #matId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
company_code = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyName">
company_name = #companyName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projCode">
proj_code = #projCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projName">
proj_name = #projName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="planCode">
plan_code = #planCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="commitStatus">
commit_status = #commitStatus#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="finishDate">
finish_date = #finishDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="accountCode">
account_code = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
dep_code = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depName">
dep_name = #depName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
created_by = #createdBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdName">
created_name = #createdName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
created_time = #createdTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy">
updated_by = #updatedBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedName">
updated_name = #updatedName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime">
updated_time = #updatedTime#
</isNotEmpty>
-->
<insert id="insert"> <insert id="insert">
INSERT INTO ${hggpSchema}.HGSC005 (id, INSERT INTO ${hggpSchema}.HGSC005 (
mat_id, <!-- 物料清单ID --> mat_id, <!-- 物料清单ID -->
company_code, <!-- 公司编码 --> company_code, <!-- 公司编码 -->
company_name, <!-- 公司名称 --> company_name, <!-- 公司名称 -->
...@@ -203,22 +129,20 @@ ...@@ -203,22 +129,20 @@
dep_name, <!-- 部门名称 --> dep_name, <!-- 部门名称 -->
created_by, <!-- 创建人 --> created_by, <!-- 创建人 -->
created_name, <!-- 创建人名称 --> created_name, <!-- 创建人名称 -->
created_time, <!-- 创建时间 --> created_time <!-- 创建时间 -->
updated_by, <!-- 更新人 --> ) VALUES (
updated_name, <!-- 修改人名称 --> #matId#, #companyCode#, #companyName#, #projCode#, #projName#, #planCode#, #commitStatus#, #finishDate#,
updated_time <!-- 更新时间 --> #isSchedule#, #accountCode#, #depCode#, #depName#, #createdBy#, #createdName#, #createdTime#, #updatedBy#,
#updatedName#, #updatedTime#
) )
VALUES (#id#, #matId#, #companyCode#, #companyName#, #projCode#, #projName#, #planCode#, #commitStatus#, #finishDate#, #isSchedule#, #accountCode#, #depCode#, #depName#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#)
</insert> </insert>
<delete id="delete"> <delete id="delete">
DELETE FROM ${hggpSchema}.HGSC005 WHERE DELETE FROM ${hggpSchema}.HGSC005 WHERE ID = #id#
id = #id#
</delete> </delete>
<delete id="delete_by_mat_id"> <delete id="delete_by_mat_id">
DELETE FROM ${hggpSchema}.HGSC005 WHERE DELETE FROM ${hggpSchema}.HGSC005 WHERE MAT_ID = #matId#
mat_id = #matId#
</delete> </delete>
<update id="update"> <update id="update">
...@@ -242,11 +166,17 @@ ...@@ -242,11 +166,17 @@
updated_by = #updatedBy#, <!-- 更新人 --> updated_by = #updatedBy#, <!-- 更新人 -->
updated_name = #updatedName#, <!-- 修改人名称 --> updated_name = #updatedName#, <!-- 修改人名称 -->
updated_time = #updatedTime# <!-- 更新时间 --> updated_time = #updatedTime# <!-- 更新时间 -->
WHERE WHERE id = #id#
id = #id#
</update> </update>
<!-- 修改排产状态 -->
<update id="updateIsSchedule">
UPDATE ${hggpSchema}.HGSC005
SET
IS_SCHEDULE = #isSchedule#,
<include refid="SqlBase.updateRevise"/>
WHERE ID = #id#
</update>
<update id="batch_commit"> <update id="batch_commit">
UPDATE ${hggpSchema}.HGSC005 UPDATE ${hggpSchema}.HGSC005
......
...@@ -2,6 +2,45 @@ ...@@ -2,6 +2,45 @@
<!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://www.ibatis.com/dtd/sql-map-2.dtd"> <!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://www.ibatis.com/dtd/sql-map-2.dtd">
<sqlMap namespace="HGSC005A"> <sqlMap namespace="HGSC005A">
<sql id="column">
id as "id",
mat_id as "matId", <!-- 物料清单ID -->
mat_detail_id as "matDetailId", <!-- 物料清单明细ID -->
tech_flow_id as "techFlowId", <!-- 工艺流程ID -->
tech_flow_name as "techFlowName", <!-- 工艺流程名称 -->
invent_process_id as "inventProcessId", <!-- 存货工序ID,对应HGPZ005A.id -->
process_code as "processCode", <!-- 工序编码 -->
process_name as "processName", <!-- 工序名称 -->
company_code as "companyCode", <!-- 公司编码 -->
process_order as "processOrder", <!-- 加工顺序 -->
company_name as "companyName", <!-- 公司名称 -->
dep_code as "depCode", <!-- 部门编码 -->
dep_name as "depName", <!-- 部门名称 -->
proj_code as "projCode", <!-- 项目编码 -->
proj_name as "projName", <!-- 项目名称 -->
plan_code as "planCode", <!-- 计划编码 -->
product_type as "productType", <!-- 产品类型 -->
product_code as "productCode", <!-- 产品编号 -->
product_name as "productName", <!-- 产品名称 -->
finish_date as "finishDate", <!-- 完工日期 -->
plan_start_date as "planStartDate", <!-- 计划开始日期 -->
plan_end_date as "planEndDate", <!-- 计划结束日期 -->
quantity as "quantity", <!-- 数量 -->
finish_quantity as "finishQuantity", <!-- 完工数量 -->
unfinish_quantity as "unfinishQuantity", <!-- 未完工数量 -->
single_weight as "singleWeight", <!-- 单重 -->
total_weight as "totalWeight", <!-- 总重 -->
finish_weight as "finishWeight", <!-- 完工重量 -->
unfinish_weight as "unfinishWeight", <!-- 未完工重量 -->
account_code as "accountCode", <!-- 帐套 -->
created_by as "createdBy", <!-- 创建人 -->
created_name as "createdName", <!-- 创建人名称 -->
created_time as "createdTime", <!-- 创建时间 -->
updated_by as "updatedBy", <!-- 更新人 -->
updated_name as "updatedName", <!-- 修改人名称 -->
updated_time as "updatedTime" <!-- 更新时间 -->
</sql>
<sql id="condition"> <sql id="condition">
<!--<include refid="HGXSDataAuth.authCondition"/>--> <!--<include refid="HGXSDataAuth.authCondition"/>-->
<isNotEmpty prepend=" AND " property="id"> <isNotEmpty prepend=" AND " property="id">
...@@ -122,42 +161,7 @@ ...@@ -122,42 +161,7 @@
<select id="query" resultClass="com.baosight.hggp.hg.sc.domain.HGSC005A"> <select id="query" resultClass="com.baosight.hggp.hg.sc.domain.HGSC005A">
SELECT SELECT
id as "id", <include refid="column"/>
mat_id as "matId", <!-- 物料清单ID -->
mat_detail_id as "matDetailId", <!-- 物料清单明细ID -->
tech_flow_id as "techFlowId", <!-- 工艺流程ID -->
tech_flow_name as "techFlowName", <!-- 工艺流程名称 -->
invent_process_id as "inventProcessId", <!-- 存货工序ID,对应HGPZ005A.id -->
process_code as "processCode", <!-- 工序编码 -->
process_name as "processName", <!-- 工序名称 -->
company_code as "companyCode", <!-- 公司编码 -->
process_order as "processOrder", <!-- 加工顺序 -->
company_name as "companyName", <!-- 公司名称 -->
dep_code as "depCode", <!-- 部门编码 -->
dep_name as "depName", <!-- 部门名称 -->
proj_code as "projCode", <!-- 项目编码 -->
proj_name as "projName", <!-- 项目名称 -->
plan_code as "planCode", <!-- 计划编码 -->
product_type as "productType", <!-- 产品类型 -->
product_code as "productCode", <!-- 产品编号 -->
product_name as "productName", <!-- 产品名称 -->
finish_date as "finishDate", <!-- 完工日期 -->
plan_start_date as "planStartDate", <!-- 计划开始日期 -->
plan_end_date as "planEndDate", <!-- 计划结束日期 -->
quantity as "quantity", <!-- 数量 -->
finish_quantity as "finishQuantity", <!-- 完工数量 -->
unfinish_quantity as "unfinishQuantity", <!-- 未完工数量 -->
single_weight as "singleWeight", <!-- 单重 -->
total_weight as "totalWeight", <!-- 总重 -->
finish_weight as "finishWeight", <!-- 完工重量 -->
unfinish_weight as "unfinishWeight", <!-- 未完工重量 -->
account_code as "accountCode", <!-- 帐套 -->
created_by as "createdBy", <!-- 创建人 -->
created_name as "createdName", <!-- 创建人名称 -->
created_time as "createdTime", <!-- 创建时间 -->
updated_by as "updatedBy", <!-- 更新人 -->
updated_name as "updatedName", <!-- 修改人名称 -->
updated_time as "updatedTime" <!-- 更新时间 -->
FROM ${hggpSchema}.HGSC005A WHERE 1=1 FROM ${hggpSchema}.HGSC005A WHERE 1=1
<include refid="condition" /> <include refid="condition" />
<dynamic prepend="ORDER BY"> <dynamic prepend="ORDER BY">
...@@ -165,7 +169,7 @@ ...@@ -165,7 +169,7 @@
$orderBy$ $orderBy$
</isNotEmpty> </isNotEmpty>
<isEmpty property="orderBy"> <isEmpty property="orderBy">
product_type asc , product_name, process_order desc product_type asc, product_code desc, process_order desc
</isEmpty> </isEmpty>
</dynamic> </dynamic>
...@@ -388,8 +392,17 @@ ...@@ -388,8 +392,17 @@
updated_by = #updatedBy#, <!-- 更新人 --> updated_by = #updatedBy#, <!-- 更新人 -->
updated_name = #updatedName#, <!-- 修改人名称 --> updated_name = #updatedName#, <!-- 修改人名称 -->
updated_time = #updatedTime# <!-- 更新时间 --> updated_time = #updatedTime# <!-- 更新时间 -->
WHERE WHERE id = #id#
id = #id# </update>
<!-- 修改计划时间 -->
<update id="updatePlanDate">
UPDATE ${hggpSchema}.HGSC005A
SET
plan_start_date = #planStartDate#, <!-- 计划开始日期 -->
plan_end_date = #planEndDate#, <!-- 计划结束日期 -->
<include refid="SqlBase.updateRevise"/>
WHERE id = #id#
</update> </update>
<select id="queryProcessComboBox" parameterClass="java.util.HashMap" <select id="queryProcessComboBox" parameterClass="java.util.HashMap"
......
...@@ -46,6 +46,7 @@ public class HGSJ001 extends DaoEPBase { ...@@ -46,6 +46,7 @@ public class HGSJ001 extends DaoEPBase {
public static final String FIELD_STATUS = "status"; /* 状态0.停止1.启用*/ public static final String FIELD_STATUS = "status"; /* 状态0.停止1.启用*/
public static final String FIELD_COMPUTE_TYPE = "computeType"; /* 计算类型*/ public static final String FIELD_COMPUTE_TYPE = "computeType"; /* 计算类型*/
public static final String FIELD_COST_WEIGHT = "costWeight"; public static final String FIELD_COST_WEIGHT = "costWeight";
public static final String FIELD_OVERLAP_DAY = "overlapDay"; /* 前后工序重叠天数*/
public static final String COL_ID = "ID"; /* 主键id*/ public static final String COL_ID = "ID"; /* 主键id*/
public static final String COL_ACCOUNT_CODE = "ACCOUNT_CODE"; /* 企业编码 预留*/ public static final String COL_ACCOUNT_CODE = "ACCOUNT_CODE"; /* 企业编码 预留*/
...@@ -67,6 +68,7 @@ public class HGSJ001 extends DaoEPBase { ...@@ -67,6 +68,7 @@ public class HGSJ001 extends DaoEPBase {
public static final String COL_STANDARD_NUM = "STANDARD_NUM"; /* 标准工序人数*/ public static final String COL_STANDARD_NUM = "STANDARD_NUM"; /* 标准工序人数*/
public static final String COL_PRINC = "PRINC"; /* 负责人*/ public static final String COL_PRINC = "PRINC"; /* 负责人*/
public static final String COL_STATUS = "STATUS"; /* 状态0.停止1.启用*/ public static final String COL_STATUS = "STATUS"; /* 状态0.停止1.启用*/
public static final String COL_OVERLAP_DAY = "OVERLAP_DAY"; /* 前后工序重叠天数*/
public static final String QUERY = "HGSJ001.query"; public static final String QUERY = "HGSJ001.query";
public static final String COUNT = "HGSJ001.count"; public static final String COUNT = "HGSJ001.count";
...@@ -99,6 +101,7 @@ public class HGSJ001 extends DaoEPBase { ...@@ -99,6 +101,7 @@ public class HGSJ001 extends DaoEPBase {
private Integer status = 0; /* 状态0.停止1.启用*/ private Integer status = 0; /* 状态0.停止1.启用*/
private Integer computeType = 0; private Integer computeType = 0;
private BigDecimal costWeight = new BigDecimal(0.000); private BigDecimal costWeight = new BigDecimal(0.000);
private Integer overlapDay = 0; /* 前后工序重叠天数*/
/** /**
* initialize the metadata. * initialize the metadata.
...@@ -211,6 +214,11 @@ public class HGSJ001 extends DaoEPBase { ...@@ -211,6 +214,11 @@ public class HGSJ001 extends DaoEPBase {
eiColumn.setDescName("费用权重"); eiColumn.setDescName("费用权重");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_OVERLAP_DAY);
eiColumn.setType("N");
eiColumn.setDescName("前后工序重叠天数");
eiMetadata.addMeta(eiColumn);
} }
/** /**
...@@ -565,6 +573,15 @@ public class HGSJ001 extends DaoEPBase { ...@@ -565,6 +573,15 @@ public class HGSJ001 extends DaoEPBase {
public void setCostWeight(BigDecimal costWeight) { public void setCostWeight(BigDecimal costWeight) {
this.costWeight = costWeight; this.costWeight = costWeight;
} }
public Integer getOverlapDay() {
return overlapDay;
}
public void setOverlapDay(Integer overlapDay) {
this.overlapDay = overlapDay;
}
/** /**
* get the value from Map. * get the value from Map.
* *
...@@ -596,6 +613,7 @@ public class HGSJ001 extends DaoEPBase { ...@@ -596,6 +613,7 @@ public class HGSJ001 extends DaoEPBase {
setStatus(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_STATUS)), status)); setStatus(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_STATUS)), status));
setComputeType(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_COMPUTE_TYPE)), computeType)); setComputeType(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_COMPUTE_TYPE)), computeType));
setCostWeight(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_COST_WEIGHT)), costWeight)); setCostWeight(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_COST_WEIGHT)), costWeight));
setOverlapDay(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_OVERLAP_DAY)), overlapDay));
} }
/** /**
...@@ -628,6 +646,7 @@ public class HGSJ001 extends DaoEPBase { ...@@ -628,6 +646,7 @@ public class HGSJ001 extends DaoEPBase {
map.put(FIELD_STATUS, StringUtils.toString(status, eiMetadata.getMeta(FIELD_STATUS))); map.put(FIELD_STATUS, StringUtils.toString(status, eiMetadata.getMeta(FIELD_STATUS)));
map.put(FIELD_COMPUTE_TYPE, StringUtils.toString(computeType, eiMetadata.getMeta(FIELD_COMPUTE_TYPE))); map.put(FIELD_COMPUTE_TYPE, StringUtils.toString(computeType, eiMetadata.getMeta(FIELD_COMPUTE_TYPE)));
map.put(FIELD_COST_WEIGHT,StringUtils.toString(costWeight, eiMetadata.getMeta(FIELD_COST_WEIGHT))); map.put(FIELD_COST_WEIGHT,StringUtils.toString(costWeight, eiMetadata.getMeta(FIELD_COST_WEIGHT)));
map.put(FIELD_OVERLAP_DAY,StringUtils.toString(overlapDay, eiMetadata.getMeta(FIELD_OVERLAP_DAY)));
return map; return map;
} }
......
...@@ -25,32 +25,13 @@ ...@@ -25,32 +25,13 @@
PRINC_NAME as "princName", <!-- 负责人名称 --> PRINC_NAME as "princName", <!-- 负责人名称 -->
STATUS as "status", <!-- 状态0.停止1.启动 --> STATUS as "status", <!-- 状态0.停止1.启动 -->
COMPUTE_TYPE as "computeType", COMPUTE_TYPE as "computeType",
COST_WEIGHT as "costWeight" <!-- 费用权重 --> COST_WEIGHT as "costWeight", <!-- 费用权重 -->
</sql> OVERLAP_DAY as "overlapDay" <!-- 前后工序重叠天数 -->
<sql id="authCondition">
<!-- 无权限时使用 -->
<isNotEmpty prepend=" AND " property="authDepCode">
DEP_CODE = #authDepCode#
</isNotEmpty>
<!-- 仅本人和部门组合 -->
<isEqual prepend=" AND " property="authCombination" compareValue="1">
(CREATED_BY = #authOnlyPeople# OR DEP_CODE IN <iterate close=")" open="(" conjunction="," property="authDepCodes">#authDepCodes[]#</iterate>)
</isEqual>
<!-- 仅本人或部门 -->
<isNotEqual prepend=" AND " property="authCombination" compareValue="1">
<isNotEmpty property="authOnlyPeople">
CREATED_BY = #authOnlyPeople#
</isNotEmpty>
<isNotEmpty property="authDepCodes">
DEP_CODE IN <iterate close=")" open="(" conjunction="," property="authDepCodes">#authDepCodes[]#</iterate>
</isNotEmpty>
</isNotEqual>
</sql> </sql>
<sql id="condition"> <sql id="condition">
AND DELETE_FLAG = 0 AND DELETE_FLAG = 0
<include refid="authCondition"/> <include refid="HGXSDataAuth.authCondition"/>
<isNotEmpty prepend=" AND " property="id"> <isNotEmpty prepend=" AND " property="id">
ID = #id# ID = #id#
</isNotEmpty> </isNotEmpty>
...@@ -128,101 +109,37 @@ ...@@ -128,101 +109,37 @@
</isNotEmpty> </isNotEmpty>
</sql> </sql>
<select id="query" parameterClass="java.util.HashMap" <sql id="orderBy">
resultClass="com.baosight.hggp.hg.sj.domain.HGSJ001">
SELECT
<include refid="column"/>
FROM ${hggpSchema}.HGGY001 WHERE 1=1
<include refid="condition" />
<dynamic prepend="ORDER BY"> <dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy"> <isNotEmpty property="orderBy">
$orderBy$ $orderBy$
</isNotEmpty> </isNotEmpty>
<isEmpty property="orderBy"> <isEmpty property="orderBy">
CREATED_TIME desc,ID asc CREATED_TIME DESC, ID ASC
</isEmpty> </isEmpty>
</dynamic> </dynamic>
</sql>
<select id="query" resultClass="com.baosight.hggp.hg.sj.domain.HGSJ001">
SELECT
<include refid="column"/>
FROM ${hggpSchema}.HGGY001 WHERE 1=1
<include refid="condition"/>
<include refid="orderBy"/>
</select> </select>
<select id="count" resultClass="int"> <select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hggpSchema}.HGGY001 WHERE 1=1 SELECT COUNT(*) FROM ${hggpSchema}.HGGY001 WHERE 1=1
<include refid="condition" /> <include refid="condition"/>
</select> </select>
<!--
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="accountCode">
ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
CREATED_BY = #createdBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdName">
CREATED_NAME = #createdName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
CREATED_TIME = #createdTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy">
UPDATED_BY = #updatedBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedName">
UPDATED_NAME = #updatedName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime">
UPDATED_TIME = #updatedTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deleteFlag">
DELETE_FLAG = #deleteFlag#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryCode">
FACTORY_CODE = #factoryCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryName">
FACTORY_NAME = #factoryName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="processCode">
PROCESS_CODE = #processCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="processName">
PROCESS_NAME = #processName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="unit">
UNIT = #unit#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="standardJob">
STANDARD_JOB = #standardJob#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="standardDays">
STANDARD_DAYS = #standardDays#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="standardNum">
STANDARD_NUM = #standardNum#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="princ">
PRINC = #princ#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="status">
STATUS = #status#
</isNotEmpty>
-->
<insert id="insert"> <insert id="insert">
INSERT INTO ${hggpSchema}.HGGY001 (ID, <!-- 主键id --> INSERT INTO ${hggpSchema}.HGGY001 (
ACCOUNT_CODE, <!-- 企业编码 预留 --> ACCOUNT_CODE, <!-- 企业编码 预留 -->
DEP_CODE, <!-- 部门编码 --> DEP_CODE, <!-- 部门编码 -->
CREATED_BY, <!-- 创建人 --> CREATED_BY, <!-- 创建人 -->
CREATED_NAME, <!-- 创建人名称 --> CREATED_NAME, <!-- 创建人名称 -->
CREATED_TIME, <!-- 创建时间 --> CREATED_TIME, <!-- 创建时间 -->
UPDATED_BY, <!-- 更新人 -->
UPDATED_NAME, <!-- 更新人名称 -->
UPDATED_TIME, <!-- 更新时间 -->
DELETE_FLAG, <!-- 是否删除0.否1.是 --> DELETE_FLAG, <!-- 是否删除0.否1.是 -->
FACTORY_CODE, <!-- 厂区编码 --> FACTORY_CODE, <!-- 厂区编码 -->
FACTORY_NAME, <!-- 厂区名称 --> FACTORY_NAME, <!-- 厂区名称 -->
...@@ -235,15 +152,16 @@ ...@@ -235,15 +152,16 @@
PRINC, <!-- 负责人 --> PRINC, <!-- 负责人 -->
PRINC_NAME, PRINC_NAME,
STATUS, <!-- 状态0.停止1.启动 --> STATUS, <!-- 状态0.停止1.启动 -->
COMPUTE_TYPE, COMPUTE_TYPE, COST_WEIGHT, OVERLAP_DAY
COST_WEIGHT ) VALUES (
) #accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#,
VALUES (#id#, #accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #deleteFlag#, #factoryCode#, #factoryName#, #processCode#, #processName#, #unit#, #standardJob#, #standardDays#, #standardNum#, #princ#, #princName#,#status#,#computeType#, #costWeight#) #deleteFlag#, #factoryCode#, #factoryName#, #processCode#, #processName#,
#unit#, #standardJob#, #standardDays#, #standardNum#, #princ#, #princName#,
#status#, #computeType#, #costWeight#, #overlapDay#)
</insert> </insert>
<delete id="delete"> <delete id="delete">
DELETE FROM ${hggpSchema}.HGGY001 WHERE DELETE FROM ${hggpSchema}.HGGY001 WHERE ID = #id#
ID = #id#
</delete> </delete>
<!--逻辑删除--> <!--逻辑删除-->
...@@ -254,18 +172,12 @@ ...@@ -254,18 +172,12 @@
UPDATED_NAME = #updatedName#, <!-- 更新人名称 --> UPDATED_NAME = #updatedName#, <!-- 更新人名称 -->
UPDATED_TIME = #updatedTime#, <!-- 更新时间 --> UPDATED_TIME = #updatedTime#, <!-- 更新时间 -->
DELETE_FLAG = #deleteFlag# <!-- 是否删除0.否1.是 --> DELETE_FLAG = #deleteFlag# <!-- 是否删除0.否1.是 -->
WHERE WHERE ID = #id#
ID = #id#
</update> </update>
<update id="update"> <update id="update">
UPDATE ${hggpSchema}.HGGY001 UPDATE ${hggpSchema}.HGGY001
SET SET
ACCOUNT_CODE = #accountCode#, <!-- 企业编码 预留 -->
DEP_CODE = #depCode#, <!-- 部门编码 -->
CREATED_BY = #createdBy#, <!-- 创建人 -->
CREATED_NAME = #createdName#, <!-- 创建人名称 -->
CREATED_TIME = #createdTime#, <!-- 创建时间 -->
UPDATED_BY = #updatedBy#, <!-- 更新人 --> UPDATED_BY = #updatedBy#, <!-- 更新人 -->
UPDATED_NAME = #updatedName#, <!-- 更新人名称 --> UPDATED_NAME = #updatedName#, <!-- 更新人名称 -->
UPDATED_TIME = #updatedTime#, <!-- 更新时间 --> UPDATED_TIME = #updatedTime#, <!-- 更新时间 -->
...@@ -282,9 +194,9 @@ ...@@ -282,9 +194,9 @@
PRINC_NAME = #princName#, PRINC_NAME = #princName#,
STATUS = #status#, <!-- 状态0.停止1.启动 --> STATUS = #status#, <!-- 状态0.停止1.启动 -->
COMPUTE_TYPE = #computeType#, COMPUTE_TYPE = #computeType#,
COST_WEIGHT = #costWeight# COST_WEIGHT = #costWeight#,
WHERE OVERLAP_DAY = #overlapDay#
ID = #id# WHERE ID = #id#
</update> </update>
<update id="updateStatus"> <update id="updateStatus">
...@@ -294,8 +206,7 @@ ...@@ -294,8 +206,7 @@
UPDATED_NAME = #updatedName#, <!-- 更新人名称 --> UPDATED_NAME = #updatedName#, <!-- 更新人名称 -->
UPDATED_TIME = #updatedTime#, <!-- 更新时间 --> UPDATED_TIME = #updatedTime#, <!-- 更新时间 -->
STATUS = #status# <!-- 状态0.启用1.停止 --> STATUS = #status# <!-- 状态0.启用1.停止 -->
WHERE WHERE ID = #id#
ID = #id#
</update> </update>
<select id="queryProcessCode" parameterClass="java.util.HashMap" resultClass="java.util.HashMap"> <select id="queryProcessCode" parameterClass="java.util.HashMap" resultClass="java.util.HashMap">
......
...@@ -22,8 +22,18 @@ import java.util.stream.Collectors; ...@@ -22,8 +22,18 @@ import java.util.stream.Collectors;
*/ */
public class HGSJTools { public class HGSJTools {
/**
*
* @author:songx
* @date:2024/9/10,11:04
*/
public static class Hgsj001 { public static class Hgsj001 {
/**
*
* @param processCodes
* @return
*/
public static List<HGSJ001> queryByProcessCodes(List<String> processCodes){ public static List<HGSJ001> queryByProcessCodes(List<String> processCodes){
AssertUtils.isEmpty(processCodes, "工序编码不能为空!"); AssertUtils.isEmpty(processCodes, "工序编码不能为空!");
Map paramMap = new HashMap(); Map paramMap = new HashMap();
...@@ -31,14 +41,28 @@ public class HGSJTools { ...@@ -31,14 +41,28 @@ public class HGSJTools {
List<HGSJ001> results = DaoBase.getInstance().query(HGSJ001.QUERY, paramMap); List<HGSJ001> results = DaoBase.getInstance().query(HGSJ001.QUERY, paramMap);
return CollectionUtils.isEmpty(results) ? null : results; return CollectionUtils.isEmpty(results) ? null : results;
} }
/**
* @param processCodes
* @return
*/
public static Map<String, HGSJ001> mapByCode(List<String> processCodes) {
List<HGSJ001> results = queryByProcessCodes(processCodes);
if (CollectionUtils.isEmpty(results)) {
return null;
}
return results.stream().collect(Collectors.toMap(HGSJ001::getProcessCode, item -> item));
}
} }
/** /**
* Hgsj002a公共DAO方法定义 * Hgsj002a公共DAO方法定义
*/ */
public static class Hgsj002a { public static class Hgsj002a {
/** /**
* 查询 * 查询
*
* @param parentId * @param parentId
* @return * @return
*/ */
......
...@@ -3,15 +3,12 @@ ...@@ -3,15 +3,12 @@
*/ */
package com.baosight.hggp.util; package com.baosight.hggp.util;
import java.text.SimpleDateFormat;
import java.time.Instant; import java.time.Instant;
import java.time.LocalDate; import java.time.LocalDate;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.time.ZoneId; import java.time.ZoneId;
import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatter;
import java.time.temporal.TemporalAdjusters; import java.time.temporal.TemporalAdjusters;
import java.util.Date;
import java.util.GregorianCalendar;
/** /**
* jdk8中新增的日期处理类,更安全、更精确也更明确 * jdk8中新增的日期处理类,更安全、更精确也更明确
...@@ -21,7 +18,7 @@ import java.util.GregorianCalendar; ...@@ -21,7 +18,7 @@ import java.util.GregorianCalendar;
*/ */
public class DateUtils extends org.apache.commons.lang3.time.DateUtils { public class DateUtils extends org.apache.commons.lang3.time.DateUtils {
public static final DateTimeFormatter DATETIME_ALL = DateTimeFormatter.ofPattern("yyyy-MM-dd\'T\'HH:mm:ss"); public static final DateTimeFormatter DATETIME_ALL = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss");
public static final DateTimeFormatter TIME = DateTimeFormatter.ofPattern("HHmmss"); public static final DateTimeFormatter TIME = DateTimeFormatter.ofPattern("HHmmss");
public static final DateTimeFormatter SHORT_YMDHMSS = DateTimeFormatter.ofPattern("yyyyMMddHHmmssSSS"); public static final DateTimeFormatter SHORT_YMDHMSS = DateTimeFormatter.ofPattern("yyyyMMddHHmmssSSS");
public static final DateTimeFormatter SHORT_DATETIME = DateTimeFormatter.ofPattern("yyyyMMddHHmmss"); public static final DateTimeFormatter SHORT_DATETIME = DateTimeFormatter.ofPattern("yyyyMMddHHmmss");
...@@ -39,21 +36,22 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils { ...@@ -39,21 +36,22 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils {
* @return * @return
*/ */
public static String getYesMonth(String date) { public static String getYesMonth(String date) {
return getYesMonth(date,DateTimeFormatter.ISO_LOCAL_DATE); return getYesMonth(date, DateTimeFormatter.ISO_LOCAL_DATE);
} }
public static String getYesMonth(String date,DateTimeFormatter dateTimeFormatter) { public static String getYesMonth(String date, DateTimeFormatter dateTimeFormatter) {
LocalDate endLocalDate = LocalDate.parse(date, dateTimeFormatter); LocalDate endLocalDate = LocalDate.parse(date, dateTimeFormatter);
endLocalDate = endLocalDate.minusMonths(1).with(TemporalAdjusters.firstDayOfMonth()); endLocalDate = endLocalDate.minusMonths(1).with(TemporalAdjusters.firstDayOfMonth());
return endLocalDate.format(dateTimeFormatter); return endLocalDate.format(dateTimeFormatter);
} }
/** /**
* 获取下个月的1号日期 * 获取下个月的1号日期
* *
* @param date 2023-09-06 or 20230906 * @param date 2023-09-06 or 20230906
* @return * @return
*/ */
public static String getPlusYesMonth(String date,DateTimeFormatter dateTimeFormatter) { public static String getPlusYesMonth(String date, DateTimeFormatter dateTimeFormatter) {
LocalDate endLocalDate = LocalDate.parse(date, dateTimeFormatter); LocalDate endLocalDate = LocalDate.parse(date, dateTimeFormatter);
endLocalDate = endLocalDate.plusMonths(1).with(TemporalAdjusters.firstDayOfMonth()); endLocalDate = endLocalDate.plusMonths(1).with(TemporalAdjusters.firstDayOfMonth());
return endLocalDate.format(dateTimeFormatter); return endLocalDate.format(dateTimeFormatter);
...@@ -85,14 +83,16 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils { ...@@ -85,14 +83,16 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils {
public static String yesterday() { public static String yesterday() {
return LocalDate.now().minusDays(1).format(DATE); return LocalDate.now().minusDays(1).format(DATE);
} }
/** /**
* 获取后一天日期字符串(yyyy-MM-dd) * 获取后一天日期字符串(yyyy-MM-dd)
* *
* @return * @return
*/ */
public static String yesterdayEnd(String date,Integer day) { public static String yesterdayEnd(String date, Integer day) {
return LocalDate.parse(date, SHORT_DATE).plusDays(day).format(DATE); return LocalDate.parse(date, SHORT_DATE).plusDays(day).format(DATE);
} }
/** /**
* 获取日期字符串(yyyy-MM-dd) * 获取日期字符串(yyyy-MM-dd)
* *
...@@ -252,4 +252,32 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils { ...@@ -252,4 +252,32 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils {
.replaceAll(" ", ""); .replaceAll(" ", "");
} }
/**
* 转换成日期
*
* @param dateTime yyyyMMddhhmmss
* @return
*/
public static LocalDate parseToDate(String dateTime) {
return LocalDateTime.parse(dateTime, SHORT_DATETIME).toLocalDate();
}
/**
* @param startDate yyyy-MM-dd
* @param endDate yyyy-MM-dd
* @return
*/
public static boolean isBefore(String startDate, String endDate) {
return LocalDate.parse(startDate).isBefore(LocalDate.parse(endDate));
}
/**
* @param startDate yyyy-MM-dd
* @param endDate yyyy-MM-dd
* @return
*/
public static boolean isAfter(String startDate, String endDate) {
return LocalDate.parse(startDate).isAfter(LocalDate.parse(endDate));
}
} }
...@@ -17,6 +17,9 @@ ...@@ -17,6 +17,9 @@
<!-- 工具 --> <!-- 工具 -->
<sqlMap resource="com/baosight/hggp/hg/dm/sql/HGDM099.xml"/> <sqlMap resource="com/baosight/hggp/hg/dm/sql/HGDM099.xml"/>
<!-- 工艺 -->
<sqlMap resource="com/baosight/hggp/hg/sj/sql/HGSJ001.xml"/>
<!--成本--> <!--成本-->
<sqlMap resource="com/baosight/hggp/hg/cb/sql/HGCB001.xml"/> <sqlMap resource="com/baosight/hggp/hg/cb/sql/HGCB001.xml"/>
<sqlMap resource="com/baosight/hggp/hg/cb/sql/HGCB002.xml"/> <sqlMap resource="com/baosight/hggp/hg/cb/sql/HGCB002.xml"/>
...@@ -27,6 +30,7 @@ ...@@ -27,6 +30,7 @@
<sqlMap resource="com/baosight/hggp/hg/cg/sql/HGCG001.xml"/> <sqlMap resource="com/baosight/hggp/hg/cg/sql/HGCG001.xml"/>
<sqlMap resource="com/baosight/hggp/hg/cg/sql/HGCG002.xml"/> <sqlMap resource="com/baosight/hggp/hg/cg/sql/HGCG002.xml"/>
<sqlMap resource="com/baosight/hggp/hg/cg/sql/HGCG003.xml"/> <sqlMap resource="com/baosight/hggp/hg/cg/sql/HGCG003.xml"/>
<!-- 库存 --> <!-- 库存 -->
<sqlMap resource="com/baosight/hggp/hg/kc/sql/HGKC001.xml"/> <sqlMap resource="com/baosight/hggp/hg/kc/sql/HGKC001.xml"/>
<sqlMap resource="com/baosight/hggp/hg/kc/sql/HGKC002.xml"/> <sqlMap resource="com/baosight/hggp/hg/kc/sql/HGKC002.xml"/>
...@@ -44,6 +48,7 @@ ...@@ -44,6 +48,7 @@
<sqlMap resource="com/baosight/hggp/hg/kc/sql/HGKC011.xml"/> <sqlMap resource="com/baosight/hggp/hg/kc/sql/HGKC011.xml"/>
<sqlMap resource="com/baosight/hggp/hg/kc/sql/HGKC013.xml"/> <sqlMap resource="com/baosight/hggp/hg/kc/sql/HGKC013.xml"/>
<sqlMap resource="com/baosight/hggp/hg/kc/sql/HGKC013A.xml"/> <sqlMap resource="com/baosight/hggp/hg/kc/sql/HGKC013A.xml"/>
<!-- 质量 --> <!-- 质量 -->
<sqlMap resource="com/baosight/hggp/hg/zl/sql/HGZL001.xml"/> <sqlMap resource="com/baosight/hggp/hg/zl/sql/HGZL001.xml"/>
<sqlMap resource="com/baosight/hggp/hg/zl/sql/HGZL002.xml"/> <sqlMap resource="com/baosight/hggp/hg/zl/sql/HGZL002.xml"/>
......
...@@ -7,7 +7,7 @@ $(function () { ...@@ -7,7 +7,7 @@ $(function () {
}); });
// 正序排产 // 正序排产
$("#BNT_SCHEDULE_EX").on("click", scheduleEx); $("#BNT_SCHEDULE_ASC").on("click", scheduleAsc);
// 倒序排产 // 倒序排产
$("#BNT_SCHEDULE").on("click", schedule); $("#BNT_SCHEDULE").on("click", schedule);
...@@ -45,10 +45,10 @@ $(window).load(function () { ...@@ -45,10 +45,10 @@ $(window).load(function () {
/** /**
* 正序排产 * 正序排产
*/ */
function schedule() { function scheduleAsc() {
JSUtils.confirm("自动排产将覆盖原排产数据,请谨慎操作,确认对当前数据进行排产? ", { JSUtils.confirm("自动排产将覆盖原排产数据,请谨慎操作,确认对当前数据进行正序排产? ", {
ok: function () { ok: function () {
JSUtils.submitGridsData("result", "HGSC005A", "scheduleEx", true); JSUtils.submitGridsData("result", "HGSC005A", "scheduleAsc", true);
} }
}); });
} }
...@@ -57,7 +57,7 @@ function schedule() { ...@@ -57,7 +57,7 @@ function schedule() {
* 倒序排产 * 倒序排产
*/ */
function schedule() { function schedule() {
JSUtils.confirm("自动排产将覆盖原排产数据,请谨慎操作,确认对当前数据进行排产? ", { JSUtils.confirm("自动排产将覆盖原排产数据,请谨慎操作,确认对当前数据进行倒序排产? ", {
ok: function () { ok: function () {
JSUtils.submitGridsData("result", "HGSC005A", "schedule", true); JSUtils.submitGridsData("result", "HGSC005A", "schedule", true);
} }
......
...@@ -20,8 +20,7 @@ $(function (){ ...@@ -20,8 +20,7 @@ $(function (){
pageSize: 10, pageSize: 10,
pageSizes: [10, 20, 50, 100], pageSizes: [10, 20, 50, 100],
}, },
columns: [ columns: [{
{
field: "operator", field: "operator",
title: "操作", title: "操作",
template: function (item) { template: function (item) {
...@@ -229,7 +228,7 @@ let save = function (btnNode) { ...@@ -229,7 +228,7 @@ let save = function (btnNode) {
if(flag) { if(flag) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", { JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () { ok: function () {
JSUtils.submitGridsData("result", "HGSJ001", "save", true); JSUtils.submitGridsData("result", "HGSJ001", "save", false);
btnNode.attr("disabled", false); btnNode.attr("disabled", false);
} }
}); });
......
<%--
Created by IntelliJ IDEA.
User: 1
Date: 2024/5/6
Time: 9:39
To change this template use File | Settings | File Templates.
--%>
<!DOCTYPE html> <!DOCTYPE html>
<%@ page contentType="text/html;charset=UTF-8" language="java" %> <%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
...@@ -15,7 +8,7 @@ ...@@ -15,7 +8,7 @@
%> %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/> <c:set var="ctx" value="${pageContext.request.contextPath}"/>
<c:set var="loginName" value="<%=loginName%>" /> <c:set var="loginName" value="<%=loginName%>"/>
<EF:EFPage title="工序设置"> <EF:EFPage title="工序设置">
<EF:EFRegion id="inqu" title="查询条件"> <EF:EFRegion id="inqu" title="查询条件">
...@@ -48,7 +41,8 @@ ...@@ -48,7 +41,8 @@
</EF:EFComboColumn> </EF:EFComboColumn>
<EF:EFColumn ename="factoryName" cname="公司名称" hidden="true"/> <EF:EFColumn ename="factoryName" cname="公司名称" hidden="true"/>
<EF:EFColumn ename="processCode" cname="工序编码" enable="false" width="100" align="center"/> <EF:EFColumn ename="processCode" cname="工序编码" enable="false" width="100" align="center"/>
<EF:EFColumn ename="processName" cname="工序名称" width="120" enable="true" readonly="true" align="center" required="true"/> <EF:EFColumn ename="processName" cname="工序名称" width="120" enable="true" readonly="true" align="center"
required="true"/>
<EF:EFColumn ename="unit" cname="单位" width="80" enable="true" readonly="false" align="center"/> <EF:EFColumn ename="unit" cname="单位" width="80" enable="true" readonly="false" align="center"/>
<EF:EFColumn ename="standardJob" cname="标准作业" width="100" enable="true" format="{0:N3}" editType="number" <EF:EFColumn ename="standardJob" cname="标准作业" width="100" enable="true" format="{0:N3}" editType="number"
displayType="0" sort="true" align="right" required="true" displayType="0" sort="true" align="right" required="true"
...@@ -58,10 +52,11 @@ ...@@ -58,10 +52,11 @@
displayType="0" sort="true" align="right" displayType="0" sort="true" align="right"
data-regex="/^-?[0-9]{1,15}?$/" maxLength="20" required="true" data-regex="/^-?[0-9]{1,15}?$/" maxLength="20" required="true"
data-errorprompt="请输入数字,该值最大可设置15位整数!"/> data-errorprompt="请输入数字,该值最大可设置15位整数!"/>
<EF:EFColumn ename="standardNum" cname="标准工序人数" width="100" enable="true" format="{0:N3}" editType="number" <EF:EFColumn ename="standardNum" cname="标准工序人数" width="120" enable="true" format="{0:N3}" editType="number"
displayType="0" sort="true" align="right" displayType="0" sort="true" align="right"
data-regex="/^-?[0-9]{1,15}?$/" maxLength="20" required="true" data-regex="/^-?[0-9]{1,15}?$/" maxLength="20" required="true"
data-errorprompt="请输入数字,该值最大可设置15位整数!"/> data-errorprompt="请输入数字,该值最大可设置15位整数!"/>
<EF:EFColumn ename="overlapDay" cname="工序重叠天数" width="120" align="center" required="true"/>
<EF:EFComboColumn ename="computeType" cname="计算类型" width="80" enable="true" align="center" required="true"> <EF:EFComboColumn ename="computeType" cname="计算类型" width="80" enable="true" align="center" required="true">
<EF:EFCodeOption codeName="hggp.hgsj.computeType"/> <EF:EFCodeOption codeName="hggp.hgsj.computeType"/>
</EF:EFComboColumn> </EF:EFComboColumn>
...@@ -77,7 +72,8 @@ ...@@ -77,7 +72,8 @@
<EF:EFOptions blockId="user_block_id" textField="textField" valueField="valueField"/> <EF:EFOptions blockId="user_block_id" textField="textField" valueField="valueField"/>
</EF:EFComboColumn> </EF:EFComboColumn>
<%--<EF:EFColumn ename="princ" cname="负责人" width="120" enable="true" readonly="false" align="center" required="true"/>--%> <%--<EF:EFColumn ename="princ" cname="负责人" width="120" enable="true" readonly="false" align="center" required="true"/>--%>
<EF:EFComboColumn ename="status" cname="状态" width="80" enable="true" readonly="false" align="center" required="true" defaultValue="1"> <EF:EFComboColumn ename="status" cname="状态" width="80" enable="true" readonly="false" align="center"
required="true" defaultValue="1">
<EF:EFCodeOption codeName="hpjx.hpjx.status"/> <EF:EFCodeOption codeName="hpjx.hpjx.status"/>
</EF:EFComboColumn> </EF:EFComboColumn>
<EF:EFColumn cname="创建人" ename="createdName" align="center" width="100" readonly="true" required="false" <EF:EFColumn cname="创建人" ename="createdName" align="center" width="100" readonly="true" required="false"
......
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