Commit 9e0e782d by 宋祥

1.委外入库单不合格数量时新增整改通知单

parent 2764e964
......@@ -5,8 +5,10 @@ package com.baosight.hggp.common;
* @version 1.0 2024/5/21
*/
public enum CheckTypeEnum {
PROCESS_CHECK(1,"工序质检单"),
POLLING_CHECK(2,"日常巡检单");
POLLING_CHECK(2,"日常巡检单"),
OUTSOURCE_CHECK(3, "委外入库单");
private Integer code;
......
......@@ -82,6 +82,8 @@ public class HGConstant {
public static final String HGZL002_CHECK_CODE = "HGZL002_CHECK_CODE";
//日常巡检
public static final String HGZL003_CHECK_CODE = "HGZL003_CHECK_CODE";
// 整改通知单
public static final String HGZL004_CHECK_CODE = "HGZL004_CHECK_CODE";
//生产任务订单
public static final String PROD_TASK_NO = "PROD_TASK_NO";
//售后维修单号
......
......@@ -7,7 +7,7 @@ package com.baosight.hggp.hg.ct.constant;
public class HgCtConst {
/**
* HPCT01 定义
* HGCT01 定义
*
* @author:songx
* @date:2024/9/24,17:54
......
......@@ -259,8 +259,8 @@ public class ServiceHGZL011 extends ServiceBase {
DaoUtils.insert(HGKC008A.INSERT, newKc008A);
// 修改库存
HGKCUtils.HgKc010.updateInv(dbKc008A.getCompanyCode(), dbKc008A.getWhCode(),
dbKc008A.getInventCode(), newKc008A.getInvQty(), newKc008A.getInvUnitWeight(),
newKc008A.getInvWeight());
dbKc008A.getInventCode(), newKc008A.getInvQty().negate(), newKc008A.getInvUnitWeight(),
newKc008A.getInvWeight().negate());
}
/**
......
......@@ -251,6 +251,9 @@ public class ServiceHGZL012 extends ServiceBase {
}
// 不合格量大于0,更新委外加工
if (fZl012.getUnQualityQty().compareTo(BigDecimal.ZERO) > 0) {
// 生成整改通知单
HGZLTools.THGZL004.addByHGZL012(fZl012);
// 更新委外加工
HGSCTools.Hgsc010a.updateDeliver(dbKc014A.getPcsId(), fZl012.getUnQualityQty());
}
}
......
......@@ -11,6 +11,7 @@ import com.baosight.hggp.hg.kc.tools.HGKCTools;
import com.baosight.hggp.hg.kc.utils.HGKCUtils;
import com.baosight.hggp.hg.zl.constant.HgZlConst;
import com.baosight.hggp.hg.zl.domain.HGZL012;
import com.baosight.hggp.hg.zl.tools.HGZLTools;
import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.BeanUtils;
import com.baosight.hggp.util.CommonMethod;
......
<?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
Generate time : 2024-06-03 11:12:42
Version : 1.0
schema : hggp
tableName : HGZL004
id BIGINT NOT NULL primarykey,
check_id BIGINT NOT NULL,
company_code VARCHAR NOT NULL,
company_name VARCHAR NOT NULL,
dep_code VARCHAR,
dep_name VARCHAR,
proj_code VARCHAR,
proj_name VARCHAR,
handle_status TINYINT,
quality_problem VARCHAR,
process_sugges VARCHAR,
rectificat_sugges VARCHAR,
check_type TINYINT,
check_code VARCHAR,
product_type TINYINT,
product_code VARCHAR,
product_name VARCHAR,
factory_code VARCHAR,
factory_name VARCHAR,
group_code VARCHAR,
group_name VARCHAR,
work_by VARCHAR,
work_name VARCHAR,
check_by VARCHAR,
check_name VARCHAR,
account_code VARCHAR NOT NULL,
created_by VARCHAR,
created_name VARCHAR,
created_time VARCHAR,
updated_by VARCHAR,
updated_name VARCHAR,
updated_time VARCHAR
-->
<!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://www.ibatis.com/dtd/sql-map-2.dtd">
<sqlMap namespace="HGZL004">
<sql id="condition">
<include refid="HGXSDataAuth.authCondition"/>
<isNotEmpty prepend=" AND " property="id">
id = #id#
</isNotEmpty>
......@@ -152,8 +114,7 @@
</isNotEmpty>
</sql>
<select id="query" parameterClass="java.util.HashMap"
resultClass="com.baosight.hggp.hg.zl.domain.HGZL004">
<select id="query" resultClass="com.baosight.hggp.hg.zl.domain.HGZL004">
SELECT
id as "id",
check_id as "checkId", <!-- 质检单ID -->
......@@ -199,136 +160,36 @@
id desc
</isEmpty>
</dynamic>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hggpSchema}.HGZL004 WHERE 1=1
<include refid="condition" />
<include refid="condition"/>
</select>
<!--
<isNotEmpty prepend=" AND " property="id">
id = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="checkId">
check_id = #checkId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
company_code = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyName">
company_name = #companyName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
dep_code = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depName">
dep_name = #depName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projCode">
proj_code = #projCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projName">
proj_name = #projName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="handleStatus">
handle_status = #handleStatus#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="qualityProblem">
quality_problem = #qualityProblem#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="processSugges">
process_sugges = #processSugges#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="rectificatSugges">
rectificat_sugges = #rectificatSugges#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="checkType">
check_type = #checkType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="checkCode">
check_code = #checkCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="productType">
product_type = #productType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="productCode">
product_code = #productCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="productName">
product_name = #productName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryCode">
factory_code = #factoryCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryName">
factory_name = #factoryName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="groupCode">
group_code = #groupCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="groupName">
group_name = #groupName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="workBy">
work_by = #workBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="workName">
work_name = #workName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="checkBy">
check_by = #checkBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="checkName">
check_name = #checkName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="accountCode">
account_code = #accountCode#
</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 INTO ${hggpSchema}.HGZL004 (id,
check_id, <!-- 质检单ID -->
company_code, <!-- 公司编码 -->
company_name, <!-- 公司名称 -->
dep_code, <!-- 部门编码 -->
dep_name, <!-- 部门名称 -->
INSERT INTO ${hggpSchema}.HGZL004 (
check_id,<!-- 质检单ID -->
company_code,<!-- 公司编码 -->
company_name,<!-- 公司名称 -->
dep_code,<!-- 部门编码 -->
dep_name,<!-- 部门名称 -->
proj_code, <!-- 项目编码 -->
proj_name, <!-- 项目名称 -->
handle_status, <!-- 处理状态 0:待处理;1:处理中;2:已处理 -->
proj_name,<!-- 项目名称 -->
handle_status,<!-- 处理状态 0:待处理;1:处理中;2:已处理 -->
quality_problem, <!-- 质量问题 -->
process_sugges, <!-- 处理意见 -->
rectificat_sugges, <!-- 整改措施 -->
check_type, <!-- 质检单类型 1:工序质检单;2:日常巡检单 -->
check_code, <!-- 质检单编码 -->
product_type, <!-- 产品类型 -->
process_sugges,<!-- 处理意见 -->
rectificat_sugges,<!-- 整改措施 -->
check_type,<!-- 质检单类型 1:工序质检单;2:日常巡检单 -->
check_code,<!-- 质检单编码 -->
product_type,<!-- 产品类型 -->
product_code, <!-- 产品编号 -->
product_name, <!-- 产品名称 -->
factory_code, <!-- 工厂编号 -->
factory_name, <!-- 工厂名称 -->
group_code, <!-- 工作组编号 -->
group_name, <!-- 工作组名称 -->
work_by, <!-- 生产人 -->
work_by,<!-- 生产人 -->
work_name, <!-- 生产人名称 -->
check_by, <!-- 质检人 -->
check_name, <!-- 质检人名称 -->
......@@ -341,13 +202,16 @@
updated_time, <!-- 更新时间 -->
process_code, <!-- 工序编码 -->
process_name <!-- 工序名称 -->
)
VALUES (#id#, #checkId#, #companyCode#, #companyName#, #depCode#, #depName#, #projCode#, #projName#, #handleStatus#, #qualityProblem#, #processSugges#, #rectificatSugges#, #checkType#, #checkCode#, #productType#, #productCode#, #productName#, #factoryCode#, #factoryName#, #groupCode#, #groupName#, #workBy#, #workName#, #checkBy#, #checkName#, #accountCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #processCode#, #processName#)
) VALUES (
#checkId#, #companyCode#, #companyName#, #depCode#, #depName#, #projCode#, #projName#, #handleStatus#,
#qualityProblem#, #processSugges#, #rectificatSugges#, #checkType#, #checkCode#, #productType#, #productCode#,
#productName#, #factoryCode#, #factoryName#, #groupCode#, #groupName#, #workBy#, #workName#, #checkBy#,
#checkName#, #accountCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#,
#updatedTime#, #processCode#, #processName#)
</insert>
<delete id="delete">
DELETE FROM ${hggpSchema}.HGZL004 WHERE
id = #id#
DELETE FROM ${hggpSchema}.HGZL004 WHERE id = #id#
</delete>
<update id="update">
......@@ -386,9 +250,9 @@
updated_time = #updatedTime#, <!-- 更新时间 -->
process_code = #processCode#, <!-- 工序编码 -->
process_name = #processName# <!-- 工序名称 -->
WHERE
id = #id#
WHERE id = #id#
</update>
<!-- 行锁 -->
<update id="lock">
UPDATE ${hggpSchema}.HGZL004
......@@ -423,4 +287,5 @@
DELETE FROM ${hggpSchema}.HGZL004 WHERE
id IN <iterate close=")" open="(" conjunction="," property="ids">#ids[]#</iterate>
</delete>
</sqlMap>
......@@ -21,10 +21,10 @@ import com.baosight.hggp.hg.zl.domain.HGZL004A;
import com.baosight.hggp.hg.zl.domain.HGZL011;
import com.baosight.hggp.hg.zl.domain.HGZL012;
import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.BeanUtils;
import com.baosight.hggp.util.DateUtils;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.BeanUtils;
import java.math.BigDecimal;
import java.util.HashMap;
......@@ -258,6 +258,27 @@ public class HGZLTools {
}
}
/**
* 生成整改通知单
*
* @param hgZl012
*/
public static void addByHGZL012(HGZL012 hgZl012) {
if (hgZl012.getUnQualityQty().compareTo(BigDecimal.ZERO) < 1) {
return;
}
HGZL004 newZl004 = BeanUtils.copy(hgZl012, HGZL004.class);
newZl004.setCheckId(hgZl012.getId());
newZl004.setCheckType(CheckTypeEnum.OUTSOURCE_CHECK.getCode());
newZl004.setHandleStatus(HandleStatusEnum.UNPROCESS.getCode());
newZl004.setCheckCode(SequenceGenerator.getNextSequence(HGConstant.SequenceId.HGZL002_CHECK_CODE));
newZl004.setCheckBy(UserSessionUtils.getLoginName());
newZl004.setCheckName(UserSessionUtils.getLoginCName());
newZl004.setProductCode(hgZl012.getInventCode());
newZl004.setProductName(hgZl012.getInventName());
DaoUtils.insert(HGZL004.INSERT, newZl004);
}
public static void deleteByCheckIds(List<Long> checkIds,CheckTypeEnum checkType){
List<HGZL004> hgzl004List = listByCheckIds(checkIds,checkType.getCode());
List<Long> ids = hgzl004List.stream().map(HGZL004::getId).collect(Collectors.toList());
......
......@@ -22,24 +22,24 @@
</EF:EFRegion>
<EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row">
<EF:EFColumn ename="id" cname="内码" hidden="true"/>
<EF:EFColumn ename="checkBy" cname="质检员" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="100" align="center"/>
<EF:EFColumn ename="companyName" cname="公司名称" width="130" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="problemPic" cname="问题照片" width="90" enable="false" align="center"/>
<EF:EFColumn ename="processPic" cname="处理照片" width="90" enable="false" align="center"/>
<EF:EFColumn ename="checkCode" cname="整改单号" width="130" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="companyName" cname="公司名称" width="180" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="projCode" cname="项目编号" width="130" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="projName" cname="项目名称" width="130" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="createdTime" cname="单据日期" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" enable="true" width="120" align="center" readOnly="true"/>
<EF:EFColumn ename="checkCode" cname="检查单号" width="130" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="checkName" cname="质检人" width="100" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="groupName" cname="责任部门" width="100" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="workName" cname="姓名" width="90" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="productName" cname="产品名称" width="90" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="processName" cname="工序" width="100" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="qualityProblem" cname="质量问题描述" width="130" align="center"/>
<EF:EFColumn ename="problemPic" cname="问题照片" width="90" enable="false" align="center"/>
<EF:EFColumn ename="processPic" cname="处理照片" width="90" enable="false" align="center"/>
<EF:EFColumn ename="processSugges" cname="处理意见" width="130" align="center"/>
<EF:EFColumn ename="rectificatSugges" cname="整改措施" width="130" align="center"/>
<EF:EFComboColumn ename="handleStatus" cname="处理状态" width="80" align="center" enable="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