Commit ec0ff7a6 by wuwenlong

报工

parent c958f4d3
......@@ -71,6 +71,8 @@ public class HGConstant {
public static final String HGSC006_ORDER_CODE = "HGSC006_ORDER_CODE";
//生产任务
public static final String HGSC007_TASK_CODE = "HGSC007_TASK_CODE";
//生产报工
public static final String HGSC008_WORK_CODE = "HGSC008_WORK_CODE";
//生产任务订单
public static final String PROD_TASK_NO = "PROD_TASK_NO";
//售后维修单号
......
......@@ -38,7 +38,7 @@ public class HGSC008 extends DaoEPBase {
public static final String FIELD_dep_name = "depName"; /* 部门名称*/
public static final String FIELD_proj_code = "projCode"; /* 项目编码*/
public static final String FIELD_proj_name = "projName"; /* 项目名称*/
public static final String FIELD_task_code = "taskCode"; /* 任务编码*/
public static final String FIELD_work_code = "workCode"; /* 报工编码*/
public static final String FIELD_product_type = "productType"; /* 产品类型*/
public static final String FIELD_product_code = "productCode"; /* 产品编号*/
public static final String FIELD_product_name = "productName"; /* 产品名称*/
......@@ -82,7 +82,7 @@ public class HGSC008 extends DaoEPBase {
public static final String COL_dep_name = "dep_name"; /* 部门名称*/
public static final String COL_proj_code = "proj_code"; /* 项目编码*/
public static final String COL_proj_name = "proj_name"; /* 项目名称*/
public static final String COL_task_code = "task_code"; /* 任务编码*/
public static final String COL_work_code = "work_code"; /* 报工编码*/
public static final String COL_product_type = "product_type"; /* 产品类型*/
public static final String COL_product_code = "product_code"; /* 产品编号*/
public static final String COL_product_name = "product_name"; /* 产品名称*/
......@@ -125,7 +125,7 @@ public class HGSC008 extends DaoEPBase {
private String depName = " "; /* 部门名称*/
private String projCode = " "; /* 项目编码*/
private String projName = " "; /* 项目名称*/
private String taskCode = " "; /* 任务编码*/
private String workCode = " "; /* 报工编码*/
private Integer productType = new Integer(0); /* 产品类型*/
private String productCode = " "; /* 产品编号*/
private String productName = " "; /* 产品名称*/
......@@ -271,8 +271,8 @@ public class HGSC008 extends DaoEPBase {
eiColumn.setDescName("项目名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_task_code);
eiColumn.setDescName("任务编码");
eiColumn = new EiColumn(FIELD_work_code);
eiColumn.setDescName("报工编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_product_type);
......@@ -649,20 +649,20 @@ public class HGSC008 extends DaoEPBase {
this.projName = projName;
}
/**
* get the taskCode - 任务编码.
* @return the taskCode
* get the workCode - 报工编码.
* @return the workCode
*/
public String getTaskCode() {
return this.taskCode;
public String getWorkCode() {
return this.workCode;
}
/**
* set the taskCode - 任务编码.
* set the workCode - 报工编码.
*
* @param taskCode - 任务编码
* @param workCode - 报工编码
*/
public void setTaskCode(String taskCode) {
this.taskCode = taskCode;
public void setWorkCode(String workCode) {
this.workCode = workCode;
}
/**
* get the productType - 产品类型.
......@@ -1007,7 +1007,7 @@ public class HGSC008 extends DaoEPBase {
setDepName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_dep_name)), depName));
setProjCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_proj_code)), projCode));
setProjName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_proj_name)), projName));
setTaskCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_task_code)), taskCode));
setWorkCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_work_code)), workCode));
setProductType(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_product_type)), productType));
setProductCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_product_code)), productCode));
setProductName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_product_name)), productName));
......@@ -1059,7 +1059,7 @@ public class HGSC008 extends DaoEPBase {
map.put(FIELD_dep_name, StringUtils.toString(depName, eiMetadata.getMeta(FIELD_dep_name)));
map.put(FIELD_proj_code, StringUtils.toString(projCode, eiMetadata.getMeta(FIELD_proj_code)));
map.put(FIELD_proj_name, StringUtils.toString(projName, eiMetadata.getMeta(FIELD_proj_name)));
map.put(FIELD_task_code, StringUtils.toString(taskCode, eiMetadata.getMeta(FIELD_task_code)));
map.put(FIELD_work_code, StringUtils.toString(workCode, eiMetadata.getMeta(FIELD_work_code)));
map.put(FIELD_product_type, StringUtils.toString(productType, eiMetadata.getMeta(FIELD_product_type)));
map.put(FIELD_product_code, StringUtils.toString(productCode, eiMetadata.getMeta(FIELD_product_code)));
map.put(FIELD_product_name, StringUtils.toString(productName, eiMetadata.getMeta(FIELD_product_name)));
......
......@@ -115,7 +115,6 @@ public class ServiceHGSC006A extends ServiceBase {
hgsc007.setDepCode(null);
hgsc007.setDepName(null);
hgsc007.setId(null);
HGSC006A a = new HGSC006A();
}
}
......@@ -2,9 +2,13 @@ package com.baosight.hggp.hg.sc.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.sc.domain.HGSC006A;
import com.baosight.hggp.hg.sc.domain.HGSC007;
import com.baosight.hggp.hg.sc.domain.HGSC008;
import com.baosight.hggp.hg.sc.tools.HGSCTools;
import com.baosight.hggp.hg.zl.tools.HGZLTools;
import com.baosight.hggp.util.*;
import com.baosight.hggp.util.contants.ACConstants;
import com.baosight.iplat4j.core.ei.EiBlock;
......@@ -12,6 +16,8 @@ import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import com.baosight.iplat4j.core.util.NumberUtils;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import org.springframework.beans.BeanUtils;
import java.math.BigDecimal;
......@@ -24,7 +30,7 @@ import java.util.*;
*/
public class ServiceHGSC007A extends ServiceEPBase {
@OperationLogAnnotation(operModul = "生产任务", operType = "查询", operDesc = "初始化页面")
@OperationLogAnnotation(operModul = "生产报工", operType = "报工", operDesc = "初始化页面")
public EiInfo initLoad(EiInfo inInfo) {
try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
......@@ -52,6 +58,18 @@ public class ServiceHGSC007A extends ServiceEPBase {
return inInfo;
}
@OperationLogAnnotation(operModul = "生产报工", operType = "报工", operDesc = "保存")
public EiInfo save(EiInfo inInfo) {
try{
HGSC008 hgsc008 = HGSCTools.THGSC008.add(inInfo);
HGZLTools.THGZL002.add(hgsc008);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
}
......
......@@ -19,7 +19,7 @@
dep_name VARCHAR,
proj_code VARCHAR,
proj_name VARCHAR,
task_code VARCHAR,
work_code VARCHAR,
product_type TINYINT,
product_code VARCHAR,
product_name VARCHAR,
......@@ -89,8 +89,8 @@
<isNotEmpty prepend=" AND " property="projName">
proj_name = #projName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="taskCode">
task_code = #taskCode#
<isNotEmpty prepend=" AND " property="workCode">
work_code = #workCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="productType">
product_type = #productType#
......@@ -172,7 +172,7 @@
dep_name as "depName", <!-- 部门名称 -->
proj_code as "projCode", <!-- 项目编码 -->
proj_name as "projName", <!-- 项目名称 -->
task_code as "taskCode", <!-- 任务编码 -->
work_code as "workCode", <!-- 报工编码 -->
product_type as "productType", <!-- 产品类型 -->
product_code as "productCode", <!-- 产品编号 -->
product_name as "productName", <!-- 产品名称 -->
......@@ -257,8 +257,8 @@
<isNotEmpty prepend=" AND " property="projName">
proj_name = #projName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="taskCode">
task_code = #taskCode#
<isNotEmpty prepend=" AND " property="workCode">
work_code = #workCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="productType">
product_type = #productType#
......@@ -338,7 +338,7 @@
dep_name, <!-- 部门名称 -->
proj_code, <!-- 项目编码 -->
proj_name, <!-- 项目名称 -->
task_code, <!-- 任务编码 -->
work_code, <!-- 报工编码 -->
product_type, <!-- 产品类型 -->
product_code, <!-- 产品编号 -->
product_name, <!-- 产品名称 -->
......@@ -360,7 +360,10 @@
updated_name, <!-- 修改人名称 -->
updated_time <!-- 更新时间 -->
)
VALUES (#id#, #matId#, #taskId#, #techFlowId#, #techFlowName#, #inventProcessId#, #processCode#, #processName#, #processOrder#, #companyCode#, #companyName#, #depCode#, #depName#, #projCode#, #projName#, #taskCode#, #productType#, #productCode#, #productName#, #planStartDate#, #planEndDate#, #factoryCode#, #factoryName#, #groupCode#, #groupName#, #registerDate#, #quantity#, #singleWeight#, #totalWeight#, #accountCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#)
VALUES (#id#, #matId#, #taskId#, #techFlowId#, #techFlowName#, #inventProcessId#, #processCode#, #processName#, #processOrder#, #companyCode#, #companyName#, #depCode#, #depName#, #projCode#, #projName#, #workCode#, #productType#, #productCode#, #productName#, #planStartDate#, #planEndDate#, #factoryCode#, #factoryName#, #groupCode#, #groupName#, #registerDate#, #quantity#, #singleWeight#, #totalWeight#, #accountCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#)
<selectKey resultClass="long" keyProperty="id">
SELECT MAX(ID) AS "id" FROM ${hggpSchema}.HGSC008
</selectKey>
</insert>
<delete id="delete">
......@@ -385,7 +388,7 @@
dep_name = #depName#, <!-- 部门名称 -->
proj_code = #projCode#, <!-- 项目编码 -->
proj_name = #projName#, <!-- 项目名称 -->
task_code = #taskCode#, <!-- 任务编码 -->
work_code = #workCode#, <!-- 报工编码 -->
product_type = #productType#, <!-- 产品类型 -->
product_code = #productCode#, <!-- 产品编号 -->
product_name = #productName#, <!-- 产品名称 -->
......
......@@ -16,10 +16,15 @@ import com.baosight.hggp.hg.pz.tools.HGPZTools;
import com.baosight.hggp.hg.sc.domain.*;
import com.baosight.hggp.hg.sj.domain.HGSJ001;
import com.baosight.hggp.hg.sj.tools.HGSJTools;
import com.baosight.hggp.hg.xs.domain.Org;
import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.BeanUtils;
import com.baosight.hggp.util.DateUtil;
import com.baosight.hggp.util.EiInfoUtils;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.util.NumberUtils;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.collections.MapUtils;
......@@ -747,6 +752,40 @@ public class HGSCTools {
List<HGSC008> results = DaoBase.getInstance().query(HGSC008.QUERY, new HashMap<String,Object>(){{put(HGSC008.FIELD_task_id, taskId);}});
return CollectionUtils.isEmpty(results) ? null : results;
}
public static HGSC008 add(EiInfo info){
Map resultMap = EiInfoUtils.getFirstRow(info, EiConstant.resultBlock);
String taskId = com.baosight.hggp.util.MapUtils.getString(resultMap, HGSC008.FIELD_task_id);
HGSC007 hgsc007 = HGSCTools.THGSC007.getById(Long.valueOf(taskId));
HGSC008 hgsc008 = new HGSC008();
BeanUtils.copyProperties(hgsc007,hgsc008);
cleanBaseInfo(hgsc008);
hgsc008.setQuantity(NumberUtils.toInteger(resultMap.get(HGSC008.FIELD_quantity)));
hgsc008.setTotalWeight(hgsc007.getSingleWeight().multiply(new BigDecimal(hgsc008.getQuantity())));
checkAddDate(hgsc008);
hgsc008.setWorkCode(SequenceGenerator.getNextSequence(HGConstant.SequenceId.HGSC008_WORK_CODE));
DaoUtils.insert(HGSC008.INSERT,hgsc008);
return hgsc008;
}
private static void checkAddDate(HGSC008 hgsc008){
List<String> orgIdList = UserSessionUtils.getOrgId();
AssertUtils.isEmpty(hgsc008.getGroupCode(),"生产任务班组信息异常,请联系管理员!");
AssertUtils.isTrue(!orgIdList.contains(hgsc008.getGroupCode()),"非当前任务生产组用户,无法报工此任务!");
AssertUtils.isNull(hgsc008.getQuantity(),"报工数量不能为空!");
}
private static void cleanBaseInfo(HGSC008 hgsc008){
hgsc008.setCreatedBy(null);
hgsc008.setCreatedName(null);
hgsc008.setCreatedTime(null);
hgsc008.setUpdatedBy(null);
hgsc008.setUpdatedName(null);
hgsc008.setUpdatedTime(null);
hgsc008.setDepCode(null);
hgsc008.setDepName(null);
hgsc008.setId(null);
}
}
......
package com.baosight.hggp.hg.zl.tools;
import com.baosight.hggp.common.CheckStatusEnum;
import com.baosight.hggp.core.dao.DaoBase;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.constant.HGSqlConstant;
import com.baosight.hggp.hg.sc.domain.HGSC008;
import com.baosight.hggp.hg.zl.domain.HGZL001;
import com.baosight.hggp.hg.zl.domain.HGZL002;
import com.baosight.hggp.util.AssertUtils;
import com.baosight.iplat4j.core.util.NumberUtils;
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;
import java.util.List;
import java.util.Map;
......@@ -73,4 +82,33 @@ public class HGZLTools {
return results.stream().collect(Collectors.toMap(HGZL001::getCheckNo, item -> item));
}
}
public static class THGZL002 {
public static HGZL002 add(HGSC008 hgsc008){
HGZL002 hgzl002 = new HGZL002();
BeanUtils.copyProperties(hgsc008,hgzl002);
cleanBaseInfo(hgzl002);
hgzl002.setCheckStatus(CheckStatusEnum.CHECKING.getCode());
hgzl002.setWorkId(hgsc008.getId());
hgzl002.setWorkCode(hgsc008.getWorkCode());
hgzl002.setWorkBy(hgsc008.getCreatedBy());
hgzl002.setWorkName(hgsc008.getCreatedName());
DaoUtils.insert(HGZL002.INSERT,hgzl002);
return hgzl002;
}
private static void cleanBaseInfo(HGZL002 hgzl002){
hgzl002.setCreatedBy(null);
hgzl002.setCreatedName(null);
hgzl002.setCreatedTime(null);
hgzl002.setUpdatedBy(null);
hgzl002.setUpdatedName(null);
hgzl002.setUpdatedTime(null);
hgzl002.setDepCode(null);
hgzl002.setDepName(null);
hgzl002.setId(null);
}
}
}
\ No newline at end of file
......@@ -15,10 +15,8 @@ $(function () {
field: "operator",
template: function (item) {
let template = '';
if(item.unfinishQuantity>0){
template+='<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="registerWork(' + item.id + ')" >报工</a>';
}
template+='<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="showUploadFile(' + item.matId + ')" >附件清单</a>';
return template;
......
......@@ -37,7 +37,7 @@ $(function () {
}
JSUtils.confirm("确定对数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGrid("detail", "HGSC001", "save", {isAlldata:true,onSuccessCallback:parent.windowCallback});
JSUtils.submitGrid("result", "HGSC007A", "save", {isAlldata:true,onSuccessCallback:parent.registerWorkCallback});
}
});
});
......
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