Commit 9a3d0464 by liuyang

2024-04-19 生产计划:基本信息栏(部件)增加生产厂区字段(必填),后续生成生产订单派工时不需要选择厂区,默认生产计划中的厂区

parent 3499e141
...@@ -42,8 +42,8 @@ public class HPSC003 extends DaoEPBase { ...@@ -42,8 +42,8 @@ public class HPSC003 extends DaoEPBase {
public static final String FIELD_REMARK = "remark"; /* 备注*/ public static final String FIELD_REMARK = "remark"; /* 备注*/
public static final String FIELD_SCHEDULE = "schedule"; public static final String FIELD_SCHEDULE = "schedule";
public static final String FIELD_DELIVERY_DATE = "deliveryDate"; public static final String FIELD_DELIVERY_DATE = "deliveryDate";
public static final String FIELD_INVENT_RECORD_ID = "inventRecordId"; public static final String FIELD_INVENT_RECORD_ID = "inventRecordId";
public static final String FIELD_FACTORY_CODE = "factoryCode";
public static final String COL_ID = "ID"; public static final String COL_ID = "ID";
...@@ -65,6 +65,7 @@ public class HPSC003 extends DaoEPBase { ...@@ -65,6 +65,7 @@ public class HPSC003 extends DaoEPBase {
public static final String COL_REMARK = "REMARK"; /* 备注*/ public static final String COL_REMARK = "REMARK"; /* 备注*/
public static final String COL_INVENT_RECORD_ID = "INVENT_RECORD_ID"; public static final String COL_INVENT_RECORD_ID = "INVENT_RECORD_ID";
public static final String COL_DELIVERY_DATE = "DELIVERY_DATE"; public static final String COL_DELIVERY_DATE = "DELIVERY_DATE";
public static final String COL_FACTORY_CODE = "FACTORY_CODE"; /* 工厂代码*/
public static final String QUERY = "HPSC003.query"; public static final String QUERY = "HPSC003.query";
public static final String COUNT = "HPSC003.count"; public static final String COUNT = "HPSC003.count";
...@@ -101,6 +102,7 @@ public class HPSC003 extends DaoEPBase { ...@@ -101,6 +102,7 @@ public class HPSC003 extends DaoEPBase {
private BigDecimal length = new BigDecimal(0.00); /* 长*/ private BigDecimal length = new BigDecimal(0.00); /* 长*/
private BigDecimal width = new BigDecimal(0.00); /* 宽*/ private BigDecimal width = new BigDecimal(0.00); /* 宽*/
private BigDecimal thick = new BigDecimal(0.00); /* 厚*/ private BigDecimal thick = new BigDecimal(0.00); /* 厚*/
private String factoryCode = " "; /* 工厂代码*/
/** /**
...@@ -219,6 +221,9 @@ public class HPSC003 extends DaoEPBase { ...@@ -219,6 +221,9 @@ public class HPSC003 extends DaoEPBase {
eiColumn.setDescName("交货日期"); eiColumn.setDescName("交货日期");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_FACTORY_CODE);
eiColumn.setDescName("工厂代码");
eiMetadata.addMeta(eiColumn);
} }
...@@ -590,6 +595,14 @@ public class HPSC003 extends DaoEPBase { ...@@ -590,6 +595,14 @@ public class HPSC003 extends DaoEPBase {
this.deliveryDate = deliveryDate; this.deliveryDate = deliveryDate;
} }
public String getFactoryCode() {
return factoryCode;
}
public void setFactoryCode(String factoryCode) {
this.factoryCode = factoryCode;
}
/** /**
* get the value from Map. * get the value from Map.
* *
...@@ -623,7 +636,7 @@ public class HPSC003 extends DaoEPBase { ...@@ -623,7 +636,7 @@ public class HPSC003 extends DaoEPBase {
setThick(NumberUtils.toBigDecimal(StringUtils.toString(map.get("thick")), thick)); setThick(NumberUtils.toBigDecimal(StringUtils.toString(map.get("thick")), thick));
setMatId(NumberUtils.toLong(StringUtils.toString(map.get("matId")), matId)); setMatId(NumberUtils.toLong(StringUtils.toString(map.get("matId")), matId));
setDeliveryDate(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DELIVERY_DATE)), deliveryDate)); setDeliveryDate(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DELIVERY_DATE)), deliveryDate));
setFactoryCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_FACTORY_CODE)), factoryCode));
} }
/** /**
...@@ -658,6 +671,7 @@ public class HPSC003 extends DaoEPBase { ...@@ -658,6 +671,7 @@ public class HPSC003 extends DaoEPBase {
map.put("thick", StringUtils.toString(thick, eiMetadata.getMeta("thick"))); map.put("thick", StringUtils.toString(thick, eiMetadata.getMeta("thick")));
map.put("matId", StringUtils.toString(matId, eiMetadata.getMeta("matId"))); map.put("matId", StringUtils.toString(matId, eiMetadata.getMeta("matId")));
map.put(FIELD_DELIVERY_DATE, StringUtils.toString(deliveryDate, eiMetadata.getMeta(FIELD_DELIVERY_DATE))); map.put(FIELD_DELIVERY_DATE, StringUtils.toString(deliveryDate, eiMetadata.getMeta(FIELD_DELIVERY_DATE)));
map.put(FIELD_FACTORY_CODE, StringUtils.toString(factoryCode, eiMetadata.getMeta(FIELD_FACTORY_CODE)));
return map; return map;
} }
......
...@@ -67,6 +67,7 @@ public class HPSC004 extends DaoEPBase { ...@@ -67,6 +67,7 @@ public class HPSC004 extends DaoEPBase {
public static final String FIELD_UPDATED_TIME = "updatedTime"; /* 更新时间*/ public static final String FIELD_UPDATED_TIME = "updatedTime"; /* 更新时间*/
public static final String FIELD_DEL_STATUS = "delStatus"; /* 状态:0未删除,1已删除*/ public static final String FIELD_DEL_STATUS = "delStatus"; /* 状态:0未删除,1已删除*/
public static final String FIELD_DELIVERY_DATE = "deliveryDate"; public static final String FIELD_DELIVERY_DATE = "deliveryDate";
public static final String FIELD_FACTORY_CODE = "factoryCode";
public static final String COL_ID = "ID"; public static final String COL_ID = "ID";
public static final String COL_COMPANY_CODE = "COMPANY_CODE"; /* 企业编码 预留*/ public static final String COL_COMPANY_CODE = "COMPANY_CODE"; /* 企业编码 预留*/
...@@ -113,6 +114,7 @@ public class HPSC004 extends DaoEPBase { ...@@ -113,6 +114,7 @@ public class HPSC004 extends DaoEPBase {
public static final String COL_UPDATED_TIME = "UPDATED_TIME"; /* 更新时间*/ public static final String COL_UPDATED_TIME = "UPDATED_TIME"; /* 更新时间*/
public static final String COL_DEL_STATUS = "DEL_STATUS"; /* 状态:0未删除,1已删除*/ public static final String COL_DEL_STATUS = "DEL_STATUS"; /* 状态:0未删除,1已删除*/
public static final String COL_DELIVERY_DATE = "DELIVERY_DATE"; public static final String COL_DELIVERY_DATE = "DELIVERY_DATE";
public static final String COL_FACTORY_CODE = "FACTORY_CODE"; /* 工厂代码*/
public static final String QUERY = "HPSC004.query"; public static final String QUERY = "HPSC004.query";
public static final String COUNT = "HPSC004.count"; public static final String COUNT = "HPSC004.count";
...@@ -165,6 +167,7 @@ public class HPSC004 extends DaoEPBase { ...@@ -165,6 +167,7 @@ public class HPSC004 extends DaoEPBase {
private String updatedTime = " "; /* 更新时间*/ private String updatedTime = " "; /* 更新时间*/
private Integer delStatus; /* 状态:0未删除,1已删除*/ private Integer delStatus; /* 状态:0未删除,1已删除*/
private String deliveryDate = " "; private String deliveryDate = " ";
private String factoryCode = " "; /* 工厂代码*/
/** /**
* initialize the metadata. * initialize the metadata.
...@@ -377,7 +380,9 @@ public class HPSC004 extends DaoEPBase { ...@@ -377,7 +380,9 @@ public class HPSC004 extends DaoEPBase {
eiColumn.setDescName("交货日期"); eiColumn.setDescName("交货日期");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_FACTORY_CODE);
eiColumn.setDescName("工厂代码");
eiMetadata.addMeta(eiColumn);
} }
/** /**
...@@ -1099,6 +1104,15 @@ public class HPSC004 extends DaoEPBase { ...@@ -1099,6 +1104,15 @@ public class HPSC004 extends DaoEPBase {
public void setDeliveryDate(String deliveryDate) { public void setDeliveryDate(String deliveryDate) {
this.deliveryDate = deliveryDate; this.deliveryDate = deliveryDate;
} }
public String getFactoryCode() {
return factoryCode;
}
public void setFactoryCode(String factoryCode) {
this.factoryCode = factoryCode;
}
/** /**
* get the value from Map. * get the value from Map.
* *
...@@ -1152,6 +1166,7 @@ public class HPSC004 extends DaoEPBase { ...@@ -1152,6 +1166,7 @@ public class HPSC004 extends DaoEPBase {
setUpdatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_TIME)), updatedTime)); setUpdatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_TIME)), updatedTime));
setDelStatus(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_DEL_STATUS)), delStatus)); setDelStatus(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_DEL_STATUS)), delStatus));
setDeliveryDate(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DELIVERY_DATE)), deliveryDate)); setDeliveryDate(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DELIVERY_DATE)), deliveryDate));
setFactoryCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_FACTORY_CODE)), factoryCode));
} }
/** /**
...@@ -1206,6 +1221,7 @@ public class HPSC004 extends DaoEPBase { ...@@ -1206,6 +1221,7 @@ public class HPSC004 extends DaoEPBase {
map.put(FIELD_UPDATED_TIME, StringUtils.toString(updatedTime, eiMetadata.getMeta(FIELD_UPDATED_TIME))); map.put(FIELD_UPDATED_TIME, StringUtils.toString(updatedTime, eiMetadata.getMeta(FIELD_UPDATED_TIME)));
map.put(FIELD_DEL_STATUS, StringUtils.toString(delStatus, eiMetadata.getMeta(FIELD_DEL_STATUS))); map.put(FIELD_DEL_STATUS, StringUtils.toString(delStatus, eiMetadata.getMeta(FIELD_DEL_STATUS)));
map.put(FIELD_DELIVERY_DATE, StringUtils.toString(deliveryDate, eiMetadata.getMeta(FIELD_DELIVERY_DATE))); map.put(FIELD_DELIVERY_DATE, StringUtils.toString(deliveryDate, eiMetadata.getMeta(FIELD_DELIVERY_DATE)));
map.put(FIELD_FACTORY_CODE, StringUtils.toString(factoryCode, eiMetadata.getMeta(FIELD_FACTORY_CODE)));
return map; return map;
} }
......
...@@ -117,14 +117,21 @@ public class ServiceHPSC003 extends ServiceBase { ...@@ -117,14 +117,21 @@ public class ServiceHPSC003 extends ServiceBase {
@OperationLogAnnotation(operModul = "生产计划",operType = "修改",operDesc = "修改") @OperationLogAnnotation(operModul = "生产计划",operType = "修改",operDesc = "修改")
public EiInfo update(EiInfo inInfo) { public EiInfo update(EiInfo inInfo) {
try { try {
HPSC003 HPSC003 = new HPSC003(); HPSC003 hpsc003 = new HPSC003();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock); EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
if (eiBlock != null) { if (eiBlock != null) {
for (int i = 0; i < eiBlock.getRowCount(); i++) { for (int i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i); Map<?, ?> map = eiBlock.getRow(i);
HPSC003.fromMap(map); hpsc003.fromMap(map);
HPSC003.setPlanCompletionDate(DateUtils.formatShort(HPSC003.getPlanCompletionDate())); hpsc003.setPlanCompletionDate(DateUtils.formatShort(hpsc003.getPlanCompletionDate()));
DaoUtils.update("HPSC003.update", HPSC003.toMap()); DaoUtils.update("HPSC003.update", hpsc003.toMap());
HashMap params = new HashMap();
params.put(HPSC004.FIELD_PARENT_ID,hpsc003.getPlanInfoNo());
List<HPSC004> list = dao.query("HPSC004.queryDetail",params,0,-999999);
for (HPSC004 hpsc004:list) {
hpsc004.setFactoryCode(hpsc003.getFactoryCode());
DaoUtils.update(HPSC004.UPDATE, hpsc004);
}
} }
inInfo.setStatus(EiConstant.STATUS_SUCCESS); inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsg("修改成功!"); inInfo.setMsg("修改成功!");
...@@ -256,6 +263,7 @@ public class ServiceHPSC003 extends ServiceBase { ...@@ -256,6 +263,7 @@ public class ServiceHPSC003 extends ServiceBase {
newSc005.setStatus(CommonConstant.YesNo.NO_0); newSc005.setStatus(CommonConstant.YesNo.NO_0);
newSc005.setDeliveryDate(dbSc003.getDeliveryDate()); newSc005.setDeliveryDate(dbSc003.getDeliveryDate());
newSc005.setDepCode(dbSc004.getDepCode()); newSc005.setDepCode(dbSc004.getDepCode());
newSc005.setFactoryCode(dbSc003.getFactoryCode());
DaoUtils.insert(HPSC005.INSERT, newSc005); DaoUtils.insert(HPSC005.INSERT, newSc005);
return newSc005; return newSc005;
} }
......
...@@ -14,9 +14,7 @@ import com.baosight.iplat4j.core.ei.EiInfo; ...@@ -14,9 +14,7 @@ import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.service.impl.ServiceBase; import com.baosight.iplat4j.core.service.impl.ServiceBase;
import org.apache.commons.collections.MapUtils; import org.apache.commons.collections.MapUtils;
import java.util.ArrayList; import java.util.*;
import java.util.List;
import java.util.Map;
/** /**
* @author:songx * @author:songx
...@@ -33,6 +31,8 @@ public class ServiceHPSC005 extends ServiceBase { ...@@ -33,6 +31,8 @@ public class ServiceHPSC005 extends ServiceBase {
@OperationLogAnnotation(operModul = "生产订单",operType = "查询",operDesc = "初始化") @OperationLogAnnotation(operModul = "生产订单",operType = "查询",operDesc = "初始化")
public EiInfo initLoad(EiInfo inInfo) { public EiInfo initLoad(EiInfo inInfo) {
try { try {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.FACTORY_RECORD_BLOCK_ID),
new HashMap<String,Object>(){});
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HPSC005().eiMetadata); inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HPSC005().eiMetadata);
} catch (Exception e) { } catch (Exception e) {
inInfo.setStatus(500); inInfo.setStatus(500);
......
...@@ -23,6 +23,7 @@ import com.baosight.iplat4j.ed.util.SequenceGenerator; ...@@ -23,6 +23,7 @@ import com.baosight.iplat4j.ed.util.SequenceGenerator;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Arrays; import java.util.Arrays;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -47,7 +48,8 @@ public class ServiceHPSC005A extends ServiceBase { ...@@ -47,7 +48,8 @@ public class ServiceHPSC005A extends ServiceBase {
String prodOrderNo = MapUtils.getString(queryMap, CommonConstant.Field.PROD_ORDER_NO); String prodOrderNo = MapUtils.getString(queryMap, CommonConstant.Field.PROD_ORDER_NO);
HPSC005 dbSc005 = HPSCTools.HpSc005.get(prodOrderNo); HPSC005 dbSc005 = HPSCTools.HpSc005.get(prodOrderNo);
inInfo.addBlock(CommonConstant.Field.DETAIL).addRow(dbSc005); inInfo.addBlock(CommonConstant.Field.DETAIL).addRow(dbSc005);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.FACTORY_RECORD_BLOCK_ID), null, false); CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.FACTORY_RECORD_BLOCK_ID,DdynamicEnum.GROUP_PRO_BLOCK_ID),
new HashMap<String,Object>(){{put(HPSC005.FIELD_FACTORY_CODE,dbSc005.getFactoryCode());}}, false);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HPSC005A().eiMetadata); inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HPSC005A().eiMetadata);
} catch (Exception e) { } catch (Exception e) {
inInfo.setStatus(500); inInfo.setStatus(500);
...@@ -100,7 +102,7 @@ public class ServiceHPSC005A extends ServiceBase { ...@@ -100,7 +102,7 @@ public class ServiceHPSC005A extends ServiceBase {
for (Map resultRow : resultRows) { for (Map resultRow : resultRows) {
HPSC005A fSc005a = new HPSC005A(); HPSC005A fSc005a = new HPSC005A();
fSc005a.fromMap(resultRow); fSc005a.fromMap(resultRow);
fSc005a.setFactoryCode(dbSc005.getFactoryCode());
if (fSc005a.getId() == null || fSc005a.getId() == 0) { if (fSc005a.getId() == null || fSc005a.getId() == 0) {
this.add(dbSc005, fSc005a); this.add(dbSc005, fSc005a);
} else { } else {
......
...@@ -127,6 +127,7 @@ public class ServiceHPSC006 extends ServiceBase { ...@@ -127,6 +127,7 @@ public class ServiceHPSC006 extends ServiceBase {
String projCode = inInfo.getString("projCode"); String projCode = inInfo.getString("projCode");
String projName = inInfo.getString("projName"); String projName = inInfo.getString("projName");
String deliveryDate = inInfo.getString("deliveryDate"); String deliveryDate = inInfo.getString("deliveryDate");
String factoryCode = inInfo.getString("factoryCode");
// 写入数据 // 写入数据
for (int i = 0; i < resultRows.size(); i++) { for (int i = 0; i < resultRows.size(); i++) {
HPSC006 hpsc006 = new HPSC006(); HPSC006 hpsc006 = new HPSC006();
...@@ -141,6 +142,7 @@ public class ServiceHPSC006 extends ServiceBase { ...@@ -141,6 +142,7 @@ public class ServiceHPSC006 extends ServiceBase {
hpsc006.setProjName(projName); hpsc006.setProjName(projName);
hpsc006.setDeliveryDate(deliveryDate); hpsc006.setDeliveryDate(deliveryDate);
hpsc006.setProductionOrderNo(productionOrderNo); hpsc006.setProductionOrderNo(productionOrderNo);
hpsc006.setFactoryCode(factoryCode);
hpsc006.setTotalWt(totalWt); hpsc006.setTotalWt(totalWt);
hpsc006.setInventCode(HPPZTools.checkAndSavePZ04(hpsc006.getInventType(),hpsc006.getInventName())); hpsc006.setInventCode(HPPZTools.checkAndSavePZ04(hpsc006.getInventType(),hpsc006.getInventName()));
// 去除日期字符串中的- // 去除日期字符串中的-
......
...@@ -30,10 +30,16 @@ public class ServiceHPSC098 extends ServiceBase { ...@@ -30,10 +30,16 @@ public class ServiceHPSC098 extends ServiceBase {
public EiInfo initLoad(EiInfo inInfo) { public EiInfo initLoad(EiInfo inInfo) {
try { try {
String orgType = inInfo.getString("inqu_status-0-orgType"); String orgType = inInfo.getString("inqu_status-0-orgType");
String factoryCode = inInfo.getString("inqu_status-0-factoryCode");
Map queryMap = new HashMap(); Map queryMap = new HashMap();
queryMap.put("orgType", orgType); queryMap.put("orgType", orgType);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.FACTORY_RECORD_BLOCK_ID), null); CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.FACTORY_RECORD_BLOCK_ID),
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.GROUP_RECORD_BLOCK_ID), null); new HashMap<String,Object>(){{put("orgId",factoryCode);}});
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.GROUP_RECORD_BLOCK_ID),
new HashMap<String,Object>(){{
put("parentOrgId",factoryCode);
put("orgType",orgType);
}});
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HPSC098().eiMetadata); inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HPSC098().eiMetadata);
inInfo.set("inqu_status-0-orgType", orgType); inInfo.set("inqu_status-0-orgType", orgType);
} catch (PlatException e) { } catch (PlatException e) {
......
...@@ -58,6 +58,9 @@ ...@@ -58,6 +58,9 @@
<isNotEmpty prepend=" AND " property="deliveryDate"> <isNotEmpty prepend=" AND " property="deliveryDate">
DELIVERY_DATE = #deliveryDate# DELIVERY_DATE = #deliveryDate#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryCode">
FACTORY_CODE = #factoryCode#
</isNotEmpty>
</sql> </sql>
<sql id="authCondition"> <sql id="authCondition">
...@@ -105,6 +108,7 @@ ...@@ -105,6 +108,7 @@
THICK as "thick", <!-- 厚 --> THICK as "thick", <!-- 厚 -->
MAT_ID AS "matId", MAT_ID AS "matId",
DELIVERY_DATE as "deliveryDate", DELIVERY_DATE as "deliveryDate",
FACTORY_CODE as "factoryCode", <!-- 工厂代码 -->
CONCAT(( CONCAT((
SELECT SELECT
format((ifnull( SUM( ACTUAL_COMPLETION_NUM ), 0 ) / ifnull( SUM( NUM ), 0 ) * 100),2) format((ifnull( SUM( ACTUAL_COMPLETION_NUM ), 0 ) / ifnull( SUM( NUM ), 0 ) * 100),2)
...@@ -155,12 +159,13 @@ ...@@ -155,12 +159,13 @@
DEP_CODE, <!-- 部门编码 --> DEP_CODE, <!-- 部门编码 -->
REMARK, <!-- 备注 --> REMARK, <!-- 备注 -->
MAT_ID, MAT_ID,
DELIVERY_DATE DELIVERY_DATE,
FACTORY_CODE <!-- 工厂代码 -->
) )
VALUES (#id#, #companyCode#, #projType#, #projCode#, #projName#, #planInfoNo#,#inventRecordId#, VALUES (#id#, #companyCode#, #projType#, #projCode#, #projName#, #planInfoNo#,#inventRecordId#,
#spec#, #length#, #width#, #thick#, #prdtType#, #prdtCode#, #prdtName#, #planCompletionDate#, #status#, #spec#, #length#, #width#, #thick#, #prdtType#, #prdtCode#, #prdtName#, #planCompletionDate#, #status#,
#createdBy#, #createdBy#,
#createdTime#, #updatedBy#, #updatedTime#, #depCode#, #remark#,#matId#, #deliveryDate#) #createdTime#, #updatedBy#, #updatedTime#, #depCode#, #remark#,#matId#, #deliveryDate#,#factoryCode#)
</insert> </insert>
<delete id="delete"> <delete id="delete">
...@@ -195,7 +200,8 @@ ...@@ -195,7 +200,8 @@
UPDATED_TIME = #updatedTime#, <!-- 更新时间 --> UPDATED_TIME = #updatedTime#, <!-- 更新时间 -->
DEP_CODE = #depCode#, <!-- 部门编码 --> DEP_CODE = #depCode#, <!-- 部门编码 -->
REMARK = #remark#, <!-- 备注 --> REMARK = #remark#, <!-- 备注 -->
DELIVERY_DATE = #deliveryDate# DELIVERY_DATE = #deliveryDate#,
FACTORY_CODE = #factoryCode#
WHERE WHERE
ID = #id# ID = #id#
</update> </update>
......
...@@ -46,7 +46,8 @@ ...@@ -46,7 +46,8 @@
UPDATED_NAME as "updatedName", <!-- 修改人名称 --> UPDATED_NAME as "updatedName", <!-- 修改人名称 -->
UPDATED_TIME as "updatedTime", <!-- 更新时间 --> UPDATED_TIME as "updatedTime", <!-- 更新时间 -->
DEL_STATUS as "delStatus", <!-- 状态:0未删除,1已删除 --> DEL_STATUS as "delStatus", <!-- 状态:0未删除,1已删除 -->
DELIVERY_DATE as "deliveryDate" DELIVERY_DATE as "deliveryDate",
FACTORY_CODE as "factoryCode" <!-- 工厂代码 -->
</sql> </sql>
<sql id="condition"> <sql id="condition">
...@@ -177,6 +178,9 @@ ...@@ -177,6 +178,9 @@
<isNotEmpty prepend=" AND " property="deliveryDate"> <isNotEmpty prepend=" AND " property="deliveryDate">
DELIVERY_DATE = #deliveryDate# DELIVERY_DATE = #deliveryDate#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryCode">
FACTORY_CODE = #factoryCode#
</isNotEmpty>
</sql> </sql>
<sql id="authCondition"> <sql id="authCondition">
...@@ -264,14 +268,15 @@ ...@@ -264,14 +268,15 @@
CREATED_NAME, <!-- 创建人名称 --> CREATED_NAME, <!-- 创建人名称 -->
CREATED_TIME, <!-- 创建时间 --> CREATED_TIME, <!-- 创建时间 -->
DEL_STATUS, <!-- 状态:0未删除,1已删除 --> DEL_STATUS, <!-- 状态:0未删除,1已删除 -->
DELIVERY_DATE DELIVERY_DATE,
FACTORY_CODE <!-- 工厂代码 -->
) VALUES ( ) VALUES (
#companyCode#, #depCode#, #projCode#, #projName#, #matId#, #parentId#, #parentPrdtName#, #companyCode#, #depCode#, #projCode#, #projName#, #matId#, #parentId#, #parentPrdtName#,
#prodOrderNo#, #type#, #leaf#, #sort#, #icon#, #prdtType#, #prdtCode#, #prodOrderNo#, #type#, #leaf#, #sort#, #icon#, #prdtType#, #prdtCode#,
#prdtName#, #length#, #width#, #thick#, #spec#, #num#, #unitWt#, #totalWt#, #filePath1#, #prdtName#, #length#, #width#, #thick#, #spec#, #num#, #unitWt#, #totalWt#, #filePath1#,
#filePath2#, #filePath3#, #filePath4#, #filePath5#, #planCommentDate#, #planCompletionDate#, #filePath2#, #filePath3#, #filePath4#, #filePath5#, #planCommentDate#, #planCompletionDate#,
#actualCompletionDate#, #actualCompletionNum#, #actualCompletionUnitWt#, #inventRecordId#, #actualCompletionDate#, #actualCompletionNum#, #actualCompletionUnitWt#, #inventRecordId#,
#status#, #remark#, #createdBy#, #createdName#, #createdTime#, #delStatus#, #deliveryDate# #status#, #remark#, #createdBy#, #createdName#, #createdTime#, #delStatus#, #deliveryDate#, #factoryCode#
) )
</insert> </insert>
...@@ -321,7 +326,8 @@ ...@@ -321,7 +326,8 @@
LENGTH = #length#, <!-- 长 --> LENGTH = #length#, <!-- 长 -->
WIDTH = #width#, <!-- 宽 --> WIDTH = #width#, <!-- 宽 -->
THICK = #thick#, <!-- 厚 --> THICK = #thick#, <!-- 厚 -->
DELIVERY_DATE = #deliveryDate# DELIVERY_DATE = #deliveryDate#,
FACTORY_CODE = #factoryCode#
WHERE ID = #id# WHERE ID = #id#
</update> </update>
......
...@@ -153,7 +153,7 @@ ...@@ -153,7 +153,7 @@
$order$ $order$
</isNotEmpty> </isNotEmpty>
<isEmpty property="order"> <isEmpty property="order">
STATUS,CREATED_TIME desc STATUS,CREATED_TIME desc,FACTORY_CODE
</isEmpty> </isEmpty>
</dynamic> </dynamic>
</sql> </sql>
......
...@@ -21,7 +21,7 @@ $(function () { ...@@ -21,7 +21,7 @@ $(function () {
if (auditStatus == 0) { if (auditStatus == 0) {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;" ' template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;" '
+ +
'onclick="check(' + item.id + ',1, \'' + item.planInfoNo + '\')" >提交</a>'; 'onclick="check(' + item.id + ',1, \'' + item.planInfoNo + '\',\'' + item.factoryCode + '\')" >提交</a>';
} }
/*else { /*else {
template += '<a hidden="hidden" style="cursor: pointer;display: inline-flex;justify-content: center;" ' + template += '<a hidden="hidden" style="cursor: pointer;display: inline-flex;justify-content: center;" ' +
...@@ -153,10 +153,14 @@ function showUploadFile(id) { ...@@ -153,10 +153,14 @@ function showUploadFile(id) {
height: "80%", height: "80%",
}); });
} }
function check(id, auditStatus,planInfoNo) { function check(id, auditStatus,planInfoNo,factoryCode) {
const inEiInfo = new EiInfo(); const inEiInfo = new EiInfo();
inEiInfo.set("id", id); inEiInfo.set("id", id);
inEiInfo.set("planInfoNo",planInfoNo); inEiInfo.set("planInfoNo",planInfoNo);
if (isBlank(factoryCode)) {
message("工厂不能为空,请选择工厂");
return;
}
//先判断本身是否填写 //先判断本身是否填写
EiCommunicator.send('HPSC003', 'getInfo', inEiInfo, { EiCommunicator.send('HPSC003', 'getInfo', inEiInfo, {
onSuccess(ei) { onSuccess(ei) {
...@@ -189,7 +193,7 @@ function check(id, auditStatus,planInfoNo) { ...@@ -189,7 +193,7 @@ function check(id, auditStatus,planInfoNo) {
onSuccess(response) { onSuccess(response) {
NotificationUtil(response.msg); NotificationUtil(response.msg);
console.log(response) console.log(response)
autoProductionschedul(response.get('planInfoNo')); autoProductionschedulCallback(factoryCode,response.get('planInfoNo'));
resultGrid.dataSource.page(1); resultGrid.dataSource.page(1);
}, },
onFail(errorMessage, status, e) { onFail(errorMessage, status, e) {
...@@ -254,7 +258,7 @@ let autoProductionschedul = function (planInfoNo) { ...@@ -254,7 +258,7 @@ let autoProductionschedul = function (planInfoNo) {
}); });
} }
function autoProductionschedulCallback (factoryCode,planInfoNo) { function autoProductionschedulCallback (factoryCode,planInfoNo) {
JSColorbox.close(); //JSColorbox.close();
if (factoryCode) { if (factoryCode) {
if (planInfoNo) { if (planInfoNo) {
JSColorbox.open({ JSColorbox.open({
......
...@@ -32,6 +32,12 @@ ...@@ -32,6 +32,12 @@
<EF:EFColumn enable="false" ename="projCode" cname="项目号" readonly="true" hidden="true"/> <EF:EFColumn enable="false" ename="projCode" cname="项目号" readonly="true" hidden="true"/>
<EF:EFColumn enable="false" ename="planInfoNo" cname="生产计划单号" readonly="true" hidden="true" width="100"/> <EF:EFColumn enable="false" ename="planInfoNo" cname="生产计划单号" readonly="true" hidden="true" width="100"/>
<EF:EFColumn enable="false" ename="projName" cname="项目名称" width="120" readonly="true"/> <EF:EFColumn enable="false" ename="projName" cname="项目名称" width="120" readonly="true"/>
<EF:EFComboColumn ename="factoryCode" cname="工厂" blockName="factory_record_block_id"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" width="120" required="true"
align="center" filter="contains" sort="true">
</EF:EFComboColumn>
<EF:EFComboColumn ename="prdtType" cname="部件类型" hidden = 'true' width="90" align="center" enable="false"> <EF:EFComboColumn ename="prdtType" cname="部件类型" hidden = 'true' width="90" align="center" enable="false">
<EF:EFCodeOption codeName="hpjx.hpkc.inventType" /> <EF:EFCodeOption codeName="hpjx.hpkc.inventType" />
</EF:EFComboColumn> </EF:EFComboColumn>
......
...@@ -112,12 +112,29 @@ function assign() { ...@@ -112,12 +112,29 @@ function assign() {
message("请至少选择一条需要分派的数据"); message("请至少选择一条需要分派的数据");
return; return;
} }
let factoryCodes = null;
rows.forEach(function (element) { rows.forEach(function (element) {
ids.push(element.id) ids.push(element.id);
factoryCodes = element.factoryCode;
}); });
let flag = true;
$.each(rows, function(index, item) {
let factoryCode= item.get("factoryCode");
if(factoryCode != factoryCodes){
IPLAT.alert({
message : "选中的生产订单不上同一个工厂,无法分派!",
okFn : function(e) {
},
title : '错误'
});
flag = false;
return false;
}
});
if(flag) {
// groupType=1:仅查询生产组 // groupType=1:仅查询生产组
JSColorbox.open({ JSColorbox.open({
href: "HPSC098?methodName=initLoad&inqu_status-0-orgType=prodGroup", href: "HPSC098?methodName=initLoad&inqu_status-0-orgType=prodGroup&inqu_status-0-factoryCode="+factoryCodes,
title: "<div style='text-align: center;'>选择组织</div>", title: "<div style='text-align: center;'>选择组织</div>",
width: "70%", width: "70%",
height: "70%", height: "70%",
...@@ -147,6 +164,7 @@ function assign() { ...@@ -147,6 +164,7 @@ function assign() {
}, {async: false}); }, {async: false});
} }
}); });
}
} }
/** /**
......
...@@ -37,6 +37,12 @@ ...@@ -37,6 +37,12 @@
<EF:EFOption label="全部派工" value="2"/> <EF:EFOption label="全部派工" value="2"/>
</EF:EFComboColumn> </EF:EFComboColumn>
<EF:EFColumn ename="projName" cname="项目名称" enable="false" width="140" align="center"/> <EF:EFColumn ename="projName" cname="项目名称" enable="false" width="140" align="center"/>
<EF:EFComboColumn ename="factoryCode" cname="工厂" blockName="factory_record_block_id"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" width="120" required="true"
align="center" filter="contains" sort="true">
</EF:EFComboColumn>
<EF:EFColumn ename="prdtName" cname="部件名称" enable="false" width="120" align="center"/> <EF:EFColumn ename="prdtName" cname="部件名称" enable="false" width="120" align="center"/>
<%--<EF:EFColumn ename="prdtSpec" cname="部件规格" enable="false" width="120" align="center"/>--%> <%--<EF:EFColumn ename="prdtSpec" cname="部件规格" enable="false" width="120" align="center"/>--%>
<EF:EFColumn ename="partName" cname="零件名称" enable="false" width="120" align="center"/> <EF:EFColumn ename="partName" cname="零件名称" enable="false" width="120" align="center"/>
......
...@@ -100,10 +100,10 @@ let save = function () { ...@@ -100,10 +100,10 @@ let save = function () {
return; return;
} }
for (let i = 0; i < rows.length; i++) { for (let i = 0; i < rows.length; i++) {
if (isBlank(rows[i]['factoryCode'])) { /*if (isBlank(rows[i]['factoryCode'])) {
message("勾选的第" + (i + 1) + "行\"厂区\",不能为空"); message("勾选的第" + (i + 1) + "行\"厂区\",不能为空");
return; return;
} }*/
if (isBlank(rows[i]['orgNo'])) { if (isBlank(rows[i]['orgNo'])) {
message("勾选的第" + (i + 1) + "行\"生产组\",不能为空"); message("勾选的第" + (i + 1) + "行\"生产组\",不能为空");
return; return;
......
...@@ -32,18 +32,26 @@ ...@@ -32,18 +32,26 @@
<EF:EFOption label="全部派工" value="2"/> <EF:EFOption label="全部派工" value="2"/>
</EF:EFSelect> </EF:EFSelect>
</div> </div>
<div class="row">
<EF:EFSelect ename="detail-0-factoryCode" cname="厂区" colWidth="4" readonly="true">
<EF:EFOptions blockId="factory_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
</div>
</EF:EFRegion> </EF:EFRegion>
<EF:EFRegion id="result" title="明细信息"> <EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" checkMode="row" isFloat="true"> <EF:EFGrid blockId="result" autoDraw="override" checkMode="row" isFloat="true">
<EF:EFColumn ename="id" cname="任务ID" enable="false" width="80" align="center"/> <EF:EFColumn ename="id" cname="任务ID" enable="false" width="80" align="center"/>
<EF:EFColumn ename="prodTaskNo" cname="任务单号" enable="false" hidden="true"/> <EF:EFColumn ename="prodTaskNo" cname="任务单号" enable="false" hidden="true"/>
<EF:EFComboColumn ename="factoryCode" cname="厂区" width="110" align="center" defaultValue="" required="true" <%--<EF:EFComboColumn ename="factoryCode" cname="厂区" width="110" align="center" defaultValue="" required="true"
filter="contains" readonly="true"> filter="contains" readonly="true">
<EF:EFOptions blockId="factory_record_block_id" valueField="valueField" textField="textField"/> <EF:EFOptions blockId="factory_record_block_id" valueField="valueField" textField="textField"/>
</EF:EFComboColumn> </EF:EFComboColumn>
<EF:EFColumn ename="factoryName" cname="工厂" enable="false" align="center" hidden="true"/> <EF:EFColumn ename="factoryName" cname="工厂" enable="false" align="center" hidden="true"/>--%>
<EF:EFColumn ename="orgNo" cname="生产组" width="110" align="center" required="true" readonly="true"/> <EF:EFComboColumn ename="orgNo" cname="生产组" width="110" align="center" defaultValue="" required="true"
filter="contains" readonly="true">
<EF:EFOptions blockId="group_pro_block_id" valueField="valueField" textField="textField"/>
</EF:EFComboColumn>
<EF:EFColumn ename="orgName" cname="生产组名称" enable="false" align="center" hidden="true"/> <EF:EFColumn ename="orgName" cname="生产组名称" enable="false" align="center" hidden="true"/>
<EF:EFColumn ename="workDate" cname="派工时间" enable="false" width="100" align="center" <EF:EFColumn ename="workDate" cname="派工时间" enable="false" width="100" align="center"
editType="date" dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true"/> editType="date" dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true"/>
......
...@@ -16,6 +16,7 @@ $(function () { ...@@ -16,6 +16,7 @@ $(function () {
return; return;
} }
let flag = true; let flag = true;
let factoryCodes = null;
$.each(rows, function(index, item) { $.each(rows, function(index, item) {
let id = item.get("id"); let id = item.get("id");
if (isBlank(id)) { if (isBlank(id)) {
...@@ -49,10 +50,24 @@ $(function () { ...@@ -49,10 +50,24 @@ $(function () {
flag = false; flag = false;
return false; return false;
} }
factoryCodes = item.get("factoryCode");
});
$.each(rows, function(index, item) {
let factoryCode= item.get("factoryCode");
if(factoryCode != factoryCodes){
IPLAT.alert({
message : "选中的生产订单不上同一个工厂,无法分派!",
okFn : function(e) {
},
title : '错误'
});
flag = false;
return false;
}
}); });
if(flag) { if(flag) {
JSColorbox.open({ JSColorbox.open({
href: "HPSC098?methodName=initLoad&inqu_status-0-orgType=cutGroup", href: "HPSC098?methodName=initLoad&inqu_status-0-orgType=cutGroup&inqu_status-0-factoryCode="+factoryCodes,
title: "<div style='text-align: center;'>选择组织</div>", title: "<div style='text-align: center;'>选择组织</div>",
width: "70%", width: "70%",
height: "70%", height: "70%",
...@@ -98,6 +113,7 @@ $(function () { ...@@ -98,6 +113,7 @@ $(function () {
var projCode = e.model['projCode']; var projCode = e.model['projCode'];
var projName = e.model['projName']; var projName = e.model['projName'];
var deliveryDate = e.model['deliveryDate']; var deliveryDate = e.model['deliveryDate'];
let factoryCode = e.model['factoryCode'];
info.set("productionOrderNo",productionOrderNo); info.set("productionOrderNo",productionOrderNo);
EiCommunicator.send("HPSC006","queryDetail",info,{ EiCommunicator.send("HPSC006","queryDetail",info,{
...@@ -107,6 +123,7 @@ $(function () { ...@@ -107,6 +123,7 @@ $(function () {
$('#projCode').val(projCode) $('#projCode').val(projCode)
$('#projName').val(projName) $('#projName').val(projName)
$('#deliveryDate').val(deliveryDate) $('#deliveryDate').val(deliveryDate)
$('#factoryCode').val(factoryCode);
},onFail:function(ei){} },onFail:function(ei){}
},{async:false}); },{async:false});
}, },
...@@ -239,8 +256,22 @@ $(function () { ...@@ -239,8 +256,22 @@ $(function () {
return template return template
} }
},
{
field: "factoryCode",
defaultValue: function () {
return $("#factoryCode").val();
}
} }
], ],
onAdd:function (e) {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
e.preventDefault();
message("请选中一条需要下料的生产任务");
return;
}
},
/* onSuccess: function (e) { /* onSuccess: function (e) {
if(e.eiInfo.extAttr.methodName == 'save' if(e.eiInfo.extAttr.methodName == 'save'
||e.eiInfo.extAttr.methodName == 'delete' ){ ||e.eiInfo.extAttr.methodName == 'delete' ){
...@@ -438,6 +469,7 @@ assignCallback = function (row) { ...@@ -438,6 +469,7 @@ assignCallback = function (row) {
info.set("factoryName",row.factoryName); info.set("factoryName",row.factoryName);
info.set("groupCode",row.groupCode); info.set("groupCode",row.groupCode);
info.set("groupName",row.groupName); info.set("groupName",row.groupName);
info.set("factoryCode",$("#factoryCode").val())
EiCommunicator.send("HPSC006","assign",info,{ EiCommunicator.send("HPSC006","assign",info,{
onSuccess:function(ei){//返回结果集 onSuccess:function(ei){//返回结果集
if (ei["status"] == -1) { if (ei["status"] == -1) {
......
...@@ -51,6 +51,7 @@ ...@@ -51,6 +51,7 @@
<EF:EFInput ename="projName" type="hidden"/> <EF:EFInput ename="projName" type="hidden"/>
<EF:EFInput ename="productionOrderNo" type="hidden"/> <EF:EFInput ename="productionOrderNo" type="hidden"/>
<EF:EFInput ename="deliveryDate" type="hidden"/> <EF:EFInput ename="deliveryDate" type="hidden"/>
<EF:EFInput ename="factoryCode" type="hidden"/>
<EF:EFGrid blockId="detail" autoDraw="no"> <EF:EFGrid blockId="detail" autoDraw="no">
<EF:EFColumn ename="id" cname="主键" hidden="true"/> <EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" width="100" enable="false" readonly="false"/> <EF:EFColumn ename="operator" cname="操作" width="100" enable="false" readonly="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