Commit 0cb816e1 by liuyang

2024-08-14 设备管理开发

parent 7db3aa99
package com.baosight.hpjx.hp.kc.tools; package com.baosight.hpjx.hp.kc.tools;
import com.baosight.hpjx.common.ProdOrderStatusEnum;
import com.baosight.hpjx.core.constant.CommonConstant;
import com.baosight.hpjx.core.dao.DaoBase; import com.baosight.hpjx.core.dao.DaoBase;
import com.baosight.hpjx.core.dao.DaoUtils; import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.hp.constant.HPConstant;
import com.baosight.hpjx.hp.constant.HPSqlConstant; import com.baosight.hpjx.hp.constant.HPSqlConstant;
import com.baosight.hpjx.hp.kc.domain.*; import com.baosight.hpjx.hp.kc.domain.*;
import com.baosight.hpjx.hp.pz.tools.HPPZTools; import com.baosight.hpjx.hp.pz.tools.HPPZTools;
import com.baosight.hpjx.hp.sc.domain.HPSC005B;
import com.baosight.hpjx.hp.sc.domain.HPSC106;
import com.baosight.hpjx.hp.sc.tools.HPSCTools;
import com.baosight.hpjx.util.*;
import com.baosight.iplat4j.core.ei.EiConstant; import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo; import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException; import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.service.soa.XLocalManager; import com.baosight.iplat4j.core.service.soa.XLocalManager;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -197,6 +206,55 @@ public class HPKCTools { ...@@ -197,6 +206,55 @@ public class HPKCTools {
} }
return results.stream().collect(Collectors.toMap(HPKC003::getProdNo, item -> item)); return results.stream().collect(Collectors.toMap(HPKC003::getProdNo, item -> item));
} }
/**
* 添加生产入库
*
* @param hpsc106
* @return
*/
public static void addHpKc003(HPSC106 hpsc106) {
// 订单号
String prodOrderNo = hpsc106.getProdOrderNo();
// 任务号
String prodTaskNo = hpsc106.getProdTaskNo();
// 锁生产计划
HPSCTools.HpSc004.lock(prodOrderNo);
// 锁生产订单
HPSCTools.HpSc005.lock(prodOrderNo);
// 锁生产任务
HPSCTools.HpSc005a.lock(prodTaskNo);
// 查询生产任务信息
Map<String, HPSC005B> dbSc005bMap = HPSCTools.HpSc005b.map(prodTaskNo);
List<Map<String,String>> mapList = DaoBase.getInstance().query("HPPZ007.queryComboBox", new HashMap<String, Object>(){{
put("inventTypes", new String[]{"3"});
}});
AssertUtils.isEmpty(mapList, "仓库不存在");
// 生成入库单
BigDecimal totalWeight = hpsc106.getTotalWeight();
BigDecimal quantity = hpsc106.getQuantity();
HPSC005B fSc005b = BeanUtils.copy(hpsc106, HPSC005B.class);
HPSC005B dbSc005b = dbSc005bMap.get(fSc005b.getProdTaskNo());
HPKC003 newKc003 = BeanUtils.copy(dbSc005b, HPKC003.class);
newKc003.setProdNo(SequenceGenerator.getNextSequence(HPConstant.SequenceId.HPKC003_PROD_NO));
newKc003.setDocumentDate(DateUtils.shortDate());
newKc003.setWhCode(mapList.get(0).get("whCode"));
newKc003.setWhName(mapList.get(0).get("whName"));
//newKc003.setRemark(MapUtils.getString(row, "remark1"));
newKc003.setAmount(quantity);
newKc003.setWeight(totalWeight);
newKc003.setDeleteFlag(CommonConstant.YesNo.NO_0);
DaoUtils.insert(HPKC003.INSERT, newKc003);
// 同步生产计划
HPSCTools.syncPlan(newKc003.getProdOrderNo(), newKc003.getAmount(), newKc003.getWeight());
// 更新生产任务已完成数量
HPSCTools.HpSc005a.updateCompleteNum(fSc005b.getProdTaskNo(), quantity);
// 修改库存
HPKCTools.updateProdStock(newKc003.getWhCode(), newKc003.getProdOrderNo(),
newKc003.getAmount(), newKc003.getWeight(),fSc005b.getFactoryCode());
}
} }
/** /**
......
...@@ -126,7 +126,6 @@ ...@@ -126,7 +126,6 @@
A.DOC_NAME as "docName" A.DOC_NAME as "docName"
</sql> </sql>
<sql id="detailCondition"> <sql id="detailCondition">
<include refid="detailAuthCondition"/>
<isNotEmpty prepend=" AND " property="id"> <isNotEmpty prepend=" AND " property="id">
A.ID = #id# A.ID = #id#
</isNotEmpty> </isNotEmpty>
...@@ -200,88 +199,88 @@ ...@@ -200,88 +199,88 @@
<!--安全记录--> <!--安全记录-->
<sql id="detail1Column"> <sql id="detail1Column">
A.ID as "id", <!-- ID --> ID as "id", <!-- ID -->
A.COMPANY_CODE as "companyCode", <!-- 公司编码 --> COMPANY_CODE as "companyCode", <!-- 公司编码 -->
A.DEP_CODE as "depCode", <!-- 部门编码 --> DEP_CODE as "depCode", <!-- 部门编码 -->
A.CREATED_BY as "createdBy", <!-- 创建人 --> CREATED_BY as "createdBy", <!-- 创建人 -->
A.CREATED_NAME as "createdName", <!-- 创建人名称 --> CREATED_NAME as "createdName", <!-- 创建人名称 -->
A.CREATED_TIME as "createdTime", <!-- 创建时间 --> CREATED_TIME as "createdTime", <!-- 创建时间 -->
A.UPDATED_BY as "updatedBy", <!-- 修改人 --> UPDATED_BY as "updatedBy", <!-- 修改人 -->
A.UPDATED_NAME as "updatedName", <!-- 修改人名称 --> UPDATED_NAME as "updatedName", <!-- 修改人名称 -->
A.UPDATED_TIME as "updatedTime", <!-- 修改时间 --> UPDATED_TIME as "updatedTime", <!-- 修改时间 -->
A.DELETE_FLAG as "deleteFlag", <!-- 是否删除 0-否1-是 --> DELETE_FLAG as "deleteFlag", <!-- 是否删除 0-否1-是 -->
A.FACTORY_CODE as "factoryCode", <!-- 工厂代码(公司名称) --> FACTORY_CODE as "factoryCode", <!-- 工厂代码(公司名称) -->
A.FACTORY_NAME as "factoryName", <!-- 工厂名称 --> FACTORY_NAME as "factoryName", <!-- 工厂名称 -->
A.GROUP_CODE as "groupCode", <!-- 生产组代码(设备区域) --> GROUP_CODE as "groupCode", <!-- 生产组代码(设备区域) -->
A.GROUP_NAME as "groupName", <!-- 生产组名称 --> GROUP_NAME as "groupName", <!-- 生产组名称 -->
A.RECORD_DATE as "recordDate", <!-- 记录日期 --> RECORD_DATE as "recordDate", <!-- 记录日期 -->
A.RECORD_CODE as "recordCode", <!-- 记录单号 --> RECORD_CODE as "recordCode", <!-- 记录单号 -->
A.DEVICE_TYPE as "deviceType", <!-- 设备类型 --> DEVICE_TYPE as "deviceType", <!-- 设备类型 -->
A.DEVICE_CODE as "deviceCode", <!-- 设备编码 --> DEVICE_CODE as "deviceCode", <!-- 设备编码 -->
A.DEVICE_NAME as "deviceName", <!-- 设备名称 --> DEVICE_NAME as "deviceName", <!-- 设备名称 -->
A.DEVICE_MODEL as "deviceModel", <!-- 设备型号 --> DEVICE_MODEL as "deviceModel", <!-- 设备型号 -->
A.SECURE_DESC as "secureDesc" <!-- 安全事故描述 --> SECURE_DESC as "secureDesc" <!-- 安全事故描述 -->
</sql> </sql>
<sql id="detail1Condition"> <sql id="detail1Condition">
<isNotEmpty prepend=" AND " property="id"> <isNotEmpty prepend=" AND " property="id">
A.ID = #id# ID = #id#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode"> <isNotEmpty prepend=" AND " property="companyCode">
A.COMPANY_CODE = #companyCode# COMPANY_CODE = #companyCode#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy"> <isNotEmpty prepend=" AND " property="createdBy">
A.CREATED_BY = #createdBy# CREATED_BY = #createdBy#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="createdName"> <isNotEmpty prepend=" AND " property="createdName">
A.CREATED_NAME like CONCAT('%',#createdName#,'%') CREATED_NAME like CONCAT('%',#createdName#,'%')
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime"> <isNotEmpty prepend=" AND " property="createdTime">
A.CREATED_TIME = #createdTime# CREATED_TIME = #createdTime#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy"> <isNotEmpty prepend=" AND " property="updatedBy">
A.UPDATED_BY = #updatedBy# UPDATED_BY = #updatedBy#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedName"> <isNotEmpty prepend=" AND " property="updatedName">
A.UPDATED_NAME = #updatedName# UPDATED_NAME = #updatedName#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime"> <isNotEmpty prepend=" AND " property="updatedTime">
A.UPDATED_TIME = #updatedTime# UPDATED_TIME = #updatedTime#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="deleteFlag"> <isNotEmpty prepend=" AND " property="deleteFlag">
A.DELETE_FLAG = #deleteFlag# DELETE_FLAG = #deleteFlag#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryCode"> <isNotEmpty prepend=" AND " property="factoryCode">
A.FACTORY_CODE = #factoryCode# FACTORY_CODE = #factoryCode#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryName"> <isNotEmpty prepend=" AND " property="factoryName">
A.FACTORY_NAME = #factoryName# FACTORY_NAME = #factoryName#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="groupCode"> <!--<isNotEmpty prepend=" AND " property="groupCode">
A.GROUP_CODE = #groupCode# GROUP_CODE = #groupCode#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="groupName"> <isNotEmpty prepend=" AND " property="groupName">
A.GROUP_NAME = #groupName# GROUP_NAME = #groupName#
</isNotEmpty> </isNotEmpty>-->
<isNotEmpty prepend=" AND " property="recordDate"> <isNotEmpty prepend=" AND " property="recordDate">
A.RECORD_DATE = #recordDate# RECORD_DATE = #recordDate#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="recordCode"> <isNotEmpty prepend=" AND " property="recordCode">
A.RECORD_CODE like CONCAT('%',#recordCode#,'%') RECORD_CODE like CONCAT('%',#recordCode#,'%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deviceType">
A.DEVICE_TYPE = #deviceType#
</isNotEmpty> </isNotEmpty>
<!--<isNotEmpty prepend=" AND " property="deviceType">
DEVICE_TYPE = #deviceType#
</isNotEmpty>-->
<isNotEmpty prepend=" AND " property="deviceCode"> <isNotEmpty prepend=" AND " property="deviceCode">
A.DEVICE_CODE = #deviceCode# DEVICE_CODE = #deviceCode#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="deviceName"> <isNotEmpty prepend=" AND " property="deviceName">
A.DEVICE_NAME = #deviceName# DEVICE_NAME = #deviceName#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="deviceModel"> <isNotEmpty prepend=" AND " property="deviceModel">
A.DEVICE_MODEL = #deviceModel# DEVICE_MODEL = #deviceModel#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="secureDesc"> <isNotEmpty prepend=" AND " property="secureDesc">
A.SECURE_DESC = #secureDesc# SECURE_DESC = #secureDesc#
</isNotEmpty> </isNotEmpty>
</sql> </sql>
......
...@@ -142,6 +142,10 @@ public class ServiceHPSC102 extends ServiceEPBase { ...@@ -142,6 +142,10 @@ public class ServiceHPSC102 extends ServiceEPBase {
hpsc002.fromMap(resultRow); hpsc002.fromMap(resultRow);
AssertUtils.isTrue(hpsc002.getStatus().equals(HPConstant.planStatus.S_1), "物料清单已提交,无法保存!"); AssertUtils.isTrue(hpsc002.getStatus().equals(HPConstant.planStatus.S_1), "物料清单已提交,无法保存!");
if (hpsc002.getId() == null || hpsc002.getId() == 0) { if (hpsc002.getId() == null || hpsc002.getId() == 0) {
if (hpsc002.getPrdtType()==3){
HPSC002 hpsc0021= HPSCTools.HpSc002.getId(Long.parseLong(hpsc002.getParentId()));
AssertUtils.isTrue(hpsc0021.getStatus() == 1, "部件已提交,保存失败!");
}
this.add(hpsc002); this.add(hpsc002);
} else { } else {
this.modify(hpsc002); this.modify(hpsc002);
...@@ -213,7 +217,7 @@ public class ServiceHPSC102 extends ServiceEPBase { ...@@ -213,7 +217,7 @@ public class ServiceHPSC102 extends ServiceEPBase {
Integer lv = (Integer) this.dao.get("HPSC002.queryLv","id",hpsc002.getParentId()); Integer lv = (Integer) this.dao.get("HPSC002.queryLv","id",hpsc002.getParentId());
hpsc002.setLv(lv.intValue()+1); hpsc002.setLv(lv.intValue()+1);
} }
DaoUtils.insert("HPSC002.insert", hpsc002.toMap()); DaoUtils.insert(HPSC002.INSERT, hpsc002.toMap());
//更新零件后,更新部件重量 //更新零件后,更新部件重量
if(hpsc002.getPrdtType()==3){ if(hpsc002.getPrdtType()==3){
...@@ -225,12 +229,7 @@ public class ServiceHPSC102 extends ServiceEPBase { ...@@ -225,12 +229,7 @@ public class ServiceHPSC102 extends ServiceEPBase {
inInfo.setStatus(EiConstant.STATUS_SUCCESS); inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsg("新增成功!"); inInfo.setMsg("新增成功!");
} catch (PlatException e) { } catch (PlatException e) {
e.printStackTrace(); LogUtils.setDetailMsg(inInfo, e, "新增失败");
inInfo.setStatus(EiConstant.STATUS_FAILURE);
inInfo.setMsg("新增失败!原因参见详细错误描述!");
inInfo.setDetailMsg(e.getMessage());
logError("新增失败", e.getMessage());
return inInfo;
} }
return inInfo; return inInfo;
...@@ -367,7 +366,7 @@ public class ServiceHPSC102 extends ServiceEPBase { ...@@ -367,7 +366,7 @@ public class ServiceHPSC102 extends ServiceEPBase {
Integer lv = (Integer) this.dao.get("HPSC002.queryLv","id",hppz002.getParentId()); Integer lv = (Integer) this.dao.get("HPSC002.queryLv","id",hppz002.getParentId());
hppz002.setLv(lv.intValue()+1); hppz002.setLv(lv.intValue()+1);
} }
DaoUtils.insert("HPSC002.insert", hppz002.toMap()); DaoUtils.insert(HPSC002.INSERT, hppz002.toMap());
if (!hppz002.getParentId().equals("root")) { if (!hppz002.getParentId().equals("root")) {
this.checkTreeNodeLeaf(hppz002.getParentId()); this.checkTreeNodeLeaf(hppz002.getParentId());
...@@ -507,7 +506,7 @@ public class ServiceHPSC102 extends ServiceEPBase { ...@@ -507,7 +506,7 @@ public class ServiceHPSC102 extends ServiceEPBase {
//hppz002.setDelStatus(CommonConstant.YesNo.NO_0.intValue()); //hppz002.setDelStatus(CommonConstant.YesNo.NO_0.intValue());
//hppz002.setTotalWt(totalWt); //hppz002.setTotalWt(totalWt);
hppz002.setSpec(HPPZTools.HpPz006.jointSpec(hppz002.getLength(),hppz002.getWidth(),hppz002.getThick())); hppz002.setSpec(HPPZTools.HpPz006.jointSpec(hppz002.getLength(),hppz002.getWidth(),hppz002.getThick()));
DaoUtils.update("HPSC002.update", hppz002.toMap()); DaoUtils.update(HPSC002.UPDATE, hppz002.toMap());
//更新零件后,更新部件重量 //更新零件后,更新部件重量
if(hppz002.getPrdtType()==3){ if(hppz002.getPrdtType()==3){
this.updatePrdtWt(hppz002.getParentId()); this.updatePrdtWt(hppz002.getParentId());
...@@ -570,7 +569,7 @@ public class ServiceHPSC102 extends ServiceEPBase { ...@@ -570,7 +569,7 @@ public class ServiceHPSC102 extends ServiceEPBase {
// 删除附件文件 // 删除附件文件
delectDoc(fSc002.getId()); delectDoc(fSc002.getId());
DaoUtils.update("HPSC002.delete", fSc002); DaoUtils.update(HPSC002.DELETE, fSc002);
// 修改父级节点状态是叶子节点或非叶子节点 // 修改父级节点状态是叶子节点或非叶子节点
this.checkTreeNodeLeaf(fSc002.getParentId()); this.checkTreeNodeLeaf(fSc002.getParentId());
// 修改节点状态是叶子节点或非叶子节点 // 修改节点状态是叶子节点或非叶子节点
...@@ -846,14 +845,17 @@ public class ServiceHPSC102 extends ServiceEPBase { ...@@ -846,14 +845,17 @@ public class ServiceHPSC102 extends ServiceEPBase {
List<String> factoryIds =HPXSTools.XsOrg.getOrgId(OrgTypeEnum.FACTORY.getCode()); List<String> factoryIds =HPXSTools.XsOrg.getOrgId(OrgTypeEnum.FACTORY.getCode());
AssertUtils.isEmpty(factoryIds,"工厂不存在"); AssertUtils.isEmpty(factoryIds,"工厂不存在");
Org org = HPXSTools.XsOrg.queryFactory(factoryIds.get(0)); Org org = HPXSTools.XsOrg.queryFactory(factoryIds.get(0));
HPSC002 hpsc002 =HPSCTools.HpSc002.getId(Long.parseLong(dbSc002.getParentId()));
if (dbSc003 == null) { if (dbSc003 == null) {
planNo = SequenceGenerator.getNextSequence(HPConstant.SequenceId.HPSC003_PROD_NO); planNo = SequenceGenerator.getNextSequence(HPConstant.SequenceId.HPSC003_PROD_NO);
HPSC003 newSc003 = BeanUtils.copy(dbSc002, HPSC003.class); HPSC003 newSc003 = BeanUtils.copy(hpsc002, HPSC003.class);
newSc003.setPlanInfoNo(planNo); newSc003.setPlanInfoNo(planNo);
newSc003.setMatId(dbSc002.getId()); newSc003.setMatId(hpsc002.getId());
newSc003.setFactoryCode(org.getOrgId()); newSc003.setFactoryCode(org.getOrgId());
newSc003.setPlanCompletionDate(dbSc002.getDeliveryDate()); newSc003.setPlanCompletionDate(hpsc002.getDeliveryDate());
newSc003.setStatus(HPConstant.planStatus.S_1); newSc003.setStatus(HPConstant.planStatus.S_1);
newSc003.setPrdtCode(hpsc002.getPrdtCode());
newSc003.setPrdtName(hpsc002.getPrdtName());
DaoUtils.insert(HPSC003.INSERT, newSc003); DaoUtils.insert(HPSC003.INSERT, newSc003);
dbSc003 = newSc003; dbSc003 = newSc003;
} else { } else {
...@@ -863,6 +865,7 @@ public class ServiceHPSC102 extends ServiceEPBase { ...@@ -863,6 +865,7 @@ public class ServiceHPSC102 extends ServiceEPBase {
} }
// 生产计划详情 // 生产计划详情
List<HPSC002> dbSc002Children = HPSCTools.HpSc002.queryByParent(dbSc002.getParentId()); List<HPSC002> dbSc002Children = HPSCTools.HpSc002.queryByParent(dbSc002.getParentId());
for (HPSC002 dbSc002Child : dbSc002Children) { for (HPSC002 dbSc002Child : dbSc002Children) {
// 明细已存在就不在新增 // 明细已存在就不在新增
HPSC004 dbSc004 = HPSCTools.HpSc004.queryByMat(dbSc002Child.getId()); HPSC004 dbSc004 = HPSCTools.HpSc004.queryByMat(dbSc002Child.getId());
......
...@@ -28,12 +28,10 @@ public class ServiceHPSC105 extends ServiceEPBase { ...@@ -28,12 +28,10 @@ public class ServiceHPSC105 extends ServiceEPBase {
@Override @Override
public EiInfo initLoad(EiInfo inInfo) { public EiInfo initLoad(EiInfo inInfo) {
try { try {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.FACTORY_RECORD_BLOCK_ID), null, false); CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.FACTORY_RECORD_BLOCK_ID, DdynamicEnum.GROUP_RECORD_BLOCK_ID), null, false);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.GROUP_RECORD_BLOCK_ID), null, false);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HPSC005B().eiMetadata); inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HPSC005B().eiMetadata);
} catch (Exception e) { } catch (Exception e) {
LogUtils.setMsg(inInfo, e, "初始化失败"); LogUtils.setMsg(inInfo, e, "初始化失败");
inInfo.setStatus(500);
} }
return inInfo; return inInfo;
} }
...@@ -51,7 +49,6 @@ public class ServiceHPSC105 extends ServiceEPBase { ...@@ -51,7 +49,6 @@ public class ServiceHPSC105 extends ServiceEPBase {
inInfo = super.query(inInfo, HPSC005B.QUERY, new HPSC005B()); inInfo = super.query(inInfo, HPSC005B.QUERY, new HPSC005B());
} catch (Throwable e) { } catch (Throwable e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败"); LogUtils.setDetailMsg(inInfo, e, "查询失败");
inInfo.setStatus(500);
} }
return inInfo; return inInfo;
} }
......
...@@ -3,6 +3,7 @@ package com.baosight.hpjx.hp.sc.service; ...@@ -3,6 +3,7 @@ package com.baosight.hpjx.hp.sc.service;
import com.baosight.hpjx.aspect.annotation.OperationLogAnnotation; import com.baosight.hpjx.aspect.annotation.OperationLogAnnotation;
import com.baosight.hpjx.core.dao.DaoUtils; import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.hp.constant.HPConstant; import com.baosight.hpjx.hp.constant.HPConstant;
import com.baosight.hpjx.hp.kc.tools.HPKCTools;
import com.baosight.hpjx.hp.sc.domain.HPSC005B; import com.baosight.hpjx.hp.sc.domain.HPSC005B;
import com.baosight.hpjx.hp.sc.domain.HPSC106; import com.baosight.hpjx.hp.sc.domain.HPSC106;
import com.baosight.hpjx.hp.sc.tools.HPSCTools; import com.baosight.hpjx.hp.sc.tools.HPSCTools;
...@@ -106,7 +107,8 @@ public class ServiceHPSC105B extends ServiceEPBase { ...@@ -106,7 +107,8 @@ public class ServiceHPSC105B extends ServiceEPBase {
checkAddDate(hpsc106); checkAddDate(hpsc106);
hpsc106.setWorkCode(SequenceGenerator.getNextSequence(HPConstant.SequenceId.HGSC008_WORK_CODE)); hpsc106.setWorkCode(SequenceGenerator.getNextSequence(HPConstant.SequenceId.HGSC008_WORK_CODE));
DaoUtils.insert(HPSC106.INSERT,hpsc106); DaoUtils.insert(HPSC106.INSERT,hpsc106);
//HGZLTools.THGZL002.add(hpsc106);
HPKCTools.HpKc003.addHpKc003(hpsc106);
return hpsc106; return hpsc106;
} }
......
...@@ -66,8 +66,11 @@ ...@@ -66,8 +66,11 @@
PROJ_CODE IN <iterate close=")" open="(" conjunction="," property="projCodes">#projCodes[]#</iterate> PROJ_CODE IN <iterate close=")" open="(" conjunction="," property="projCodes">#projCodes[]#</iterate>
</isNotEmpty> </isNotEmpty>
<dynamic prepend="ORDER BY"> <dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$order$
</isNotEmpty>
<isEmpty property="orderBy"> <isEmpty property="orderBy">
STATUS,DELIVERY_DATE desc,CREATED_TIME desc STATUS, CREATED_TIME desc, DELIVERY_DATE desc
</isEmpty> </isEmpty>
</dynamic> </dynamic>
......
...@@ -19,10 +19,7 @@ import org.apache.commons.collections.MapUtils; ...@@ -19,10 +19,7 @@ import org.apache.commons.collections.MapUtils;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.math.RoundingMode; import java.math.RoundingMode;
import java.util.HashMap; import java.util.*;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
...@@ -204,6 +201,32 @@ public class HPSCTools { ...@@ -204,6 +201,32 @@ public class HPSCTools {
DaoUtils.update(HPSqlConstant.HPSC004.UPDATE_COMPLETE, newSc004); DaoUtils.update(HPSqlConstant.HPSC004.UPDATE_COMPLETE, newSc004);
} }
/**
* 新增入库及删除入库单做同步计划订单
*
* @param prodOrderNo
* @param num
*/
public static void syncPlan(String prodOrderNo, BigDecimal num, BigDecimal wt) {
HPSC004 dbSc004 = HPSCTools.HpSc004.get(prodOrderNo);
AssertUtils.isNull(dbSc004, String.format("生产订单计划[%s]不存在", prodOrderNo));
BigDecimal completionNum = num.add(dbSc004.getActualCompletionNum());
AssertUtils.isGt(BigDecimal.ZERO, completionNum, "更新后的生产计划完成数量小于0,请检查");
BigDecimal completionUnitWt = wt.add(dbSc004.getActualCompletionUnitWt());
// 计算重量
HPSC004 newSc004 = new HPSC004();
newSc004.setId(dbSc004.getId());
newSc004.setActualCompletionNum(completionNum);
newSc004.setActualCompletionUnitWt(completionUnitWt);
// 计算是否生产完成
if (dbSc004.getNum().compareTo(completionNum) == 0) {
newSc004.setActualCompletionDate(DateUtils.shortDateTime());
} else {
newSc004.setActualCompletionDate("");
}
DaoUtils.update(HPSqlConstant.HPSC004.UPDATE_COMPLETE, newSc004);
}
public static void updateProjStatus(String projCode) { public static void updateProjStatus(String projCode) {
AssertUtils.isNull(projCode, String.format("项目编码[%s]不能为空", projCode)); AssertUtils.isNull(projCode, String.format("项目编码[%s]不能为空", projCode));
Map map3 = new HashMap(); Map map3 = new HashMap();
...@@ -314,6 +337,15 @@ public class HPSCTools { ...@@ -314,6 +337,15 @@ public class HPSCTools {
*/ */
public static class HpSc002 { public static class HpSc002 {
public static HPSC002 getId(Long id) {
AssertUtils.isNull(id, "id不能为空");
Map queryMap = new HashMap();
queryMap.put("id", id);
List<HPSC002> results = DaoBase.getInstance().query("HPSC002.query", queryMap);
AssertUtils.isEmpty(results, String.format("id[%s]信息不存在", id));
return results.get(0);
}
/** /**
* 查询 * 查询
* *
...@@ -891,6 +923,16 @@ public class HPSCTools { ...@@ -891,6 +923,16 @@ public class HPSCTools {
DaoBase.getInstance().update(HPSqlConstant.HPSC005A.LOCK, queryMap); DaoBase.getInstance().update(HPSqlConstant.HPSC005A.LOCK, queryMap);
} }
public static void lock(String prodTaskNo) {
if (CollectionUtils.isEmpty(Collections.singleton(prodTaskNo))) {
return;
}
List prodTaskNos = Arrays.asList(prodTaskNo);
Map queryMap = new HashMap();
queryMap.put("prodTaskNos", prodTaskNos);
DaoBase.getInstance().update(HPSqlConstant.HPSC005A.LOCK, queryMap);
}
/** /**
* 查询信息 * 查询信息
* *
...@@ -991,6 +1033,22 @@ public class HPSCTools { ...@@ -991,6 +1033,22 @@ public class HPSCTools {
/** /**
* 查询盘点单信息 * 查询盘点单信息
* *
* @param prodTaskNo
* @return
*/
public static List<HPSC005B> list(String prodTaskNo) {
if (CollectionUtils.isEmpty(Collections.singleton(prodTaskNo))) {
return null;
}
List prodTaskNos = Arrays.asList(prodTaskNo);
Map queryMap = new HashMap();
queryMap.put("prodTaskNos", prodTaskNos);
return DaoBase.getInstance().query(HPSC005B.QUERY, queryMap);
}
/**
* 查询盘点单信息
*
* @param prodTaskNos * @param prodTaskNos
* @return * @return
*/ */
...@@ -1006,6 +1064,20 @@ public class HPSCTools { ...@@ -1006,6 +1064,20 @@ public class HPSCTools {
/** /**
* 查询盘点单信息 * 查询盘点单信息
* *
* @param prodTaskNo
* @return
*/
public static Map<String, HPSC005B> map(String prodTaskNo) {
List<HPSC005B> results = list(prodTaskNo);
if (CollectionUtils.isEmpty(results)) {
return null;
}
return results.stream().collect(Collectors.toMap(HPSC005B::getProdTaskNo, item -> item));
}
/**
* 查询盘点单信息
*
* @param prodTaskNos * @param prodTaskNos
* @return * @return
*/ */
......
...@@ -48,7 +48,7 @@ $(function () { ...@@ -48,7 +48,7 @@ $(function () {
inspecDate =isBlank(inspecDate)?"": formatYYYYMMDD(inspecDate); inspecDate =isBlank(inspecDate)?"": formatYYYYMMDD(inspecDate);
var ei = new EiInfo(); var ei = new EiInfo();
ei.set('inqu_status-0-factoryCode', $('#inqu_status-0-factoryCode').val()); ei.set('inqu_status-0-factoryCode', $('#inqu_status-0-factoryCode').val());
ei.set('inqu_status-0-groupName', $('#inqu_status-0-groupName').val()); ei.set('inqu_status-0-groupCode', $('#inqu_status-0-groupCode').val());
ei.set('inqu_status-0-deviceType', $('#inqu_status-0-deviceType').val()); ei.set('inqu_status-0-deviceType', $('#inqu_status-0-deviceType').val());
ei.set('inqu_status-0-deviceName', $('#inqu_status-0-deviceName').val()); ei.set('inqu_status-0-deviceName', $('#inqu_status-0-deviceName').val());
ei.set('inqu_status-0-inspecDate', inspecDate); ei.set('inqu_status-0-inspecDate', inspecDate);
...@@ -130,7 +130,7 @@ $(function () { ...@@ -130,7 +130,7 @@ $(function () {
upkeepDate =isBlank(upkeepDate)?"": formatYYYYMMDD(upkeepDate); upkeepDate =isBlank(upkeepDate)?"": formatYYYYMMDD(upkeepDate);
var ei = new EiInfo(); var ei = new EiInfo();
ei.set('inqu_status-0-factoryCode', $('#inqu_status-0-factoryCode').val()); ei.set('inqu_status-0-factoryCode', $('#inqu_status-0-factoryCode').val());
ei.set('inqu_status-0-groupName', $('#inqu_status-0-groupName').val()); ei.set('inqu_status-0-groupCode', $('#inqu_status-0-groupCode').val());
ei.set('inqu_status-0-deviceType', $('#inqu_status-0-deviceType').val()); ei.set('inqu_status-0-deviceType', $('#inqu_status-0-deviceType').val());
ei.set('inqu_status-0-deviceName', $('#inqu_status-0-deviceName').val()); ei.set('inqu_status-0-deviceName', $('#inqu_status-0-deviceName').val());
ei.set('inqu_status-0-upkeepDate', upkeepDate); ei.set('inqu_status-0-upkeepDate', upkeepDate);
...@@ -149,7 +149,7 @@ $(function () { ...@@ -149,7 +149,7 @@ $(function () {
pageSizes: [5, 10, 20, 50, 100], pageSizes: [5, 10, 20, 50, 100],
}, },
columns: [ columns: [
{ /*{
field: "operator", field: "operator",
title: "操作", title: "操作",
template: function (item) { template: function (item) {
...@@ -160,7 +160,7 @@ $(function () { ...@@ -160,7 +160,7 @@ $(function () {
} }
return template; return template;
} }
} }*/
], ],
exportGrid: { exportGrid: {
exportFileName: function (gridInstance) { exportFileName: function (gridInstance) {
...@@ -171,14 +171,14 @@ $(function () { ...@@ -171,14 +171,14 @@ $(function () {
exportBlockId: "detail1", // 默认值和blockId相同,导出的EiInfo中的指定数据块被导出 exportBlockId: "detail1", // 默认值和blockId相同,导出的EiInfo中的指定数据块被导出
}, },
query:function (e){ query:function (e){
let upkeepDate = $('#inqu_status-0-upkeepDate').val(); let recordDate = $('#inqu_status-0-recordDate').val();
upkeepDate =isBlank(upkeepDate)?"": formatYYYYMMDD(upkeepDate); recordDate =isBlank(recordDate)?"": formatYYYYMMDD(recordDate);
var ei = new EiInfo(); var ei = new EiInfo();
ei.set('inqu_status-0-factoryCode', $('#inqu_status-0-factoryCode').val()); ei.set('inqu_status-0-factoryCode', $('#inqu_status-0-factoryCode').val());
ei.set('inqu_status-0-groupName', $('#inqu_status-0-groupName').val()); ei.set('inqu_status-0-groupCode', $('#inqu_status-0-groupCode').val());
ei.set('inqu_status-0-recordDate', recordDate);
ei.set('inqu_status-0-deviceType', $('#inqu_status-0-deviceType').val()); ei.set('inqu_status-0-deviceType', $('#inqu_status-0-deviceType').val());
ei.set('inqu_status-0-deviceName', $('#inqu_status-0-deviceName').val()); ei.set('inqu_status-0-deviceName', $('#inqu_status-0-deviceName').val());
ei.set('inqu_status-0-upkeepDate', upkeepDate);
return ei; return ei;
}, },
loadComplete: function(grid) { loadComplete: function(grid) {
......
...@@ -35,6 +35,7 @@ ...@@ -35,6 +35,7 @@
<EF:EFInput blockId="inqu_status" row="0" ename="deviceName" cname="设备名称" readonly="true" placeholder="模糊查询" colWidth="3"/> <EF:EFInput blockId="inqu_status" row="0" ename="deviceName" cname="设备名称" readonly="true" placeholder="模糊查询" colWidth="3"/>
<EF:EFDatePicker blockId="inqu_status" row="0" ename="inspecDate" cname="点检日期" role="date" format="yyyy-MM-dd" parseFormats="['yyyyMMdd']" colWidth="3"/> <EF:EFDatePicker blockId="inqu_status" row="0" ename="inspecDate" cname="点检日期" role="date" format="yyyy-MM-dd" parseFormats="['yyyyMMdd']" colWidth="3"/>
<EF:EFDatePicker blockId="inqu_status" row="0" ename="upkeepDate" cname="保养日期" role="date" format="yyyy-MM-dd" parseFormats="['yyyyMMdd']" colWidth="3"/> <EF:EFDatePicker blockId="inqu_status" row="0" ename="upkeepDate" cname="保养日期" role="date" format="yyyy-MM-dd" parseFormats="['yyyyMMdd']" colWidth="3"/>
<EF:EFDatePicker blockId="inqu_status" row="0" ename="recordDate" cname="记录日期" role="date" format="yyyy-MM-dd" parseFormats="['yyyyMMdd']" colWidth="3"/>
</div> </div>
</EF:EFRegion> </EF:EFRegion>
...@@ -70,12 +71,11 @@ ...@@ -70,12 +71,11 @@
</EF:EFRegion> </EF:EFRegion>
<EF:EFRegion id="detail1" title="安全记录"> <EF:EFRegion id="detail1" title="安全记录">
<EF:EFGrid blockId="detail1" autoDraw="override" isFloat="true" queryMethod="queryDetail1"> <EF:EFGrid blockId="detail1" autoDraw="override" isFloat="true" queryMethod="queryDetail1">
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="120" align="center"/>
<%--<EF:EFColumn ename="docId" cname="附件" width="100" enable="false" readonly="true" align="center"/>--%> <%--<EF:EFColumn ename="docId" cname="附件" width="100" enable="false" readonly="true" align="center"/>--%>
<EF:EFColumn ename="upkeepDate" cname="记录日期" width="120" enable="true" align="center" editType="date" <EF:EFColumn ename="recordDate" cname="记录日期" width="120" enable="true" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true"/> dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true"/>
<EF:EFColumn ename="upkeepCode" cname="记录单号" width="100" enable="false" readonly="true" align="center" required="true"/> <EF:EFColumn ename="recordCode" cname="记录单号" width="100" enable="false" readonly="true" align="center" required="true"/>
<EF:EFColumn ename="checkDescrip" cname="安全事故描述" editType="textarea" width="160" align="center"/> <EF:EFColumn ename="secureDesc" cname="安全事故描述" editType="textarea" width="160" align="center"/>
<EF:EFColumn cname="记录人" ename="createdName" align="center" width="100" readonly="true" required="false" enable="false"/> <EF:EFColumn cname="记录人" ename="createdName" align="center" width="100" readonly="true" required="false" enable="false"/>
</EF:EFGrid> </EF:EFGrid>
</EF:EFRegion> </EF:EFRegion>
......
<%--
Created by IntelliJ IDEA.
User: 1
Date: 2024/8/15
Time: 9:15
To change this template use File | Settings | File Templates.
--%>
<!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}"/>
<head>
<%-- <link rel="stylesheet" href="${ctx}/css/simulatedOperation.css"/>--%>
</head>
<EF:EFPage title="销售管理">
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<EF:EFInput ename="inqu_status-0-projCode" cname="项目编码" colWidth="3"/>
<EF:EFInput ename="inqu_status-0-projName" cname="项目名称" colWidth="3"/>
<EF:EFSelect ename="inqu_status-0-projType" cname="项目类型" colWidth="3" filter="contains"
template="#=textField#" valueTemplate="#=textField#">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hpjx.hpsc.projType"/>
</EF:EFSelect>
<EF:EFSelect cname="单据状态" optionLabel="全部" ename="inqu_status-0-status" colWidth="3">
<EF:EFOption label="未提交" value="0"/>
<EF:EFOption label="已提交" value="1"/>
</EF:EFSelect>
<EF:EFSelect cname="项目负责人" ename="inqu_status-0-princ1" colWidth="3" filter="contains" defultValue="">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="user_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFSelect cname="客户负责人" ename="inqu_status-0-princ2" colWidth="3" filter="contains" defultValue="">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="customer_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFDatePicker ename="inqu_status-0-deliveryDate" cname="交货日期" role="date" format="yyyy-MM-dd" parseFormats="['yyyyMMdd']" colWidth="3"/>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="记录集">
<EF:EFGrid blockId="result" autoDraw="no" isFloat="true">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="100" align="center"/>
<EF:EFColumn ename="projCode" cname="项目编码" enable="false" width="100" align="center"/>
<EF:EFComboColumn ename="projType" cname="项目类型" width="100" align="center" required="true"
columnTemplate="#=textField#" itemTemplate="#=textField#" readonly="true">
<EF:EFCodeOption codeName="hpjx.hpsc.projType"/>
</EF:EFComboColumn>
<EF:EFColumn required="true" ename="projName" cname="项目名称" readonly="true"/>
<EF:EFComboColumn ename="princ1" cname="项目负责人" width="120" align="center" required="true"
blockName="user_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#" readonly="true"
filter="contains">
</EF:EFComboColumn>
<EF:EFColumn ename="princ2" cname="客户负责人" width="120" align="center" maxLength="50" hidden="true"/>
<EF:EFColumn ename="princ2Name" cname="客户负责人" width="120" align="center" maxLength="50" required="true"/>
<%--<EF:EFComboColumn ename="princ2" cname="客户负责人" width="120" align="center" required="true"
blockName="customer_record_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#" readonly="true"
filter="contains">
</EF:EFComboColumn>--%>
<EF:EFColumn ename="deliveryDate" cname="交货日期" width="100" align="center"
editType="date" dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true"/>
<EF:EFComboColumn ename="status" cname="状态" enable="false" width="100" align="center" defaultValue="0">
<EF:EFOption label="未提交" value="0"/>
<EF:EFOption label="已提交" value="1"/>
</EF:EFComboColumn>
<EF:EFColumn ename="remark" cname="备注" editType="textarea"/>
</EF:EFGrid>
</EF:EFRegion>
<EF:EFRegion id="detail" title="明细信息">
<EF:EFGrid blockId="detail" autoDraw="no" isFloat="true">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="lv" cname="层级" defaultValue="2" hidden="true"/>
<EF:EFColumn ename="projCode" cname="项目编码" enable="false" hidden="true"/>
<EF:EFColumn ename="projName" cname="项目名称" enable="false" hidden="true"/>
<EF:EFColumn ename="parentId" cname="上级部件名称" enable="false" hidden="true"/>
<EF:EFColumn ename="parentPrdtName" cname="上级部件名称" enable="false" hidden="true"/>
<EF:EFColumn ename="status" cname="提交状态" enable="false" hidden="true"/>
<EF:EFColumn ename="pgStatus" cname="派工状态" enable="false" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="120" align="center" hidden="true"/>
<EF:EFComboColumn ename="prdtType" cname="部件类型" align="center" required="true"
filter="contains" width="90" enable="false" hidden="true">
<EF:EFOptions blockId="codeset_code_block_id" valueField="valueField" textField="textField"/>
</EF:EFComboColumn>
<EF:EFColumn ename="prdtCode" cname="部件编码" hidden='true'/>
<EF:EFColumn ename="prdtName" cname="部件名称" width="140" align="center" maxLength="50" required="true"/>
<EF:EFColumn ename="length" cname="长(MM)" width="80" format="{0:N0}" maxLength="12" displayType="0.000"
data-regex="/^-?[0-9]{1,9}([.][0-9]{1,3})?$/"
data-errorprompt="请输入数字,该值最大可设置9位整数!"/>
<EF:EFColumn ename="width" cname="宽(MM)" width="80" format="{0:N0}" maxLength="12" displayType="0.000"
data-regex="/^-?[0-9]{1,9}([.][0-9]{1,3})?$/"
data-errorprompt="请输入数字,该值最大可设置9位整数!"/>
<EF:EFColumn ename="thick" cname="厚(MM)" width="80" format="{0:N0}" maxLength="12" displayType="0.000"
data-regex="/^-?[0-9]{1,9}([.][0-9]{1,3})?$/"
data-errorprompt="请输入数字,该值最大可设置9位整数!"/>
<EF:EFColumn ename="deliveryDate" cname="交货日期" width="100" editType="date" required='true' align="center"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']"/>
<EF:EFColumn ename="num" cname="数量" maxLength="15" displayType="0.000" format="{0:N0}%" required="true"
data-regex="/^-?[0-9]{1,12}([.][0-9]{1,3})?$/" defaultValue="100"
data-errorprompt="请输入数字,该值最大可设置12位整数和3位小数!"/>
<EF:EFColumn ename="unitWt" format="{0:N3}" cname="单重(T)" maxLength="15" displayType="0.000" required="true"
data-regex="/^-?[0-9]{1,12}([.][0-9]{1,3})?$/" defaultValue="0" hidden = "true"
data-errorprompt="请输入数字,该值最大可设置12位整数和3位小数!"/>
<EF:EFColumn ename="totalWt" cname="总重(T)" enable="false" width="100" align="right" format="{0:N3}" defaultValue="0" hidden="true"/>
<EF:EFColumn ename="remark" cname="备注" editType="textarea"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
...@@ -268,11 +268,11 @@ $(function () { ...@@ -268,11 +268,11 @@ $(function () {
let eiInfo = new EiInfo(); let eiInfo = new EiInfo();
let selectTreeNode = IPLATUI.EFTree.materialTree.selectTreeNode; let selectTreeNode = IPLATUI.EFTree.materialTree.selectTreeNode;
if (selectTreeNode.lv == 1) { if (selectTreeNode.lv == 1) {
eiInfo.set("inventType", 4); eiInfo.set("inqu_status-0-inventType", 4);
} else if (selectTreeNode.lv == 2) { } else if (selectTreeNode.lv == 2) {
eiInfo.set("inventTypes", [2, 3]); eiInfo.set("inqu_status-0-inventTypes", [2, 3]);
} else { } else {
eiInfo.set("inventTypes", [3, 4]); eiInfo.set("inqu_status-0-inventTypes", [3, 4]);
} }
eiInfo.set("isSplicingSymbol", false); eiInfo.set("isSplicingSymbol", false);
var dataSource; var dataSource;
...@@ -310,7 +310,7 @@ $(function () { ...@@ -310,7 +310,7 @@ $(function () {
} }
}, { }, {
field: "num", field: "num",
format: "{0:N2}", format: "{0:N0}",
template: function (dataItem) { template: function (dataItem) {
return kendo.format("{0:N0}%",+dataItem.num); return kendo.format("{0:N0}%",+dataItem.num);
} }
......
...@@ -63,8 +63,7 @@ ...@@ -63,8 +63,7 @@
<EF:EFOptions blockId="codeset_code_block_id" valueField="valueField" textField="textField"/> <EF:EFOptions blockId="codeset_code_block_id" valueField="valueField" textField="textField"/>
</EF:EFComboColumn> </EF:EFComboColumn>
<EF:EFColumn ename="prdtCode" cname="部件编码" hidden='true'/> <EF:EFColumn ename="prdtCode" cname="部件编码" hidden='true'/>
<EF:EFColumn ename="prdtName" cname="部件名称" width="140" align="center" maxLength="50" <EF:EFColumn ename="prdtName" cname="部件名称" width="140" align="center" maxLength="50" required="true"/>
required="true"/>
<EF:EFColumn ename="length" cname="长/φ(MM)" width="80" format="{0:N0}" maxLength="12" displayType="0" <EF:EFColumn ename="length" cname="长/φ(MM)" width="80" format="{0:N0}" maxLength="12" displayType="0"
data-regex="/^-?[0-9]{1,9}$/" data-regex="/^-?[0-9]{1,9}$/"
data-errorprompt="请输入数字,该值最大可设置9位整数!"/> data-errorprompt="请输入数字,该值最大可设置9位整数!"/>
...@@ -76,7 +75,7 @@ ...@@ -76,7 +75,7 @@
data-errorprompt="请输入数字,该值最大可设置9位整数!"/> data-errorprompt="请输入数字,该值最大可设置9位整数!"/>
<EF:EFColumn enable="false" ename="parentId" hidden="true" cname="上级部件名称"/> <EF:EFColumn enable="false" ename="parentId" hidden="true" cname="上级部件名称"/>
<EF:EFColumn enable="false" ename="parentPrdtName" hidden="true" cname="上级部件名称"/> <EF:EFColumn enable="false" ename="parentPrdtName" hidden="true" cname="上级部件名称"/>
<EF:EFColumn ename="num" cname="数量" maxLength="15" displayType="0.000" <EF:EFColumn ename="num" cname="数量" maxLength="15" displayType="0.000" defaultValue = '100'
data-regex="/^-?[0-9]{1,12}([.][0-9]{1,3})?$/" data-regex="/^-?[0-9]{1,12}([.][0-9]{1,3})?$/"
data-errorprompt="请输入数字,该值最大可设置12位整数和3位小数!"/> data-errorprompt="请输入数字,该值最大可设置12位整数和3位小数!"/>
<EF:EFColumn ename="totalWt" cname="总重(T)" enable="true" width="100" align="right" format="{0:N3}" sumType="all" <EF:EFColumn ename="totalWt" cname="总重(T)" enable="true" width="100" align="right" format="{0:N3}" sumType="all"
...@@ -92,7 +91,7 @@ ...@@ -92,7 +91,7 @@
<EF:EFOption label="未提交" value="0"/> <EF:EFOption label="未提交" value="0"/>
<EF:EFOption label="已提交" value="1"/> <EF:EFOption label="已提交" value="1"/>
</EF:EFComboColumn> </EF:EFComboColumn>
<EF:EFColumn ename="remark" cname="备注" /> <EF:EFColumn ename="remark" cname="备注" editType="textarea"/>
</EF:EFGrid> </EF:EFGrid>
</EF:EFRegion> </EF:EFRegion>
</div> </div>
......
...@@ -15,7 +15,8 @@ $(function () { ...@@ -15,7 +15,8 @@ $(function () {
pageSize: 20, pageSize: 20,
pageSizes: [10, 20, 50, 70, 100], pageSizes: [10, 20, 50, 70, 100],
}, },
columns: [{ columns: [
{
field: "operator", field: "operator",
template: function (item) { template: function (item) {
let status = item.status; let status = item.status;
...@@ -35,7 +36,6 @@ $(function () { ...@@ -35,7 +36,6 @@ $(function () {
} }
return template return template
} }
}, },
{ {
field: "prodOrderNo", field: "prodOrderNo",
...@@ -46,9 +46,7 @@ $(function () { ...@@ -46,9 +46,7 @@ $(function () {
+' onclick="tearDetails(\'' + prodOrderNo + '\')" >' + prodOrderNo + '</a>'; +' onclick="tearDetails(\'' + prodOrderNo + '\')" >' + prodOrderNo + '</a>';
return template return template
} }
} }
] ]
} }
}); });
......
...@@ -60,8 +60,8 @@ ...@@ -60,8 +60,8 @@
editType="date" dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']"/> editType="date" dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']"/>
<EF:EFColumn ename="planCompletionDate" cname="计划完成日期" enable="false" width="100" align="center" <EF:EFColumn ename="planCompletionDate" cname="计划完成日期" enable="false" width="100" align="center"
editType="date" dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']"/> editType="date" dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']"/>
<EF:EFColumn ename="assignedNum" cname="派工数量" enable="false" width="80" align="right" format="{0:N0}%"/> <%--<EF:EFColumn ename="assignedNum" cname="派工数量" enable="false" width="80" align="right" format="{0:N0}%"/>
<EF:EFColumn ename="unassignedNum" cname="剩余数量" enable="false" width="80" align="right" format="{0:N0}%"/> <EF:EFColumn ename="unassignedNum" cname="剩余数量" enable="false" width="80" align="right" format="{0:N0}%"/>--%>
<EF:EFColumn ename="num" cname="数量" enable="false" width="80" align="right" format="{0:N0}%"/> <EF:EFColumn ename="num" cname="数量" enable="false" width="80" align="right" format="{0:N0}%"/>
<EF:EFColumn ename="totalWt" cname="总重(T)" enable="false" width="80" align="right" format="{0:N3}"/> <EF:EFColumn ename="totalWt" cname="总重(T)" enable="false" width="80" align="right" format="{0:N3}"/>
<%--<EF:EFColumn ename="remark" cname="部件备注" enable="false"/>--%> <%--<EF:EFColumn ename="remark" cname="部件备注" enable="false"/>--%>
......
...@@ -32,7 +32,7 @@ $(function () { ...@@ -32,7 +32,7 @@ $(function () {
message("报工数量必须是大于0的正整数"); message("报工数量必须是大于0的正整数");
return ; return ;
} }
if (unregisterQuantity<quantity){ if (unregisterQuantity-quantity < 0){
message("报工数量不能大于剩余数量"); message("报工数量不能大于剩余数量");
return ; return ;
} }
......
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