Commit 571a9ee9 by wuwenlong

排产新增按重量计算工时;报工dev

parent 5a8c0799
...@@ -13,7 +13,8 @@ import java.util.Map; ...@@ -13,7 +13,8 @@ import java.util.Map;
*/ */
public enum ComputeTypeEnum { public enum ComputeTypeEnum {
CD(1,"长度"), CD(1,"长度"),
SL(2,"数量"); SL(2,"数量"),
ZL(3,"重量");
private Integer code; private Integer code;
......
package com.baosight.hggp.hg.sc.domain;
import com.baosight.iplat4j.core.util.NumberUtils;
import java.math.BigDecimal;
import com.baosight.iplat4j.core.ei.EiColumn;
import com.baosight.iplat4j.core.data.DaoEPBase;
import java.util.HashMap;
import java.util.Map;
import com.baosight.iplat4j.core.util.StringUtils;
/**
* Project: <br>
* Title:HGSC008.java <br>
* Description: <br>
*
* Copyrigth:Baosight Software LTD.co Copyright (c) 2019. <br>
*
* @version 1.0
* @history 2024-05-28 16:11:25 create
*/
public class HGSC008 extends DaoEPBase {
private static final long serialVersionUID = 1L;
public static final String FIELD_id = "id";
public static final String FIELD_mat_id = "matId"; /* 物料清单ID*/
public static final String FIELD_task_id = "taskId"; /* 生产任务ID*/
public static final String FIELD_tech_flow_id = "techFlowId"; /* 工艺流程ID*/
public static final String FIELD_tech_flow_name = "techFlowName"; /* 工艺流程名称*/
public static final String FIELD_invent_process_id = "inventProcessId"; /* 存货工序ID,对应HGPZ005A.id*/
public static final String FIELD_process_code = "processCode"; /* 工序编码*/
public static final String FIELD_process_name = "processName"; /* 工序名称*/
public static final String FIELD_process_order = "processOrder"; /* 加工顺序*/
public static final String FIELD_company_code = "companyCode"; /* 公司编码*/
public static final String FIELD_company_name = "companyName"; /* 公司名称*/
public static final String FIELD_dep_code = "depCode"; /* 部门编码*/
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_product_type = "productType"; /* 产品类型*/
public static final String FIELD_product_code = "productCode"; /* 产品编号*/
public static final String FIELD_product_name = "productName"; /* 产品名称*/
public static final String FIELD_plan_start_date = "planStartDate"; /* 计划开始日期*/
public static final String FIELD_plan_end_date = "planEndDate"; /* 计划结束日期*/
public static final String FIELD_factory_code = "factoryCode"; /* 工厂编号*/
public static final String FIELD_factory_name = "factoryName"; /* 工厂名称*/
public static final String FIELD_group_code = "groupCode"; /* 工作组编号*/
public static final String FIELD_group_name = "groupName"; /* 工作组名称*/
public static final String FIELD_register_date = "registerDate"; /* 报工日期*/
public static final String FIELD_quantity = "quantity"; /* 数量*/
public static final String FIELD_single_weight = "singleWeight"; /* 单重*/
public static final String FIELD_total_weight = "totalWeight"; /* 总重*/
public static final String FIELD_account_code = "accountCode"; /* 帐套*/
public static final String FIELD_created_by = "createdBy"; /* 创建人*/
public static final String FIELD_created_name = "createdName"; /* 创建人名称*/
public static final String FIELD_created_time = "createdTime"; /* 创建时间*/
public static final String FIELD_updated_by = "updatedBy"; /* 更新人*/
public static final String FIELD_updated_name = "updatedName"; /* 修改人名称*/
public static final String FIELD_updated_time = "updatedTime"; /* 更新时间*/
//补充字段
public static final String FIELD_registered_quantity = "registeredQuantity";
public static final String FIELD_registered_weight = "registeredWeight";
public static final String FIELD_unregister_quantity = "unregisterQuantity";
public static final String FIELD_unregister_weight = "unregisterWeight";
public static final String FIELD_task_quantity = "taskQuantity";
public static final String FIELD_task_weight = "taskWeight";
public static final String COL_id = "id";
public static final String COL_mat_id = "mat_id"; /* 物料清单ID*/
public static final String COL_task_id = "task_id"; /* 生产任务ID*/
public static final String COL_tech_flow_id = "tech_flow_id"; /* 工艺流程ID*/
public static final String COL_tech_flow_name = "tech_flow_name"; /* 工艺流程名称*/
public static final String COL_invent_process_id = "invent_process_id"; /* 存货工序ID,对应HGPZ005A.id*/
public static final String COL_process_code = "process_code"; /* 工序编码*/
public static final String COL_process_name = "process_name"; /* 工序名称*/
public static final String COL_process_order = "process_order"; /* 加工顺序*/
public static final String COL_company_code = "company_code"; /* 公司编码*/
public static final String COL_company_name = "company_name"; /* 公司名称*/
public static final String COL_dep_code = "dep_code"; /* 部门编码*/
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_product_type = "product_type"; /* 产品类型*/
public static final String COL_product_code = "product_code"; /* 产品编号*/
public static final String COL_product_name = "product_name"; /* 产品名称*/
public static final String COL_plan_start_date = "plan_start_date"; /* 计划开始日期*/
public static final String COL_plan_end_date = "plan_end_date"; /* 计划结束日期*/
public static final String COL_factory_code = "factory_code"; /* 工厂编号*/
public static final String COL_factory_name = "factory_name"; /* 工厂名称*/
public static final String COL_group_code = "group_code"; /* 工作组编号*/
public static final String COL_group_name = "group_name"; /* 工作组名称*/
public static final String COL_register_date = "register_date"; /* 报工日期*/
public static final String COL_quantity = "quantity"; /* 数量*/
public static final String COL_single_weight = "single_weight"; /* 单重*/
public static final String COL_total_weight = "total_weight"; /* 总重*/
public static final String COL_account_code = "account_code"; /* 帐套*/
public static final String COL_created_by = "created_by"; /* 创建人*/
public static final String COL_created_name = "created_name"; /* 创建人名称*/
public static final String COL_created_time = "created_time"; /* 创建时间*/
public static final String COL_updated_by = "updated_by"; /* 更新人*/
public static final String COL_updated_name = "updated_name"; /* 修改人名称*/
public static final String COL_updated_time = "updated_time"; /* 更新时间*/
public static final String QUERY = "HGSC008.query";
public static final String COUNT = "HGSC008.count";
public static final String INSERT = "HGSC008.insert";
public static final String UPDATE = "HGSC008.update";
public static final String DELETE = "HGSC008.delete";
private Long id = new Long(0);
private Long matId = new Long(0); /* 物料清单ID*/
private Long taskId = new Long(0); /* 生产任务ID*/
private Long techFlowId = new Long(0); /* 工艺流程ID*/
private Long techFlowName = new Long(0); /* 工艺流程名称*/
private Long inventProcessId = new Long(0); /* 存货工序ID,对应HGPZ005A.id*/
private String processCode = " "; /* 工序编码*/
private String processName = " "; /* 工序名称*/
private Long processOrder = new Long(0); /* 加工顺序*/
private String companyCode = " "; /* 公司编码*/
private String companyName = " "; /* 公司名称*/
private String depCode = " "; /* 部门编码*/
private String depName = " "; /* 部门名称*/
private String projCode = " "; /* 项目编码*/
private String projName = " "; /* 项目名称*/
private String taskCode = " "; /* 任务编码*/
private Integer productType = new Integer(0); /* 产品类型*/
private String productCode = " "; /* 产品编号*/
private String productName = " "; /* 产品名称*/
private String planStartDate = " "; /* 计划开始日期*/
private String planEndDate = " "; /* 计划结束日期*/
private String factoryCode = " "; /* 工厂编号*/
private String factoryName = " "; /* 工厂名称*/
private String groupCode = " "; /* 工作组编号*/
private String groupName = " "; /* 工作组名称*/
private String registerDate = " "; /* 报工日期*/
private Integer quantity = new Integer(0); /* 数量*/
private BigDecimal singleWeight = new BigDecimal("0"); /* 单重*/
private BigDecimal totalWeight = new BigDecimal("0"); /* 总重*/
private String accountCode = " "; /* 帐套*/
private String createdBy = " "; /* 创建人*/
private String createdName = " "; /* 创建人名称*/
private String createdTime = " "; /* 创建时间*/
private String updatedBy = " "; /* 更新人*/
private String updatedName = " "; /* 修改人名称*/
private String updatedTime = " "; /* 更新时间*/
//补充字段
private Integer registeredQuantity = new Integer(0);
private BigDecimal registeredWeight = new BigDecimal(0);
private Integer unregisterQuantity = new Integer(0);
private BigDecimal unregisterWeight = new BigDecimal(0);
private Integer taskQuantity = new Integer(0);
private BigDecimal taskWeight = new BigDecimal(0);
public Integer getRegisteredQuantity() {
return registeredQuantity;
}
public void setRegisteredQuantity(Integer registeredQuantity) {
this.registeredQuantity = registeredQuantity;
}
public BigDecimal getRegisteredWeight() {
return registeredWeight;
}
public void setRegisteredWeight(BigDecimal registeredWeight) {
this.registeredWeight = registeredWeight;
}
public Integer getUnregisterQuantity() {
return unregisterQuantity;
}
public void setUnregisterQuantity(Integer unregisterQuantity) {
this.unregisterQuantity = unregisterQuantity;
}
public BigDecimal getUnregisterWeight() {
return unregisterWeight;
}
public void setUnregisterWeight(BigDecimal unregisterWeight) {
this.unregisterWeight = unregisterWeight;
}
public Integer getTaskQuantity() {
return taskQuantity;
}
public void setTaskQuantity(Integer taskQuantity) {
this.taskQuantity = taskQuantity;
}
public BigDecimal getTaskWeight() {
return taskWeight;
}
public void setTaskWeight(BigDecimal taskWeight) {
this.taskWeight = taskWeight;
}
/**
* initialize the metadata.
*/
public void initMetaData() {
EiColumn eiColumn;
eiColumn = new EiColumn(FIELD_id);
eiColumn.setPrimaryKey(true);
eiColumn.setDescName(" ");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_mat_id);
eiColumn.setDescName("物料清单ID");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_task_id);
eiColumn.setDescName("生产任务ID");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_tech_flow_id);
eiColumn.setDescName("工艺流程ID");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_tech_flow_name);
eiColumn.setDescName("工艺流程名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_invent_process_id);
eiColumn.setDescName("存货工序ID,对应HGPZ005A.id");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_process_code);
eiColumn.setDescName("工序编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_process_name);
eiColumn.setDescName("工序名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_process_order);
eiColumn.setDescName("加工顺序");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_company_code);
eiColumn.setDescName("公司编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_company_name);
eiColumn.setDescName("公司名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_dep_code);
eiColumn.setDescName("部门编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_dep_name);
eiColumn.setDescName("部门名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_proj_code);
eiColumn.setDescName("项目编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_proj_name);
eiColumn.setDescName("项目名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_task_code);
eiColumn.setDescName("任务编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_product_type);
eiColumn.setDescName("产品类型");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_product_code);
eiColumn.setDescName("产品编号");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_product_name);
eiColumn.setDescName("产品名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_plan_start_date);
eiColumn.setDescName("计划开始日期");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_plan_end_date);
eiColumn.setDescName("计划结束日期");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_factory_code);
eiColumn.setDescName("工厂编号");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_factory_name);
eiColumn.setDescName("工厂名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_group_code);
eiColumn.setDescName("工作组编号");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_group_name);
eiColumn.setDescName("工作组名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_register_date);
eiColumn.setDescName("报工日期");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_quantity);
eiColumn.setDescName("数量");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_single_weight);
eiColumn.setType("N");
eiColumn.setScaleLength(3);
eiColumn.setFieldLength(20);
eiColumn.setDescName("单重");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_total_weight);
eiColumn.setType("N");
eiColumn.setScaleLength(3);
eiColumn.setFieldLength(20);
eiColumn.setDescName("总重");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_account_code);
eiColumn.setDescName("帐套");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_created_by);
eiColumn.setDescName("创建人");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_created_name);
eiColumn.setDescName("创建人名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_created_time);
eiColumn.setDescName("创建时间");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_updated_by);
eiColumn.setDescName("更新人");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_updated_name);
eiColumn.setDescName("修改人名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_updated_time);
eiColumn.setDescName("更新时间");
eiMetadata.addMeta(eiColumn);
// eiColumn = new EiColumn("registeredQuantity");
// eiColumn.setDescName("已报工数量");
// eiMetadata.addMeta(eiColumn);
//
// eiColumn = new EiColumn("registeredWeight");
// eiColumn.setDescName("已报工重量");
// eiMetadata.addMeta(eiColumn);
//
// eiColumn = new EiColumn("unregisterQuantity");
// eiColumn.setDescName("未报工数量");
// eiMetadata.addMeta(eiColumn);
//
// eiColumn = new EiColumn("unregisterWeight");
// eiColumn.setDescName("未报工重量");
// eiMetadata.addMeta(eiColumn);
// private Integer registeredQuantity = new Integer(0);
// private BigDecimal registeredWeight = new BigDecimal(0);
// private Integer unregisterQuantity = new Integer(0);
// private BigDecimal unregisterWeight = new BigDecimal(0);
}
/**
* the constructor.
*/
public HGSC008() {
initMetaData();
}
/**
* get the id .
* @return the id
*/
public Long getId() {
return this.id;
}
/**
* set the id .
*
* @param id
*/
public void setId(Long id) {
this.id = id;
}
/**
* get the matId - 物料清单ID.
* @return the matId
*/
public Long getMatId() {
return this.matId;
}
/**
* set the matId - 物料清单ID.
*
* @param matId - 物料清单ID
*/
public void setMatId(Long matId) {
this.matId = matId;
}
/**
* get the taskId - 生产任务ID.
* @return the taskId
*/
public Long getTaskId() {
return this.taskId;
}
/**
* set the taskId - 生产任务ID.
*
* @param taskId - 生产任务ID
*/
public void setTaskId(Long taskId) {
this.taskId = taskId;
}
/**
* get the techFlowId - 工艺流程ID.
* @return the techFlowId
*/
public Long getTechFlowId() {
return this.techFlowId;
}
/**
* set the techFlowId - 工艺流程ID.
*
* @param techFlowId - 工艺流程ID
*/
public void setTechFlowId(Long techFlowId) {
this.techFlowId = techFlowId;
}
/**
* get the techFlowName - 工艺流程名称.
* @return the techFlowName
*/
public Long getTechFlowName() {
return this.techFlowName;
}
/**
* set the techFlowName - 工艺流程名称.
*
* @param techFlowName - 工艺流程名称
*/
public void setTechFlowName(Long techFlowName) {
this.techFlowName = techFlowName;
}
/**
* get the inventProcessId - 存货工序ID,对应HGPZ005A.id.
* @return the inventProcessId
*/
public Long getInventProcessId() {
return this.inventProcessId;
}
/**
* set the inventProcessId - 存货工序ID,对应HGPZ005A.id.
*
* @param inventProcessId - 存货工序ID,对应HGPZ005A.id
*/
public void setInventProcessId(Long inventProcessId) {
this.inventProcessId = inventProcessId;
}
/**
* get the processCode - 工序编码.
* @return the processCode
*/
public String getProcessCode() {
return this.processCode;
}
/**
* set the processCode - 工序编码.
*
* @param processCode - 工序编码
*/
public void setProcessCode(String processCode) {
this.processCode = processCode;
}
/**
* get the processName - 工序名称.
* @return the processName
*/
public String getProcessName() {
return this.processName;
}
/**
* set the processName - 工序名称.
*
* @param processName - 工序名称
*/
public void setProcessName(String processName) {
this.processName = processName;
}
/**
* get the processOrder - 加工顺序.
* @return the processOrder
*/
public Long getProcessOrder() {
return this.processOrder;
}
/**
* set the processOrder - 加工顺序.
*
* @param processOrder - 加工顺序
*/
public void setProcessOrder(Long processOrder) {
this.processOrder = processOrder;
}
/**
* get the companyCode - 公司编码.
* @return the companyCode
*/
public String getCompanyCode() {
return this.companyCode;
}
/**
* set the companyCode - 公司编码.
*
* @param companyCode - 公司编码
*/
public void setCompanyCode(String companyCode) {
this.companyCode = companyCode;
}
/**
* get the companyName - 公司名称.
* @return the companyName
*/
public String getCompanyName() {
return this.companyName;
}
/**
* set the companyName - 公司名称.
*
* @param companyName - 公司名称
*/
public void setCompanyName(String companyName) {
this.companyName = companyName;
}
/**
* get the depCode - 部门编码.
* @return the depCode
*/
public String getDepCode() {
return this.depCode;
}
/**
* set the depCode - 部门编码.
*
* @param depCode - 部门编码
*/
public void setDepCode(String depCode) {
this.depCode = depCode;
}
/**
* get the depName - 部门名称.
* @return the depName
*/
public String getDepName() {
return this.depName;
}
/**
* set the depName - 部门名称.
*
* @param depName - 部门名称
*/
public void setDepName(String depName) {
this.depName = depName;
}
/**
* get the projCode - 项目编码.
* @return the projCode
*/
public String getProjCode() {
return this.projCode;
}
/**
* set the projCode - 项目编码.
*
* @param projCode - 项目编码
*/
public void setProjCode(String projCode) {
this.projCode = projCode;
}
/**
* get the projName - 项目名称.
* @return the projName
*/
public String getProjName() {
return this.projName;
}
/**
* set the projName - 项目名称.
*
* @param projName - 项目名称
*/
public void setProjName(String projName) {
this.projName = projName;
}
/**
* get the taskCode - 任务编码.
* @return the taskCode
*/
public String getTaskCode() {
return this.taskCode;
}
/**
* set the taskCode - 任务编码.
*
* @param taskCode - 任务编码
*/
public void setTaskCode(String taskCode) {
this.taskCode = taskCode;
}
/**
* get the productType - 产品类型.
* @return the productType
*/
public Integer getProductType() {
return this.productType;
}
/**
* set the productType - 产品类型.
*
* @param productType - 产品类型
*/
public void setProductType(Integer productType) {
this.productType = productType;
}
/**
* get the productCode - 产品编号.
* @return the productCode
*/
public String getProductCode() {
return this.productCode;
}
/**
* set the productCode - 产品编号.
*
* @param productCode - 产品编号
*/
public void setProductCode(String productCode) {
this.productCode = productCode;
}
/**
* get the productName - 产品名称.
* @return the productName
*/
public String getProductName() {
return this.productName;
}
/**
* set the productName - 产品名称.
*
* @param productName - 产品名称
*/
public void setProductName(String productName) {
this.productName = productName;
}
/**
* get the planStartDate - 计划开始日期.
* @return the planStartDate
*/
public String getPlanStartDate() {
return this.planStartDate;
}
/**
* set the planStartDate - 计划开始日期.
*
* @param planStartDate - 计划开始日期
*/
public void setPlanStartDate(String planStartDate) {
this.planStartDate = planStartDate;
}
/**
* get the planEndDate - 计划结束日期.
* @return the planEndDate
*/
public String getPlanEndDate() {
return this.planEndDate;
}
/**
* set the planEndDate - 计划结束日期.
*
* @param planEndDate - 计划结束日期
*/
public void setPlanEndDate(String planEndDate) {
this.planEndDate = planEndDate;
}
/**
* get the factoryCode - 工厂编号.
* @return the factoryCode
*/
public String getFactoryCode() {
return this.factoryCode;
}
/**
* set the factoryCode - 工厂编号.
*
* @param factoryCode - 工厂编号
*/
public void setFactoryCode(String factoryCode) {
this.factoryCode = factoryCode;
}
/**
* get the factoryName - 工厂名称.
* @return the factoryName
*/
public String getFactoryName() {
return this.factoryName;
}
/**
* set the factoryName - 工厂名称.
*
* @param factoryName - 工厂名称
*/
public void setFactoryName(String factoryName) {
this.factoryName = factoryName;
}
/**
* get the groupCode - 工作组编号.
* @return the groupCode
*/
public String getGroupCode() {
return this.groupCode;
}
/**
* set the groupCode - 工作组编号.
*
* @param groupCode - 工作组编号
*/
public void setGroupCode(String groupCode) {
this.groupCode = groupCode;
}
/**
* get the groupName - 工作组名称.
* @return the groupName
*/
public String getGroupName() {
return this.groupName;
}
/**
* set the groupName - 工作组名称.
*
* @param groupName - 工作组名称
*/
public void setGroupName(String groupName) {
this.groupName = groupName;
}
/**
* get the registerDate - 报工日期.
* @return the registerDate
*/
public String getRegisterDate() {
return this.registerDate;
}
/**
* set the registerDate - 报工日期.
*
* @param registerDate - 报工日期
*/
public void setRegisterDate(String registerDate) {
this.registerDate = registerDate;
}
/**
* get the quantity - 数量.
* @return the quantity
*/
public Integer getQuantity() {
return this.quantity;
}
/**
* set the quantity - 数量.
*
* @param quantity - 数量
*/
public void setQuantity(Integer quantity) {
this.quantity = quantity;
}
/**
* get the singleWeight - 单重.
* @return the singleWeight
*/
public BigDecimal getSingleWeight() {
return this.singleWeight;
}
/**
* set the singleWeight - 单重.
*
* @param singleWeight - 单重
*/
public void setSingleWeight(BigDecimal singleWeight) {
this.singleWeight = singleWeight;
}
/**
* get the totalWeight - 总重.
* @return the totalWeight
*/
public BigDecimal getTotalWeight() {
return this.totalWeight;
}
/**
* set the totalWeight - 总重.
*
* @param totalWeight - 总重
*/
public void setTotalWeight(BigDecimal totalWeight) {
this.totalWeight = totalWeight;
}
/**
* get the accountCode - 帐套.
* @return the accountCode
*/
public String getAccountCode() {
return this.accountCode;
}
/**
* set the accountCode - 帐套.
*
* @param accountCode - 帐套
*/
public void setAccountCode(String accountCode) {
this.accountCode = accountCode;
}
/**
* get the createdBy - 创建人.
* @return the createdBy
*/
public String getCreatedBy() {
return this.createdBy;
}
/**
* set the createdBy - 创建人.
*
* @param createdBy - 创建人
*/
public void setCreatedBy(String createdBy) {
this.createdBy = createdBy;
}
/**
* get the createdName - 创建人名称.
* @return the createdName
*/
public String getCreatedName() {
return this.createdName;
}
/**
* set the createdName - 创建人名称.
*
* @param createdName - 创建人名称
*/
public void setCreatedName(String createdName) {
this.createdName = createdName;
}
/**
* get the createdTime - 创建时间.
* @return the createdTime
*/
public String getCreatedTime() {
return this.createdTime;
}
/**
* set the createdTime - 创建时间.
*
* @param createdTime - 创建时间
*/
public void setCreatedTime(String createdTime) {
this.createdTime = createdTime;
}
/**
* get the updatedBy - 更新人.
* @return the updatedBy
*/
public String getUpdatedBy() {
return this.updatedBy;
}
/**
* set the updatedBy - 更新人.
*
* @param updatedBy - 更新人
*/
public void setUpdatedBy(String updatedBy) {
this.updatedBy = updatedBy;
}
/**
* get the updatedName - 修改人名称.
* @return the updatedName
*/
public String getUpdatedName() {
return this.updatedName;
}
/**
* set the updatedName - 修改人名称.
*
* @param updatedName - 修改人名称
*/
public void setUpdatedName(String updatedName) {
this.updatedName = updatedName;
}
/**
* get the updatedTime - 更新时间.
* @return the updatedTime
*/
public String getUpdatedTime() {
return this.updatedTime;
}
/**
* set the updatedTime - 更新时间.
*
* @param updatedTime - 更新时间
*/
public void setUpdatedTime(String updatedTime) {
this.updatedTime = updatedTime;
}
/**
* get the value from Map.
*
* @param map - source data map
*/
@Override
public void fromMap(Map map) {
setId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_id)), id));
setMatId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_mat_id)), matId));
setTaskId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_task_id)), taskId));
setTechFlowId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_tech_flow_id)), techFlowId));
setTechFlowName(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_tech_flow_name)), techFlowName));
setInventProcessId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_invent_process_id)), inventProcessId));
setProcessCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_process_code)), processCode));
setProcessName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_process_name)), processName));
setProcessOrder(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_process_order)), processOrder));
setCompanyCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_company_code)), companyCode));
setCompanyName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_company_name)), companyName));
setDepCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_dep_code)), depCode));
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));
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));
setPlanStartDate(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_plan_start_date)), planStartDate));
setPlanEndDate(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_plan_end_date)), planEndDate));
setFactoryCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_factory_code)), factoryCode));
setFactoryName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_factory_name)), factoryName));
setGroupCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_group_code)), groupCode));
setGroupName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_group_name)), groupName));
setRegisterDate(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_register_date)), registerDate));
setQuantity(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_quantity)), quantity));
setSingleWeight(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_single_weight)), singleWeight));
setTotalWeight(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_total_weight)), totalWeight));
setAccountCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_account_code)), accountCode));
setCreatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_created_by)), createdBy));
setCreatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_created_name)), createdName));
setCreatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_created_time)), createdTime));
setUpdatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_updated_by)), updatedBy));
setUpdatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_updated_name)), updatedName));
setUpdatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_updated_time)), updatedTime));
}
/**
* set the value to Map.
*/
@Override
public Map toMap() {
Map map = new HashMap();
map.put(FIELD_id, StringUtils.toString(id, eiMetadata.getMeta(FIELD_id)));
map.put(FIELD_mat_id, StringUtils.toString(matId, eiMetadata.getMeta(FIELD_mat_id)));
map.put(FIELD_task_id, StringUtils.toString(taskId, eiMetadata.getMeta(FIELD_task_id)));
map.put(FIELD_tech_flow_id, StringUtils.toString(techFlowId, eiMetadata.getMeta(FIELD_tech_flow_id)));
map.put(FIELD_tech_flow_name, StringUtils.toString(techFlowName, eiMetadata.getMeta(FIELD_tech_flow_name)));
map.put(FIELD_invent_process_id, StringUtils.toString(inventProcessId, eiMetadata.getMeta(FIELD_invent_process_id)));
map.put(FIELD_process_code, StringUtils.toString(processCode, eiMetadata.getMeta(FIELD_process_code)));
map.put(FIELD_process_name, StringUtils.toString(processName, eiMetadata.getMeta(FIELD_process_name)));
map.put(FIELD_process_order, StringUtils.toString(processOrder, eiMetadata.getMeta(FIELD_process_order)));
map.put(FIELD_company_code, StringUtils.toString(companyCode, eiMetadata.getMeta(FIELD_company_code)));
map.put(FIELD_company_name, StringUtils.toString(companyName, eiMetadata.getMeta(FIELD_company_name)));
map.put(FIELD_dep_code, StringUtils.toString(depCode, eiMetadata.getMeta(FIELD_dep_code)));
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_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)));
map.put(FIELD_plan_start_date, StringUtils.toString(planStartDate, eiMetadata.getMeta(FIELD_plan_start_date)));
map.put(FIELD_plan_end_date, StringUtils.toString(planEndDate, eiMetadata.getMeta(FIELD_plan_end_date)));
map.put(FIELD_factory_code, StringUtils.toString(factoryCode, eiMetadata.getMeta(FIELD_factory_code)));
map.put(FIELD_factory_name, StringUtils.toString(factoryName, eiMetadata.getMeta(FIELD_factory_name)));
map.put(FIELD_group_code, StringUtils.toString(groupCode, eiMetadata.getMeta(FIELD_group_code)));
map.put(FIELD_group_name, StringUtils.toString(groupName, eiMetadata.getMeta(FIELD_group_name)));
map.put(FIELD_register_date, StringUtils.toString(registerDate, eiMetadata.getMeta(FIELD_register_date)));
map.put(FIELD_quantity, StringUtils.toString(quantity, eiMetadata.getMeta(FIELD_quantity)));
map.put(FIELD_single_weight, StringUtils.toString(singleWeight, eiMetadata.getMeta(FIELD_single_weight)));
map.put(FIELD_total_weight, StringUtils.toString(totalWeight, eiMetadata.getMeta(FIELD_total_weight)));
map.put(FIELD_account_code, StringUtils.toString(accountCode, eiMetadata.getMeta(FIELD_account_code)));
map.put(FIELD_created_by, StringUtils.toString(createdBy, eiMetadata.getMeta(FIELD_created_by)));
map.put(FIELD_created_name, StringUtils.toString(createdName, eiMetadata.getMeta(FIELD_created_name)));
map.put(FIELD_created_time, StringUtils.toString(createdTime, eiMetadata.getMeta(FIELD_created_time)));
map.put(FIELD_updated_by, StringUtils.toString(updatedBy, eiMetadata.getMeta(FIELD_updated_by)));
map.put(FIELD_updated_name, StringUtils.toString(updatedName, eiMetadata.getMeta(FIELD_updated_name)));
map.put(FIELD_updated_time, StringUtils.toString(updatedTime, eiMetadata.getMeta(FIELD_updated_time)));
map.put(FIELD_registered_quantity, StringUtils.toString(FIELD_registered_quantity, eiMetadata.getMeta(FIELD_quantity)));
map.put(FIELD_registered_weight, StringUtils.toString(FIELD_registered_weight, eiMetadata.getMeta(FIELD_single_weight)));
map.put(FIELD_unregister_quantity, StringUtils.toString(FIELD_unregister_quantity, eiMetadata.getMeta(FIELD_quantity)));
map.put(FIELD_unregister_weight, StringUtils.toString(FIELD_unregister_weight, eiMetadata.getMeta(FIELD_single_weight)));
map.put(FIELD_task_quantity, StringUtils.toString(FIELD_task_quantity, eiMetadata.getMeta(FIELD_quantity)));
map.put(FIELD_task_weight, StringUtils.toString(FIELD_task_weight, eiMetadata.getMeta(FIELD_single_weight)));
return map;
}
}
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.hg.sc.domain.HGSC007;
import com.baosight.hggp.hg.sc.domain.HGSC008;
import com.baosight.hggp.hg.sc.tools.HGSCTools;
import com.baosight.hggp.util.*;
import com.baosight.hggp.util.contants.ACConstants;
import com.baosight.iplat4j.core.ei.EiBlock;
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 org.springframework.beans.BeanUtils;
import java.math.BigDecimal;
import java.util.*;
/**
* @author wwl
* @version 1.0 2024/5/24
*/
public class ServiceHGSC007A extends ServiceEPBase {
@OperationLogAnnotation(operModul = "生产任务", operType = "查询", operDesc = "初始化页面")
public EiInfo initLoad(EiInfo inInfo) {
try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
String taskId = MapUtils.getString(queryMap, HGSC008.FIELD_task_id);
HGSC007 hgsc007 = HGSCTools.THGSC007.getById(Long.valueOf(taskId));
HGSC008 hgsc008 = new HGSC008();
BeanUtils.copyProperties(hgsc007,hgsc008);
List<HGSC008> old008List = HGSCTools.THGSC008.getByTaskId(Long.valueOf(taskId));
hgsc008.setTaskQuantity(hgsc007.getQuantity());
hgsc008.setTaskWeight(hgsc007.getTotalWeight());
hgsc008.setRegisteredQuantity(Optional.ofNullable(old008List).orElse(new ArrayList<>()).stream().mapToInt(HGSC008::getQuantity).sum());
hgsc008.setRegisteredWeight(Optional.ofNullable(old008List).orElse(new ArrayList<>()).stream().map(HGSC008::getTotalWeight).reduce(BigDecimal.ZERO, BigDecimal::add));
hgsc008.setUnregisterQuantity(hgsc007.getQuantity() - hgsc008.getRegisteredQuantity());
hgsc008.setUnregisterWeight(hgsc007.getTotalWeight().subtract(hgsc008.getRegisteredWeight()));
hgsc008.setRegisterDate(DateUtil.toDateStr(new Date(),DateUtil.DATE10_PATTERN));
hgsc008.setQuantity(null);
hgsc008.setTotalWeight(null);
inInfo.addBlock(EiConstant.resultBlock).addRow(hgsc008);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
}
<?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-05-28 16:11:25
Version : 1.0
schema : hggp
tableName : HGSC008
id BIGINT NOT NULL primarykey,
mat_id BIGINT NOT NULL,
task_id BIGINT NOT NULL,
tech_flow_id BIGINT,
tech_flow_name BIGINT,
invent_process_id BIGINT,
process_code VARCHAR,
process_name VARCHAR,
process_order BIGINT,
company_code VARCHAR NOT NULL,
company_name VARCHAR NOT NULL,
dep_code VARCHAR,
dep_name VARCHAR,
proj_code VARCHAR,
proj_name VARCHAR,
task_code VARCHAR,
product_type TINYINT,
product_code VARCHAR,
product_name VARCHAR,
plan_start_date VARCHAR,
plan_end_date VARCHAR,
factory_code VARCHAR,
factory_name VARCHAR,
group_code VARCHAR,
group_name VARCHAR,
register_date VARCHAR,
quantity TINYINT,
single_weight DECIMAL,
total_weight DECIMAL,
account_code VARCHAR NOT NULL,
created_by VARCHAR,
created_name VARCHAR,
created_time VARCHAR,
updated_by VARCHAR,
updated_name VARCHAR,
updated_time VARCHAR
-->
<sqlMap namespace="HGSC008">
<sql id="condition">
<isNotEmpty prepend=" AND " property="id">
id = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="matId">
mat_id = #matId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="taskId">
task_id = #taskId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="techFlowId">
tech_flow_id = #techFlowId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="techFlowName">
tech_flow_name = #techFlowName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventProcessId">
invent_process_id = #inventProcessId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="processCode">
process_code = #processCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="processName">
process_name = #processName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="processOrder">
process_order = #processOrder#
</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="taskCode">
task_code = #taskCode#
</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="planStartDate">
plan_start_date = #planStartDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="planEndDate">
plan_end_date = #planEndDate#
</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="registerDate">
register_date = #registerDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="quantity">
quantity = #quantity#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="singleWeight">
single_weight = #singleWeight#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="totalWeight">
total_weight = #totalWeight#
</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>
</sql>
<select id="query" parameterClass="java.util.HashMap"
resultClass="com.baosight.hggp.hg.sc.domain.HGSC008">
SELECT
id as "id",
mat_id as "matId", <!-- 物料清单ID -->
task_id as "taskId", <!-- 生产任务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", <!-- 工序名称 -->
process_order as "processOrder", <!-- 加工顺序 -->
company_code as "companyCode", <!-- 公司编码 -->
company_name as "companyName", <!-- 公司名称 -->
dep_code as "depCode", <!-- 部门编码 -->
dep_name as "depName", <!-- 部门名称 -->
proj_code as "projCode", <!-- 项目编码 -->
proj_name as "projName", <!-- 项目名称 -->
task_code as "taskCode", <!-- 任务编码 -->
product_type as "productType", <!-- 产品类型 -->
product_code as "productCode", <!-- 产品编号 -->
product_name as "productName", <!-- 产品名称 -->
plan_start_date as "planStartDate", <!-- 计划开始日期 -->
plan_end_date as "planEndDate", <!-- 计划结束日期 -->
factory_code as "factoryCode", <!-- 工厂编号 -->
factory_name as "factoryName", <!-- 工厂名称 -->
group_code as "groupCode", <!-- 工作组编号 -->
group_name as "groupName", <!-- 工作组名称 -->
register_date as "registerDate", <!-- 报工日期 -->
quantity as "quantity", <!-- 数量 -->
single_weight as "singleWeight", <!-- 单重 -->
total_weight as "totalWeight", <!-- 总重 -->
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}.HGSC008 WHERE 1=1
<include refid="condition" />
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
id asc
</isEmpty>
</dynamic>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hggpSchema}.HGSC008 WHERE 1=1
<include refid="condition" />
</select>
<!--
<isNotEmpty prepend=" AND " property="id">
id = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="matId">
mat_id = #matId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="taskId">
task_id = #taskId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="techFlowId">
tech_flow_id = #techFlowId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="techFlowName">
tech_flow_name = #techFlowName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventProcessId">
invent_process_id = #inventProcessId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="processCode">
process_code = #processCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="processName">
process_name = #processName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="processOrder">
process_order = #processOrder#
</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="taskCode">
task_code = #taskCode#
</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="planStartDate">
plan_start_date = #planStartDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="planEndDate">
plan_end_date = #planEndDate#
</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="registerDate">
register_date = #registerDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="quantity">
quantity = #quantity#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="singleWeight">
single_weight = #singleWeight#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="totalWeight">
total_weight = #totalWeight#
</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}.HGSC008 (id,
mat_id, <!-- 物料清单ID -->
task_id, <!-- 生产任务ID -->
tech_flow_id, <!-- 工艺流程ID -->
tech_flow_name, <!-- 工艺流程名称 -->
invent_process_id, <!-- 存货工序ID,对应HGPZ005A.id -->
process_code, <!-- 工序编码 -->
process_name, <!-- 工序名称 -->
process_order, <!-- 加工顺序 -->
company_code, <!-- 公司编码 -->
company_name, <!-- 公司名称 -->
dep_code, <!-- 部门编码 -->
dep_name, <!-- 部门名称 -->
proj_code, <!-- 项目编码 -->
proj_name, <!-- 项目名称 -->
task_code, <!-- 任务编码 -->
product_type, <!-- 产品类型 -->
product_code, <!-- 产品编号 -->
product_name, <!-- 产品名称 -->
plan_start_date, <!-- 计划开始日期 -->
plan_end_date, <!-- 计划结束日期 -->
factory_code, <!-- 工厂编号 -->
factory_name, <!-- 工厂名称 -->
group_code, <!-- 工作组编号 -->
group_name, <!-- 工作组名称 -->
register_date, <!-- 报工日期 -->
quantity, <!-- 数量 -->
single_weight, <!-- 单重 -->
total_weight, <!-- 总重 -->
account_code, <!-- 帐套 -->
created_by, <!-- 创建人 -->
created_name, <!-- 创建人名称 -->
created_time, <!-- 创建时间 -->
updated_by, <!-- 更新人 -->
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#)
</insert>
<delete id="delete">
DELETE FROM ${hggpSchema}.HGSC008 WHERE
id = #id#
</delete>
<update id="update">
UPDATE ${hggpSchema}.HGSC008
SET
mat_id = #matId#, <!-- 物料清单ID -->
task_id = #taskId#, <!-- 生产任务ID -->
tech_flow_id = #techFlowId#, <!-- 工艺流程ID -->
tech_flow_name = #techFlowName#, <!-- 工艺流程名称 -->
invent_process_id = #inventProcessId#, <!-- 存货工序ID,对应HGPZ005A.id -->
process_code = #processCode#, <!-- 工序编码 -->
process_name = #processName#, <!-- 工序名称 -->
process_order = #processOrder#, <!-- 加工顺序 -->
company_code = #companyCode#, <!-- 公司编码 -->
company_name = #companyName#, <!-- 公司名称 -->
dep_code = #depCode#, <!-- 部门编码 -->
dep_name = #depName#, <!-- 部门名称 -->
proj_code = #projCode#, <!-- 项目编码 -->
proj_name = #projName#, <!-- 项目名称 -->
task_code = #taskCode#, <!-- 任务编码 -->
product_type = #productType#, <!-- 产品类型 -->
product_code = #productCode#, <!-- 产品编号 -->
product_name = #productName#, <!-- 产品名称 -->
plan_start_date = #planStartDate#, <!-- 计划开始日期 -->
plan_end_date = #planEndDate#, <!-- 计划结束日期 -->
factory_code = #factoryCode#, <!-- 工厂编号 -->
factory_name = #factoryName#, <!-- 工厂名称 -->
group_code = #groupCode#, <!-- 工作组编号 -->
group_name = #groupName#, <!-- 工作组名称 -->
register_date = #registerDate#, <!-- 报工日期 -->
quantity = #quantity#, <!-- 数量 -->
single_weight = #singleWeight#, <!-- 单重 -->
total_weight = #totalWeight#, <!-- 总重 -->
account_code = #accountCode#, <!-- 帐套 -->
created_by = #createdBy#, <!-- 创建人 -->
created_name = #createdName#, <!-- 创建人名称 -->
created_time = #createdTime#, <!-- 创建时间 -->
updated_by = #updatedBy#, <!-- 更新人 -->
updated_name = #updatedName#, <!-- 修改人名称 -->
updated_time = #updatedTime# <!-- 更新时间 -->
WHERE
id = #id#
</update>
</sqlMap>
...@@ -567,6 +567,11 @@ public class HGSCTools { ...@@ -567,6 +567,11 @@ public class HGSCTools {
.divide(timing,2, ROUND_DOWN) .divide(timing,2, ROUND_DOWN)
.multiply(baseWorkHour).add(finalRemainder)); .multiply(baseWorkHour).add(finalRemainder));
break; break;
case ZL:
workHour.set(planInfo.getTotalWeight().multiply(composingCoeff)
.divide(timing,2, ROUND_DOWN)
.multiply(baseWorkHour).add(finalRemainder));
break;
default: default:
break; break;
} }
...@@ -733,6 +738,14 @@ public class HGSCTools { ...@@ -733,6 +738,14 @@ public class HGSCTools {
} }
public static class THGSC008{
public static List<HGSC008> getByTaskId(Long taskId){
AssertUtils.isTrue(Objects.isNull(taskId)||taskId<=0, "生产任务ID不能为空!");
List<HGSC008> results = DaoBase.getInstance().query(HGSC008.QUERY, new HashMap<String,Object>(){{put(HGSC008.FIELD_task_id, taskId);}});
return CollectionUtils.isEmpty(results) ? null : results;
}
}
} }
...@@ -54,6 +54,7 @@ function assign() { ...@@ -54,6 +54,7 @@ function assign() {
let flag = true; let flag = true;
$.each(rows, function(index, item) { $.each(rows, function(index, item) {
let compareProductType = item.get("productType"); let compareProductType = item.get("productType");
ids.push(item.id)
if(productType != compareProductType){ if(productType != compareProductType){
IPLAT.alert({ IPLAT.alert({
message : "选中的生产订单不属于同一工种,无法分派!", message : "选中的生产订单不属于同一工种,无法分派!",
...@@ -70,8 +71,8 @@ function assign() { ...@@ -70,8 +71,8 @@ function assign() {
JSColorbox.open({ JSColorbox.open({
href: "HGSC098?methodName=initLoad&inqu_status-0-companyCode=" + companyCode + "&inqu_status-0-productType=" + productType, href: "HGSC098?methodName=initLoad&inqu_status-0-companyCode=" + companyCode + "&inqu_status-0-productType=" + productType,
title: "<div style='text-align: center;'>选择组织</div>", title: "<div style='text-align: center;'>选择组织</div>",
width: "70%", width: "90%",
height: "70%", height: "90%",
callbackName: function (row) { callbackName: function (row) {
var info = new EiInfo() var info = new EiInfo()
info.set("ids", ids.join(',')); info.set("ids", ids.join(','));
...@@ -113,12 +114,12 @@ function separateAssign(orderDetailId){ ...@@ -113,12 +114,12 @@ function separateAssign(orderDetailId){
} }
function showTaskInfo(orderDetailId) { function showTaskInfo(orderDetailId) {
// JSColorbox.open({ JSColorbox.open({
// href: "HGSC007?methodName=initLoad&inqu_status-0-orderDetailId=" + orderDetailId + "&efParentFormEname=HGSC006A", href: "HGSC007?methodName=initLoad&inqu_status-0-orderDetailId=" + orderDetailId + "&efParentFormEname=HGSC006A",
// title: "<div style='text-align: center;'>生产任务详情</div>", title: "<div style='text-align: center;'>生产任务详情</div>",
// width: "90%", width: "90%",
// height: "90%" height: "90%"
// }); });
} }
/** /**
......
...@@ -14,7 +14,12 @@ $(function () { ...@@ -14,7 +14,12 @@ $(function () {
{ {
field: "operator", field: "operator",
template: function (item) { template: function (item) {
let template = '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' 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>'; + 'onclick="showUploadFile(' + item.matId + ')" >附件清单</a>';
return template; return template;
} }
...@@ -47,3 +52,21 @@ function showUploadFile(id) { ...@@ -47,3 +52,21 @@ function showUploadFile(id) {
}); });
} }
function registerWork(id) {
JSColorbox.open({
href: "HGSC007A?methodName=initLoad&inqu_status-0-taskId=" + id,
title: "<div style='text-align: center;'>报工</div>",
width: "90%",
height: "40%",
callbackName: registerWorkCallback
});
}
function registerWorkCallback(ei) {
if (ei.getStatus() >= 0) {
// 刷新列表
resultGrid.dataSource.page(1);
// 关闭弹窗
JSColorbox.close();
}
}
$(function () {
$("#result-0-companyCode").change(function () {
let textField = IPLAT.EFSelect.text($("#result-0-companyCode"));
$("#result-0-companyName").val(textField);
})
$("#result-0-depCode").change(function () {
let textField = IPLAT.EFSelect.text($("#result-0-depCode"));
$("#result-0-depName").val(textField);
});
$("#result-0-subcontractCode").change(function () {
let textField = IPLAT.EFSelect.text($("#result-0-subcontractCode"));
$("#result-0-subcontractName").val(textField);
loadProjMg(IPLAT.EFSelect.value($("#result-0-subcontractCode")));
});
$("#result-0-genralContractCode").change(function () {
let textField = IPLAT.EFSelect.text($("#result-0-genralContractCode"));
$("#result-0-genralContractName").val(textField);
});
/**
* 取消
*/
$('#cancel').on('click', function () {
// 关闭弹窗
parent.JSColorbox.close();
})
/**
* 保存*
*/
$("#btn_save").on("click",function(){
JSUtils.confirm("确定对数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGrid("detail", "HGSC001", "save", {isAlldata:true,onSuccessCallback:parent.windowCallback});
}
});
});
});
<!DOCTYPE html>
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<EF:EFPage title="报工">
<EF:EFRegion id="inqu" title="报工">
<div class="row">
<EF:EFInput ename="result-0-taskId" cname="生产任务ID" type="hidden"/>
<EF:EFInput ename="result-0-productCode" cname="产品编码" colWidth="4" readonly="true"/>
<EF:EFInput ename="result-0-productName" cname="产品名称" colWidth="4" readonly="true"/>
<EF:EFInput ename="result-0-processName" cname="工序" colWidth="4" readonly="true"/>
</div>
<div class="row">
<EF:EFInput ename="result-0-singleWeight" cname="单重" colWidth="4" format="{0:0.00}" editType="text" readonly="true"/>
<EF:EFInput ename="result-0-orderQuantity" cname="任务数量" format="{0:0}" editType="text" colWidth="4" readonly="true"/>
<EF:EFInput ename="result-0-orderWeight" cname="任务重量" format="{0:0.00}" editType="text" colWidth="4" readonly="true"/>
</div>
<div class="row">
<EF:EFInput ename="result-0-registeredQuantity" cname="已报工数量" format="{0:0}" editType="text" colWidth="4" readonly="true"/>
<EF:EFInput ename="result-0-registeredWeight" cname="已报工重量" format="{0:0.00}" editType="text" colWidth="4" readonly="true"/>
<EF:EFInput ename="result-0-unregisterQuantity" cname="剩余数量" format="{0:0}" editType="text" colWidth="4" readonly="true"/>
</div>
<div class="row">
<EF:EFInput ename="result-0-unregisterWeight" cname="剩余重量" format="{0:0.00}" editType="text" colWidth="4" readonly="true"/>
<EF:EFInput ename="result-0-groupName" cname="班组" colWidth="4" required="true" readonly="true"/>
<EF:EFDatePicker cname="报工日期" ename="result-0-registerDate" colWidth="4"
format="yyyy-MM-dd" required="true" readonly="false"/>
</div>
<div class="row">
<EF:EFInput ename="result-0-quantity" cname="报工数量" format="{0:0}" editType="text" colWidth="4" required="true" readonly="false"/>
<EF:EFInput ename="result-0-totalWeight" cname="报工重量" format="{0:0.00}" editType="text" colWidth="4" readonly="true"/>
</div>
</EF:EFRegion>
<div class="row" style="display:flex;justify-content:center;">
<EF:EFButton ename="cancel" cname="取消" type="button" class="btn-center"/>
<EF:EFButton ename="btn_save" cname="保存" type="button" class="btn-center"/>
</div>
</EF:EFPage>
...@@ -10,13 +10,13 @@ ...@@ -10,13 +10,13 @@
<EF:EFInput cname="公司编码" ename="companyCode" blockId="inqu_status" row="0" type="hidden"/> <EF:EFInput cname="公司编码" ename="companyCode" blockId="inqu_status" row="0" type="hidden"/>
<EF:EFInput cname="产品类型" ename="productType" blockId="inqu_status" row="0" type="hidden"/> <EF:EFInput cname="产品类型" ename="productType" blockId="inqu_status" row="0" type="hidden"/>
<div class="row"> <div class="row">
<EF:EFSelect ename="inqu_status-0-factoryCode" cname="工厂" colWidth="3" filter="contains" <EF:EFSelect ename="inqu_status-0-factoryCode" cname="工厂" colWidth="4" filter="contains"
template="#=textField#" valueTemplate="#=textField#"> template="#=textField#" valueTemplate="#=textField#">
<EF:EFOption label="全部" value=""/> <EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="factory_record_block_id" textField="factoryName" valueField="factoryCode"/> <EF:EFOptions blockId="factory_record_block_id" textField="factoryName" valueField="factoryCode"/>
</EF:EFSelect> </EF:EFSelect>
<EF:EFCascadeSelect cascadeFrom="inqu_status-0-factoryCode" cname="工作组" ename="inqu_status-0-groupCode" <EF:EFCascadeSelect cascadeFrom="inqu_status-0-factoryCode" cname="工作组" ename="inqu_status-0-groupCode"
colWidth="4" required="true" filter="contains" defaultValue="" colWidth="4" filter="contains" defaultValue=""
serviceName="HGSC098" methodName="workGroupComboBox" resultId="workGroup" serviceName="HGSC098" methodName="workGroupComboBox" resultId="workGroup"
textField="groupName" valueField="groupCode" > textField="groupName" valueField="groupCode" >
</EF:EFCascadeSelect> </EF:EFCascadeSelect>
......
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