Commit 097491c0 by liuyang

Merge branch 'dev' of https://gitlab.baocloud.cn/bggf/smart/hp-smart into dev

parents 91eee8cf 6a0c3993
package com.baosight.hpjx.core.enums;
/**
* @author:songx
* @date:2024/3/1,17:29
*/
public enum UserStatusEnum {
ONLINE(1, "在职"),
OFFLINE(2, "离职"),
;
private Integer code;
private String value;
UserStatusEnum(Integer code, String value) {
this.code = code;
this.value = value;
}
public Integer getCode() {
return code;
}
public void setCode(Integer code) {
this.code = code;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
}
......@@ -14,6 +14,8 @@ public class HPConstant {
*/
public class SequenceId {
// 用户ID
public static final String USER_ID = "USER_ID";
// 组织机构编码
public static final String ORG_CODE = "ORG_CODE";
// 组编码
......
......@@ -233,6 +233,18 @@ public class HPSqlConstant {
}
/**
* HPKC013 SQL 定义
*
* @author:songx
* @date:2024/1/20,16:45
*/
public class HPKC013 {
// 锁
public static final String UPDATE_STATUS = "HPKC013.updateStatus";
}
/**
* HPPZ010 SQL 定义
*
* @author:songx
......@@ -259,6 +271,30 @@ public class HPSqlConstant {
}
/**
* HPPZ013 SQL 定义
*
* @author:songx
* @date:2024/1/18,17:17
*/
public class HPPZ013 {
// 查询
public static final String UPDATE_STATUS = "HPPZ013.updateStatus";
}
/**
* HPPZ014 SQL 定义
*
* @author:songx
* @date:2024/1/18,17:17
*/
public class HPPZ014 {
// 查询
public static final String UPDATE_TIME = "HPPZ014.updateTime";
}
/**
* HPSC003 SQL名称定义
*
* @author:songx
......@@ -340,6 +376,11 @@ public class HPSqlConstant {
// 已处理
public static final String DO_PROCESS = "HPZL001.doProcess";
// 已处理
public static final String DO_PROCESS2 = "HPZL001.doProcess2";
}
}
package com.baosight.hpjx.hp.ff.service;
import com.baosight.hpjx.common.HPConstants;
import com.baosight.hpjx.core.constant.CommonConstant;
import com.baosight.hpjx.hp.sc.domain.HPSC002;
import com.baosight.hpjx.hp.sc.domain.HPSC006;
import com.baosight.hpjx.hp.sc.tools.HPSCTools;
import com.baosight.hpjx.util.ExcelUtils;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class ServiceHPFF001 extends ServiceEPBase {
......@@ -48,7 +51,14 @@ public class ServiceHPFF001 extends ServiceEPBase {
map1.put("productionOrderNo",productionOrderNo);
map1.put("inventType","7");
ExcelUtils.importFromExcel(inInfo, fileName,map1, new HPSC006());
inInfo = this.refreshHPSC006(inInfo, productionOrderNo);
}
return inInfo;
}
private EiInfo refreshHPSC006(EiInfo inInfo, String productionOrderNo) {
List<HPSC006> HPSC006 = HPSCTools.Hpsc006.get(productionOrderNo);
inInfo.addBlock(CommonConstant.Field.DETAIL).addRows(HPSC006);
return inInfo;
}
}
......@@ -38,6 +38,7 @@ public class HPKC011 extends DaoEPBase {
public static final String FIELD_LENGTH = "length"; /* 长*/
public static final String FIELD_WIDTH = "width"; /* 宽*/
public static final String FIELD_THICK = "thick"; /* 厚*/
public static final String FIELD_PRDT_SPEC = "prdtSpec"; /* 产品规格*/
public static final String FIELD_AMOUNT = "amount"; /* 数量*/
public static final String FIELD_UNIT_WEIGHT = "unitWeight"; /* 单重*/
public static final String FIELD_WEIGHT = "weight"; /* 重量*/
......@@ -65,6 +66,7 @@ public class HPKC011 extends DaoEPBase {
public static final String COL_LENGTH = "FIELD_LENGTH"; /* 长*/
public static final String COL_WIDTH = "FIELD_WIDTH"; /* 宽*/
public static final String COL_THICK = "FIELD_THICK"; /* 厚*/
public static final String COL_PRDT_SPEC = "PRDT_SPEC"; /* 产品规格*/
public static final String COL_AMOUNT = "FIELD_AMOUNT"; /* 数量*/
public static final String COL_UNIT_WEIGHT = "FIELD_UNIT_WEIGHT"; /* 单重*/
public static final String COL_WEIGHT = "FIELD_WEIGHT"; /* 重量*/
......@@ -98,6 +100,9 @@ public class HPKC011 extends DaoEPBase {
private BigDecimal length = new BigDecimal("0"); /* 长*/
private BigDecimal width = new BigDecimal("0"); /* 宽*/
private BigDecimal thick = new BigDecimal("0"); /* 厚*/
private String prdtSpec = " "; /* 产品规格*/
private BigDecimal amount = new BigDecimal("0"); /* 数量*/
private BigDecimal unitWeight = new BigDecimal("0"); /* 单重*/
private BigDecimal weight = new BigDecimal("0"); /* 重量*/
......@@ -186,6 +191,10 @@ public class HPKC011 extends DaoEPBase {
eiColumn.setDescName("厚");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_PRDT_SPEC);
eiColumn.setDescName("产品规格");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_AMOUNT);
eiColumn.setType("N");
eiColumn.setScaleLength(2);
......@@ -362,6 +371,23 @@ public class HPKC011 extends DaoEPBase {
public void setInventName(String inventName) {
this.inventName = inventName;
}
/**
* get the prdtSpec - 产品规格.
* @return the prdtSpec
*/
public String getPrdtSpec() {
return this.prdtSpec;
}
/**
* set the prdtSpec - 产品规格.
*
* @param prdtSpec - 产品规格
*/
public void setPrdtSpec(String prdtSpec) {
this.prdtSpec = prdtSpec;
}
/**
* get the amount - 数量.
* @return the amount
......@@ -610,6 +636,7 @@ public class HPKC011 extends DaoEPBase {
setLength(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_LENGTH)), length));
setWeight(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_WIDTH)), width));
setThick(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_THICK)), thick));
setPrdtSpec(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PRDT_SPEC)), prdtSpec));
setAmount(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_AMOUNT)), amount));
setUnitWeight(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_UNIT_WEIGHT)), unitWeight));
setWeight(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_WEIGHT)), weight));
......@@ -645,6 +672,7 @@ public class HPKC011 extends DaoEPBase {
map.put(FIELD_LENGTH, StringUtils.toString(length, eiMetadata.getMeta(FIELD_LENGTH)));
map.put(FIELD_WIDTH, StringUtils.toString(width, eiMetadata.getMeta(FIELD_WIDTH)));
map.put(FIELD_THICK, StringUtils.toString(thick, eiMetadata.getMeta(FIELD_THICK)));
map.put(FIELD_PRDT_SPEC, StringUtils.toString(prdtSpec, eiMetadata.getMeta(FIELD_PRDT_SPEC)));
map.put(FIELD_AMOUNT, StringUtils.toString(amount, eiMetadata.getMeta(FIELD_AMOUNT)));
map.put(FIELD_UNIT_WEIGHT, StringUtils.toString(unitWeight, eiMetadata.getMeta(FIELD_UNIT_WEIGHT)));
map.put(FIELD_WEIGHT, StringUtils.toString(weight, eiMetadata.getMeta(FIELD_WEIGHT)));
......
......@@ -196,6 +196,7 @@ public class ServiceHPKC011 extends ServiceBase {
hpkc011.setLength(hpsc005.getPartLength());
hpkc011.setWidth(hpsc005.getPartWidth());
hpkc011.setThick(hpsc005.getPartThick());
hpkc011.setPrdtSpec(hpsc005.getPrdtSpec());
hpkc011.setUnitWeight(hpsc005.getUnitWt());
hpkc011.setRemark(hpsc005.getRemark1());
}catch (Exception e){
......
......@@ -18,6 +18,7 @@
LENGTH as "length", <!-- 长 -->
WIDTH as "width", <!-- 宽 -->
THICK as "thick", <!-- 厚 -->
PRDT_SPEC as "prdtSpec", <!-- 产品规格 -->
AMOUNT as "amount", <!-- 数量 -->
UNIT_WEIGHT as "unitWeight", <!-- 单重 -->
WEIGHT as "weight", <!-- 重量 -->
......@@ -136,6 +137,7 @@
LENGTH, <!-- 长 -->
WIDTH, <!-- 宽 -->
THICK, <!-- 厚 -->
PRDT_SPEC, <!-- 产品规格 -->
AMOUNT, <!-- 数量 -->
UNIT_WEIGHT, <!-- 单重 -->
WEIGHT, <!-- 重量 -->
......@@ -149,7 +151,7 @@
VERSION
) VALUES (
#companyCode#, #depCode#, #whCode#, #whName#, #prodNo#, #projCode#, #projName#,
#inventCode#, #inventName#, #subInventCode#, #subInventName#, #length#, #width#, #thick#,
#inventCode#, #inventName#, #subInventCode#, #subInventName#, #length#, #width#, #thick#,#prdtSpec#,
#amount#, #unitWeight#, #weight#, #remark#,
#createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#,
#updatedTime#, #version#
......
......@@ -14,10 +14,7 @@ import com.baosight.hpjx.hp.pz.domain.HPPZ011;
import com.baosight.hpjx.hp.sc.domain.HPSC002A;
import com.baosight.hpjx.hp.sc.domain.HPSC005;
import com.baosight.hpjx.hp.zl.domain.HPZL001;
import com.baosight.hpjx.util.CommonMethod;
import com.baosight.hpjx.util.EiInfoUtils;
import com.baosight.hpjx.util.LogUtils;
import com.baosight.hpjx.util.StringUtil;
import com.baosight.hpjx.util.*;
import com.baosight.iplat4j.config.AdminFactoryConfig;
import com.baosight.iplat4j.core.ei.EiBlock;
import com.baosight.iplat4j.core.ei.EiConstant;
......@@ -27,6 +24,7 @@ import com.baosight.iplat4j.ed.util.SequenceGenerator;
import org.apache.commons.collections.MapUtils;
import org.springframework.web.multipart.commons.CommonsMultipartFile;
import java.text.SimpleDateFormat;
import java.util.*;
/**
......@@ -153,10 +151,12 @@ public class ServiceHPMT002 extends ServiceBase {
if (StrUtil.isEmpty(companyCode)) {
inInfo.setMsg("账号异常");
}
Map sqlMap = new HashMap();
sqlMap.put("companyCode", companyCode);
EiInfo outInfo = new EiInfo();
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.ORG_PROD_BLOCK_ID), null, false);
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.PROJ_RECORD_BLOCK_ID), null, false);
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.INVENT_RECORD_BLOCK_ID), null, false);
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.ORG_PROD_BLOCK_ID), sqlMap, false);
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.PROJ_RECORD_BLOCK_ID), sqlMap, false);
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.INVENT_RECORD_BLOCK_ID), sqlMap, false);
return outInfo;
}
......@@ -180,28 +180,31 @@ public class ServiceHPMT002 extends ServiceBase {
sqlMap.put("companyCode", companyCode);
sqlMap.put("projCode", projCode);
sqlMap.put("prodOrderNo", prodOrderNo);
HPSC005 HPSC005 =(HPSC005) dao.query("HPSC005.query",sqlMap );
List<HPSC005> HPSC005 = dao.query("HPSC005.query", sqlMap);
HPZL001 fZl001 = new HPZL001();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
fZl001.fromMap(queryMap);
fZl001.setProjName(HPSC005.getProjName());
fZl001.setOrgName(HPSC005.getOrgName());
fZl001.setInventName(HPSC005.getPrdtName());
fZl001.setSubInventName(HPSC005.getPartName());
// 去除日期字符串中的-
fZl001.setReceiptDate(StringUtil.removeHorizontalLine(fZl001.getReceiptDate()));
fZl001.setProjName(HPSC005.get(0).getProjName());
fZl001.setOrgName(HPSC005.get(0).getOrgName());
fZl001.setInventName(HPSC005.get(0).getPrdtName());
fZl001.setSubInventName(HPSC005.get(0).getPartName());
fZl001.setCreatedTime(sdf.format(new Date()));
fZl001.setReceiptDate(DateUtils.shortDate());
// 生成单据号
fZl001.setCheckNo(SequenceGenerator.getNextSequence(
HPConstant.SequenceId.HPZL001_NUMBER));
fZl001.setDeleteFlag(CommonConstant.YesNo.NO_0);
fZl001.setStatus(CommonConstant.YesNo.NO_0);
DaoUtils.insert(HPZL001.INSERT, fZl001);
//处理文件
Map fZl0012 = new HashMap();
fZl0012.put("checkNo", fZl001.getCheckNo());
HPZL001 HPZL001 =(HPZL001) dao.query("HPZL001.query",fZl0012);
//绑定文件
if(!fZl001.getCheckNo().equals(" ")) {
Map fZl0012 = new HashMap();
fZl0012.put("checkNo", fZl001.getCheckNo());
HPZL001 HPZL001 = (HPZL001) dao.query("HPZL001.query", fZl0012);
//绑定文件
String[] docIds = docId.split(",");
int num=0;
while (num<=docIds.length){
int num = 0;
while (num <= docIds.length) {
HPSC002A HPSC002A = new HPSC002A();
HPSC002A.setBizType(CommonConstant.YesNo.NO_0.toString());
HPSC002A.setDocId(docIds[num]);
......@@ -210,6 +213,7 @@ public class ServiceHPMT002 extends ServiceBase {
DaoUtils.insert(HPSC002A.INSERT, HPSC002A);
num++;
}
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("新增成功!");
} catch (Exception e) {
......@@ -237,24 +241,25 @@ public class ServiceHPMT002 extends ServiceBase {
fZl001.fromMap(queryMap);
// 去除日期字符串中的-
fZl001.setReceiptDate(StringUtil.removeHorizontalLine(fZl001.getReceiptDate()));
fZl001.setDeleteFlag(CommonConstant.YesNo.YES_1);
DaoUtils.update(HPSqlConstant.HPZL001.DO_PROCESS, fZl001);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
fZl001.setStatus(CommonConstant.YesNo.YES_1);
DaoUtils.update(HPSqlConstant.HPZL001.DO_PROCESS2, fZl001);
//绑定文件
String[] docIds = docId.split(",");
int num=0;
while (num<=docIds.length){
HPSC002A HPSC002A = new HPSC002A();
HPSC002A.setBizType(CommonConstant.YesNo.NO_0.toString());
HPSC002A.setDocId(docIds[num]);
HPSC002A.setMatId(fZl001.getId());
HPSC002A.setCompanyCode(companyCode);
DaoUtils.insert(HPSC002A.INSERT, HPSC002A);
num++;
if(!docId.equals(" ")) {
String[] docIds = docId.split(",");
int num = 0;
while (num <= docIds.length) {
HPSC002A HPSC002A = new HPSC002A();
HPSC002A.setBizType(CommonConstant.YesNo.NO_0.toString());
HPSC002A.setDocId(docIds[num]);
HPSC002A.setMatId(fZl001.getId());
HPSC002A.setCompanyCode(companyCode);
DaoUtils.insert(HPSC002A.INSERT, HPSC002A);
num++;
}
}
inInfo.setMsg("新增成功!");
inInfo.setMsg("处理成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "新增失败");
LogUtils.setDetailMsg(inInfo, e, "处理失败");
}
return inInfo;
}
......
package com.baosight.hpjx.hp.pz.domain;
import com.baosight.iplat4j.core.ei.EiColumn;
import com.baosight.iplat4j.core.util.StringUtils;
import java.util.HashMap;
import java.util.Map;
/**
* Project: <br>
* Title:THppz013.java <br>
* Description: <br>
*
* Copyrigth:Baosight Software LTD.co Copyright (c) 2019. <br>
*
* @version 1.0
* @history 2024-03-07 11:17:57 create
*/
public class HPPZ01301 extends HPPZ013 {
private static final long serialVersionUID = 1L;
public static final String FIELD_GENDER = "gender"; /* 性别*/
public static final String FIELD_MOBILE = "mobile"; /* 联系方式*/
public static final String COL_GENDER = "GENDER"; /* 性别*/
public static final String COL_MOBILE = "MOBILE"; /* 联系方式*/
private String gender = " "; /* 性别*/
private String mobile = " "; /* 联系方式*/
/**
* initialize the metadata.
*/
public void initMetaData() {
EiColumn eiColumn;
eiColumn = new EiColumn(FIELD_GENDER);
eiColumn.setDescName("性别");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_MOBILE);
eiColumn.setDescName("联系方式");
eiMetadata.addMeta(eiColumn);
}
/**
* the constructor.
*/
public HPPZ01301() {
initMetaData();
}
public String getGender() {
return gender;
}
public void setGender(String gender) {
this.gender = gender;
}
public String getMobile() {
return mobile;
}
public void setMobile(String mobile) {
this.mobile = mobile;
}
/**
* get the value from Map.
*
* @param map - source data map
*/
@Override
public void fromMap(Map map) {
super.fromMap(map);
setGender(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_GENDER)), gender));
setMobile(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_MOBILE)), mobile));
}
/**
* set the value to Map.
*/
@Override
public Map toMap() {
Map map = super.toMap();
map.put(FIELD_GENDER, StringUtils.toString(gender, eiMetadata.getMeta(FIELD_GENDER)));
map.put(FIELD_MOBILE, StringUtils.toString(mobile, eiMetadata.getMeta(FIELD_MOBILE)));
return map;
}
}
package com.baosight.hpjx.hp.pz.domain;
import com.baosight.iplat4j.core.ei.EiColumn;
import com.baosight.iplat4j.core.util.StringUtils;
import java.util.Map;
/**
* Project: <br>
* Title:THppz013.java <br>
* Description: <br>
*
* Copyrigth:Baosight Software LTD.co Copyright (c) 2019. <br>
*
* @version 1.0
* @history 2024-03-07 11:17:57 create
*/
public class HPPZ01401 extends HPPZ014 {
private static final long serialVersionUID = 1L;
public static final String FIELD_GENDER = "gender"; /* 性别*/
public static final String FIELD_MOBILE = "mobile"; /* 联系方式*/
public static final String COL_GENDER = "GENDER"; /* 性别*/
public static final String COL_MOBILE = "MOBILE"; /* 联系方式*/
private String gender = " "; /* 性别*/
private String mobile = " "; /* 联系方式*/
/**
* initialize the metadata.
*/
public void initMetaData() {
EiColumn eiColumn;
eiColumn = new EiColumn(FIELD_GENDER);
eiColumn.setDescName("性别");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_MOBILE);
eiColumn.setDescName("联系方式");
eiMetadata.addMeta(eiColumn);
}
/**
* the constructor.
*/
public HPPZ01401() {
initMetaData();
}
public String getGender() {
return gender;
}
public void setGender(String gender) {
this.gender = gender;
}
public String getMobile() {
return mobile;
}
public void setMobile(String mobile) {
this.mobile = mobile;
}
/**
* get the value from Map.
*
* @param map - source data map
*/
@Override
public void fromMap(Map map) {
super.fromMap(map);
setGender(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_GENDER)), gender));
setMobile(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_MOBILE)), mobile));
}
/**
* set the value to Map.
*/
@Override
public Map toMap() {
Map map = super.toMap();
map.put(FIELD_GENDER, StringUtils.toString(gender, eiMetadata.getMeta(FIELD_GENDER)));
map.put(FIELD_MOBILE, StringUtils.toString(mobile, eiMetadata.getMeta(FIELD_MOBILE)));
return map;
}
}
......@@ -7,15 +7,15 @@ import com.baosight.hpjx.hp.constant.HPConstant;
import com.baosight.hpjx.hp.pz.domain.HPPZ009;
import com.baosight.hpjx.hp.xs.tools.HPXSTools;
import com.baosight.hpjx.util.AssertUtils;
import com.baosight.hpjx.util.DateUtils;
import com.baosight.hpjx.util.LogUtils;
import com.baosight.hpjx.util.RsaUtils;
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.ServiceBase;
import com.baosight.iplat4j.core.service.soa.XLocalManager;
import com.baosight.iplat4j.core.web.threadlocal.UserSession;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import com.baosight.xservices.xs.constants.LoginConstants;
import java.util.HashMap;
import java.util.List;
......@@ -120,9 +120,14 @@ public class ServiceHPPZ009 extends ServiceBase {
// 生成企业编码
fPz009.setCompanyCode(SequenceGenerator.getNextSequence(HPConstant.SequenceId.COMPANY_CODE));
fPz009.setDeleteFlag(CommonConstant.YesNo.NO_0);
DaoUtils.insert(HPPZ009.INSERT, fPz009);
fPz009.setCreatedBy(UserSession.getLoginName());
fPz009.setCreatedName(UserSession.getLoginCName());
fPz009.setCreatedTime(DateUtils.shortDateTime());
// 此处不能使用DaoUtils方法insert
dao.insert(HPPZ009.INSERT, fPz009);
// 默认新增企业管理员账号
this.initUser(fPz009);
HPXSTools.XsUser.addUser(fPz009.getCompanyCode(), fPz009.getCompanyCode(), fPz009.getCompanyName(),
null, null);
// 关联企业管理员角色
this.insertGroupMember(fPz009);
}
......@@ -165,34 +170,6 @@ public class ServiceHPPZ009 extends ServiceBase {
}
/**
* 初始化用户
*
* @param hppz009
*/
private void initUser(HPPZ009 hppz009) throws Exception {
String companyCode = hppz009.getCompanyCode();
Map inInfoRowMap = new HashMap();
inInfoRowMap.put("userId", companyCode);
inInfoRowMap.put("loginName", companyCode);
inInfoRowMap.put("userName", hppz009.getCompanyName());
// 使用公钥加密密码
String password = RsaUtils.encryptByPublicKey(LoginConstants.rsaPublicKey, companyCode);
inInfoRowMap.put("password", password);
inInfoRowMap.put("rePass", password);
inInfoRowMap.put("email", " ");
inInfoRowMap.put("mobile", " ");
inInfoRowMap.put("companyCode", hppz009.getCompanyCode());
EiInfo inInfo = new EiInfo();
inInfo.addBlock("details").addRow(inInfoRowMap);
inInfo.set(EiConstant.serviceName, "XS0102");
inInfo.set(EiConstant.methodName, "insert");
EiInfo outInfo = XLocalManager.call(inInfo);
if (outInfo.getStatus() < 0) {
throw new PlatException(outInfo.getMsg());
}
}
/**
* 用户关联角色
*
* @param hppz009
......
package com.baosight.hpjx.hp.pz.service;
import com.baosight.hpjx.aspect.annotation.OperationLogAnnotation;
import com.baosight.hpjx.common.DdynamicEnum;
import com.baosight.hpjx.core.constant.CommonConstant;
import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.core.enums.UserStatusEnum;
import com.baosight.hpjx.core.security.UserSessionUtils;
import com.baosight.hpjx.hp.constant.HPConstant;
import com.baosight.hpjx.hp.constant.HPSqlConstant;
import com.baosight.hpjx.hp.pz.domain.HPPZ013;
import com.baosight.hpjx.hp.pz.domain.HPPZ01301;
import com.baosight.hpjx.hp.pz.tools.HPPZTools;
import com.baosight.hpjx.hp.xs.tools.HPXSTools;
import com.baosight.hpjx.util.AssertUtils;
import com.baosight.hpjx.util.CommonMethod;
import com.baosight.hpjx.util.LogUtils;
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.ServiceBase;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
* 用工管理
*
* @author:songx
* @date:2024/1/18,17:15
*/
public class ServiceHPPZ013 extends ServiceBase {
/**
* 画面初始化
*
* @param inInfo
* @return
*/
@Override
@OperationLogAnnotation(operModul = "用工管理", operType = "查询", operDesc = "初始化")
public EiInfo initLoad(EiInfo inInfo) {
try {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.FACTORY_RECORD_BLOCK_ID), null, false);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.GROUP_RECORD_BLOCK_ID), null, false);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HPPZ01301().eiMetadata);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询数据列表
*
* @param inInfo
* @return
*/
@Override
@OperationLogAnnotation(operModul = "用工管理", operType = "查询", operDesc = "查询")
public EiInfo query(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HPPZ013.QUERY, new HPPZ01301());
// 设置用户信息
HPXSTools.XsUser.setUserInfo(inInfo, HPPZ01301.FIELD_USER_ID);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
/**
* 保存操作.
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "用工管理", operType = "新增", operDesc = "保存操作")
public EiInfo save(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 数据校验
this.checkSaveData(resultRows);
// 写入数据
this.saveData(resultRows);
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 校验保存的数据
*
* @param resultRows
*/
private void checkSaveData(List<Map> resultRows) {
for (Map resultRow : resultRows) {
HPPZ01301 fPz01301 = new HPPZ01301();
fPz01301.fromMap(resultRow);
AssertUtils.isEmpty(fPz01301.getFactoryCode(), "请选择工厂");
AssertUtils.isEmpty(fPz01301.getGroupType(), "请选择生产组类型");
AssertUtils.isEmpty(fPz01301.getGroupCode(), "请选择生产组");
AssertUtils.isEmpty(fPz01301.getUserName(), "请输入姓名");
AssertUtils.isEmpty(fPz01301.getGender(), "请选择性别");
AssertUtils.isEmpty(fPz01301.getMobile(), "请输入联系方式");
}
}
/**
* 保存数据
*
* @param resultRows
*/
private void saveData(List<Map> resultRows) throws Exception {
for (Map resultRow : resultRows) {
HPPZ01301 fPz01301 = new HPPZ01301();
fPz01301.fromMap(resultRow);
// 设置基础信息
this.setBaseInfo(fPz01301);
if (fPz01301.getId() == null || fPz01301.getId() == 0) {
this.add(fPz01301);
} else {
this.modify(fPz01301);
}
}
}
/**
* 设置基础信息
*
* @param fPz01301
*/
private void setBaseInfo(HPPZ01301 fPz01301) {
// 厂区名称
fPz01301.setFactoryName(HPXSTools.XsOrg.get(fPz01301.getFactoryCode()).getOrgCname());
// 组名称
fPz01301.setGroupName(HPXSTools.XsOrg.get(fPz01301.getGroupCode()).getOrgCname());
// 在职状态
if (fPz01301.getStatus() == null) {
fPz01301.setStatus(UserStatusEnum.ONLINE.getCode());
}
}
/**
* 新增数据
*
* @param fPz01301
*/
private void add(HPPZ01301 fPz01301) throws Exception {
// 新增用户信息
String companyCode = UserSessionUtils.getCompanyCode();
String loginPrefix = HPPZTools.HpPz009.getByCode(UserSessionUtils.getCompanyCode()).getLoginPrefix();
String userId = SequenceGenerator.getNextSequence(HPConstant.SequenceId.USER_ID, new String[]{loginPrefix});
HPXSTools.XsUser.addUser(companyCode, userId, fPz01301.getUserName(), fPz01301.getGender(),
fPz01301.getMobile());
fPz01301.setUserId(userId);
fPz01301.setDeleteFlag(CommonConstant.YesNo.NO_0);
DaoUtils.insert(HPPZ013.INSERT, fPz01301);
}
/**
* 修改数据
*
* @param fPz01301
*/
private void modify(HPPZ01301 fPz01301) {
DaoUtils.update(HPSqlConstant.HPPZ013.UPDATE_STATUS, fPz01301);
}
/**
* 删除操作
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "用工登记", operType = "删除", operDesc = "删除操作")
public EiInfo delete(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (Map resultRow : resultRows) {
HPPZ013 fPz013 = new HPPZ013();
fPz013.fromMap(resultRow);
fPz013.setDeleteFlag(CommonConstant.YesNo.YES_1);
DaoUtils.update(HPPZ013.DELETE, fPz013);
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据删除成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "修改失败");
}
return inInfo;
}
}
package com.baosight.hpjx.hp.pz.service;
import com.baosight.hpjx.aspect.annotation.OperationLogAnnotation;
import com.baosight.hpjx.util.LogUtils;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.service.impl.ServiceBase;
/**
* 用工管理
*
* @author:songx
* @date:2024/1/18,17:15
*/
public class ServiceHPPZ013A extends ServiceBase {
/**
* 画面初始化
*
* @param inInfo
* @return
*/
@Override
@OperationLogAnnotation(operModul = "用工登记", operType = "查询", operDesc = "初始化")
public EiInfo initLoad(EiInfo inInfo) {
try {
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
}
package com.baosight.hpjx.hp.pz.service;
import com.baosight.hpjx.aspect.annotation.OperationLogAnnotation;
import com.baosight.hpjx.common.DdynamicEnum;
import com.baosight.hpjx.core.constant.CommonConstant;
import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.core.enums.UserStatusEnum;
import com.baosight.hpjx.core.security.UserSessionUtils;
import com.baosight.hpjx.hp.constant.HPConstant;
import com.baosight.hpjx.hp.constant.HPSqlConstant;
import com.baosight.hpjx.hp.pz.domain.HPPZ013;
import com.baosight.hpjx.hp.pz.domain.HPPZ01301;
import com.baosight.hpjx.hp.pz.domain.HPPZ014;
import com.baosight.hpjx.hp.pz.domain.HPPZ01401;
import com.baosight.hpjx.hp.pz.tools.HPPZTools;
import com.baosight.hpjx.hp.xs.tools.HPXSTools;
import com.baosight.hpjx.util.AssertUtils;
import com.baosight.hpjx.util.CommonMethod;
import com.baosight.hpjx.util.DateUtils;
import com.baosight.hpjx.util.EiInfoUtils;
import com.baosight.hpjx.util.LogUtils;
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.ServiceBase;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import org.apache.commons.collections.CollectionUtils;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 用工登记
*
* @author:songx
* @date:2024/1/18,17:15
*/
public class ServiceHPPZ014 extends ServiceBase {
/**
* 画面初始化
*
* @param inInfo
* @return
*/
@Override
@OperationLogAnnotation(operModul = "用工登记", operType = "查询", operDesc = "初始化")
public EiInfo initLoad(EiInfo inInfo) {
try {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.FACTORY_RECORD_BLOCK_ID), null, false);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.GROUP_RECORD_BLOCK_ID), null, false);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HPPZ01401().eiMetadata);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询数据列表
*
* @param inInfo
* @return
*/
@Override
@OperationLogAnnotation(operModul = "用工登记", operType = "查询", operDesc = "查询")
public EiInfo query(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HPPZ014.QUERY, new HPPZ01401());
// 设置用户信息
HPXSTools.XsUser.setUserInfo(inInfo, HPPZ01401.FIELD_USER_ID);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
/**
* 用工登记.
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "用工登记", operType = "新增", operDesc = "用工登记")
public EiInfo checkIn(EiInfo inInfo) {
try {
// 登记日期
Map queryMap = EiInfoUtils.getFirstRow(inInfo, "main");
String regDate = DateUtils.formatShort(queryMap.get("regDate"));
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 写入数据
this.saveData(resultRows, regDate);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据登记成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "登记失败");
}
return inInfo;
}
/**
* 保存数据
*
* @param resultRows
* @param regDate
*/
private void saveData(List<Map> resultRows, String regDate) {
for (Map resultRow : resultRows) {
HPPZ014 fPz014 = new HPPZ014();
fPz014.fromMap(resultRow);
fPz014.setRegDate(regDate);
// 检查用户是否已登记
Map queryMap = new HashMap();
queryMap.put("factoryCode", fPz014.getFactoryCode());
queryMap.put("groupCode", fPz014.getGroupCode());
queryMap.put("userId", fPz014.getUserId());
queryMap.put("regDate", regDate);
List<HPPZ014> dbHp014s = dao.query(HPPZ014.QUERY, queryMap);
if (CollectionUtils.isEmpty(dbHp014s)) {
// 设置基础信息
this.setBaseInfo(fPz014);
// 写入数据
this.add(fPz014);
} else {
this.modify(fPz014);
}
}
}
/**
* 设置基础信息
*
* @param fPz014
*/
private void setBaseInfo(HPPZ014 fPz014) {
// 厂区名称
fPz014.setFactoryName(HPXSTools.XsOrg.get(fPz014.getFactoryCode()).getOrgCname());
// 组名称
fPz014.setGroupName(HPXSTools.XsOrg.get(fPz014.getGroupCode()).getOrgCname());
}
/**
* 新增数据
*
* @param fPz014
*/
private void add(HPPZ014 fPz014) {
fPz014.setDeleteFlag(CommonConstant.YesNo.NO_0);
DaoUtils.insert(HPPZ014.INSERT, fPz014);
}
/**
* 修改
*
* @param fPz014
*/
private void modify(HPPZ014 fPz014) {
DaoUtils.update(HPSqlConstant.HPPZ014.UPDATE_TIME, fPz014);
}
/**
* 删除操作
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "用工登记", operType = "删除", operDesc = "删除操作")
public EiInfo delete(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (Map resultRow : resultRows) {
HPPZ014 fPz014 = new HPPZ014();
fPz014.fromMap(resultRow);
fPz014.setDeleteFlag(CommonConstant.YesNo.YES_1);
DaoUtils.update(HPPZ014.DELETE, fPz014);
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据删除成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "修改失败");
}
return inInfo;
}
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://www.ibatis.com/dtd/sql-map-2.dtd">
<sqlMap namespace="HPPZ013">
<sql id="column">
ID as "id",
COMPANY_CODE as "companyCode", <!-- 企业编码 -->
DEP_CODE as "depCode", <!-- 部门编码 -->
CREATED_BY as "createdBy", <!-- 创建人 -->
CREATED_NAME as "createdName", <!-- 创建人名称 -->
CREATED_TIME as "createdTime", <!-- 创建时间 -->
UPDATED_BY as "updatedBy", <!-- 更新人 -->
UPDATED_NAME as "updatedName", <!-- 更新人名称 -->
UPDATED_TIME as "updatedTime", <!-- 更新时间 -->
DELETE_FLAG as "deleteFlag", <!-- 0.否1.是 -->
FACTORY_CODE as "factoryCode", <!-- 工厂编码 -->
FACTORY_NAME as "factoryName", <!-- 工厂名称 -->
GROUP_TYPE as "groupType", <!-- 部门类型 -->
GROUP_CODE as "groupCode", <!-- 生产组编码 -->
GROUP_NAME as "groupName", <!-- 生产组名称 -->
USER_ID as "userId", <!-- 用户ID -->
USER_NAME as "userName", <!-- 用户名称 -->
STATUS as "status", <!-- 状态:1-在职,2-离职 -->
REMARK as "remark" <!-- 备注 -->
</sql>
<sql id="condition">
AND DELETE_FLAG = '0'
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</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>
<isNotEmpty prepend=" AND " property="deleteFlag">
DELETE_FLAG = #deleteFlag#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryCode">
FACTORY_CODE = #factoryCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryName">
FACTORY_NAME = #factoryName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="groupType">
GROUP_TYPE = #groupType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="groupCode">
GROUP_CODE = #groupCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="groupName">
GROUP_NAME = #groupName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="userId">
USER_ID = #userId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="userName">
USER_NAME LIKE CONCAT('%', #userName#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="status">
STATUS = #status#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="remark">
REMARK = #remark#
</isNotEmpty>
</sql>
<sql id="customCondition">
<isNotEmpty prepend=" AND " property="gender">
USER_ID IN (SELECT LOGIN_NAME FROM ${platSchema}.XS_USER WHERE COMPANY_CODE = #companyCode# AND GENDER = #gender# )
</isNotEmpty>
<isNotEmpty prepend=" AND " property="mobile">
USER_ID IN (SELECT LOGIN_NAME FROM ${platSchema}.XS_USER WHERE COMPANY_CODE = #companyCode# AND MOBILE LIKE CONCAT('%', #mobile#, '%'))
</isNotEmpty>
</sql>
<!-- 公共修改字段 -->
<sql id="updateRevise">
UPDATED_BY = #updatedBy#,
UPDATED_NAME = #updatedName#,
UPDATED_TIME = #updatedTime#
</sql>
<sql id="order">
<dynamic prepend="ORDER BY">
<isNotEmpty property="order">
$order$
</isNotEmpty>
<isEmpty property="order">
ID DESC
</isEmpty>
</dynamic>
</sql>
<select id="query" resultClass="com.baosight.hpjx.hp.pz.domain.HPPZ013">
SELECT
<include refid="column"/>
FROM ${hpjxSchema}.T_HPPZ013 WHERE 1=1
<include refid="condition"/>
<include refid="customCondition"/>
<include refid="order"/>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hpjxSchema}.T_HPPZ013 WHERE 1=1
<include refid="condition"/>
<include refid="customCondition"/>
</select>
<insert id="insert">
INSERT INTO ${hpjxSchema}.T_HPPZ013 (
COMPANY_CODE, <!-- 企业编码 -->
DEP_CODE, <!-- 部门编码 -->
CREATED_BY, <!-- 创建人 -->
CREATED_NAME, <!-- 创建人名称 -->
CREATED_TIME, <!-- 创建时间 -->
DELETE_FLAG, <!-- 0.否1.是 -->
FACTORY_CODE, <!-- 工厂编码 -->
FACTORY_NAME, <!-- 工厂名称 -->
GROUP_TYPE, <!-- 部门类型 -->
GROUP_CODE, <!-- 生产组编码 -->
GROUP_NAME, <!-- 生产组名称 -->
USER_ID, <!-- 用户ID -->
USER_NAME, <!-- 用户名称 -->
STATUS, <!-- 状态:1-在职,2-离职 -->
REMARK <!-- 备注 -->
) VALUES (
#companyCode#, #depCode#, #createdBy#, #createdName#, #createdTime#,
#deleteFlag#, #factoryCode#, #factoryName#, #groupType#, #groupCode#,
#groupName#, #userId#, #userName#, #status#, #remark#
)
</insert>
<!-- 逻辑删除 -->
<delete id="delete">
UPDATE ${hpjxSchema}.T_HPPZ013
SET
DELETE_FLAG = #deleteFlag#,
<include refid="updateRevise"/>
WHERE ID = #id#
</delete>
<!-- 修改状态 -->
<update id="updateStatus">
UPDATE ${hpjxSchema}.T_HPPZ013
SET
STATUS = #status#, <!-- 状态:1-在职,2-离职 -->
REMARK = #remark#, <!-- 备注 -->
<include refid="updateRevise"/>
WHERE ID = #id#
</update>
</sqlMap>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://www.ibatis.com/dtd/sql-map-2.dtd">
<sqlMap namespace="HPPZ014">
<sql id="column">
ID as "id",
COMPANY_CODE as "companyCode", <!-- 企业编码 -->
DEP_CODE as "depCode", <!-- 部门编码 -->
CREATED_BY as "createdBy", <!-- 创建人 -->
CREATED_NAME as "createdName", <!-- 创建人名称 -->
CREATED_TIME as "createdTime", <!-- 创建时间 -->
UPDATED_BY as "updatedBy", <!-- 更新人 -->
UPDATED_NAME as "updatedName", <!-- 更新人名称 -->
UPDATED_TIME as "updatedTime", <!-- 更新时间 -->
DELETE_FLAG as "deleteFlag", <!-- 0.否1.是 -->
FACTORY_CODE as "factoryCode", <!-- 工厂编码 -->
FACTORY_NAME as "factoryName", <!-- 工厂名称 -->
GROUP_TYPE as "groupType", <!-- 部门类型 -->
GROUP_CODE as "groupCode", <!-- 生产组编码 -->
GROUP_NAME as "groupName", <!-- 生产组名称 -->
USER_ID as "userId", <!-- 用户ID -->
USER_NAME as "userName", <!-- 用户名称 -->
REG_DATE as "regDate" <!-- 登记日期 -->
</sql>
<sql id="condition">
AND DELETE_FLAG = '0'
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</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>
<isNotEmpty prepend=" AND " property="deleteFlag">
DELETE_FLAG = #deleteFlag#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryCode">
FACTORY_CODE = #factoryCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryName">
FACTORY_NAME = #factoryName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="groupType">
GROUP_TYPE = #groupType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="groupCode">
GROUP_CODE = #groupCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="groupName">
GROUP_NAME = #groupName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="userId">
USER_ID = #userId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="userName">
USER_NAME LIKE CONCAT('%', #userName#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="regDate">
REG_DATE = #regDate#
</isNotEmpty>
</sql>
<sql id="customCondition">
<isNotEmpty prepend=" AND " property="gender">
USER_ID IN (SELECT LOGIN_NAME FROM ${platSchema}.XS_USER WHERE COMPANY_CODE = #companyCode# AND GENDER = #gender# )
</isNotEmpty>
<isNotEmpty prepend=" AND " property="mobile">
USER_ID IN (SELECT LOGIN_NAME FROM ${platSchema}.XS_USER WHERE COMPANY_CODE = #companyCode# AND MOBILE LIKE CONCAT('%', #mobile#, '%'))
</isNotEmpty>
<isNotEmpty prepend=" AND " property="regDateFrom">
REG_DATE &gt;= REPLACE(#regDateFrom#,'-','')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="regDateTo">
REG_DATE &lt;= REPLACE(#regDateTo#,'-','')
</isNotEmpty>
</sql>
<!-- 公共修改字段 -->
<sql id="updateRevise">
UPDATED_BY = #updatedBy#,
UPDATED_NAME = #updatedName#,
UPDATED_TIME = #updatedTime#
</sql>
<sql id="order">
<dynamic prepend="ORDER BY">
<isNotEmpty property="order">
$order$
</isNotEmpty>
<isEmpty property="order">
REG_DATE DESC, CREATED_TIME DESC
</isEmpty>
</dynamic>
</sql>
<select id="query" resultClass="com.baosight.hpjx.hp.pz.domain.HPPZ014">
SELECT
<include refid="column"/>
FROM ${hpjxSchema}.T_HPPZ014 WHERE 1=1
<include refid="condition"/>
<include refid="customCondition"/>
<include refid="order"/>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hpjxSchema}.T_HPPZ014 WHERE 1=1
<include refid="condition"/>
<include refid="customCondition"/>
</select>
<insert id="insert">
INSERT INTO ${hpjxSchema}.T_HPPZ014 (
COMPANY_CODE, <!-- 企业编码 -->
DEP_CODE, <!-- 部门编码 -->
CREATED_BY, <!-- 创建人 -->
CREATED_NAME, <!-- 创建人名称 -->
CREATED_TIME, <!-- 创建时间 -->
DELETE_FLAG, <!-- 0.否1.是 -->
FACTORY_CODE, <!-- 工厂编码 -->
FACTORY_NAME, <!-- 工厂名称 -->
GROUP_TYPE, <!-- 部门类型 -->
GROUP_CODE, <!-- 生产组编码 -->
GROUP_NAME, <!-- 生产组名称 -->
USER_ID, <!-- 用户ID -->
USER_NAME, <!-- 用户名称 -->
REG_DATE <!-- 登记日期 -->
) VALUES (
#companyCode#, #depCode#, #createdBy#, #createdName#, #createdTime#,
#deleteFlag#, #factoryCode#, #factoryName#, #groupType#, #groupCode#,
#groupName#, #userId#, #userName#, #regDate#
)
</insert>
<!-- 逻辑删除 -->
<delete id="delete">
UPDATE ${hpjxSchema}.T_HPPZ014
SET
DELETE_FLAG = #deleteFlag#,
<include refid="updateRevise"/>
WHERE ID = #id#
</delete>
<!-- 修改 -->
<delete id="update">
UPDATE ${hpjxSchema}.T_HPPZ014
SET
<include refid="updateRevise"/>
WHERE ID = #id#
</delete>
<!-- 修改时间 -->
<delete id="updateTime">
UPDATE ${hpjxSchema}.T_HPPZ014
SET
<include refid="updateRevise"/>
WHERE 1=1
AND FACTORY_CODE = #factoryCode#
AND GROUP_CODE = #groupCode#
AND USER_ID = #userId#
and REG_DATE = #regDate#
</delete>
</sqlMap>
package com.baosight.hpjx.hp.sc.domain;
import com.baosight.iplat4j.core.data.DaoEPBase;
import com.baosight.iplat4j.core.ei.EiColumn;
import com.baosight.iplat4j.core.util.NumberUtils;
import com.baosight.iplat4j.core.util.StringUtils;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.Map;
public class HPSC003C implements Serializable {
private String orgId;
private BigDecimal untotalWt;
public String getOrgId() {
return orgId;
}
public void setOrgId(String orgId) {
this.orgId = orgId;
}
public BigDecimal getUntotalWt() {
return untotalWt;
}
public void setUntotalWt(BigDecimal untotalWt) {
this.untotalWt = untotalWt;
}
}
package com.baosight.hpjx.hp.sc.service;
import com.baosight.hpjx.aspect.annotation.OperationLogAnnotation;
import com.baosight.hpjx.common.DdynamicEnum;
import com.baosight.hpjx.common.HPConstants;
import com.baosight.hpjx.core.constant.CommonConstant;
import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.hp.pz.tools.HPPZTools;
import com.baosight.hpjx.hp.sc.domain.HPSC005;
import com.baosight.hpjx.hp.sc.domain.HPSC006;
import com.baosight.hpjx.hp.sc.tools.HPSCTools;
import com.baosight.hpjx.hp.xs.tools.HPXSTools;
import com.baosight.hpjx.util.AssertUtils;
import com.baosight.hpjx.util.CommonMethod;
import com.baosight.hpjx.util.LogUtils;
import com.baosight.hpjx.util.StringUtil;
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.ServiceBase;
import com.baosight.iplat4j.core.util.NumberUtils;
import org.apache.commons.lang.StringUtils;
import org.springframework.util.CollectionUtils;
import java.math.BigDecimal;
import java.text.DecimalFormat;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
*
*/
public class ServiceHPSC003A extends ServiceBase {
/**
* 画面初始化.
*/
@OperationLogAnnotation(operModul = "生产下料",operType = "查询",operDesc = "初始化")
public EiInfo initLoad(EiInfo inInfo) {
try {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.FACTORY_RECORD_BLOCK_ID), null, false);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
}
package com.baosight.hpjx.hp.sc.service;
import com.baosight.hpjx.aspect.annotation.OperationLogAnnotation;
import com.baosight.hpjx.common.DdynamicEnum;
import com.baosight.hpjx.core.constant.CommonConstant;
import com.baosight.hpjx.core.dao.DaoBase;
import com.baosight.hpjx.hp.sc.domain.*;
import com.baosight.hpjx.hp.sc.tools.HPSCTools;
import com.baosight.hpjx.hp.xs.domain.Org;
import com.baosight.hpjx.hp.xs.tools.HPXSTools;
import com.baosight.hpjx.util.CommonMethod;
import com.baosight.hpjx.util.LogUtils;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.service.impl.ServiceBase;
import org.apache.commons.collections.CollectionUtils;
import java.math.BigDecimal;
import java.util.*;
import java.util.stream.Collectors;
/**
*
*/
public class ServiceHPSC003B extends ServiceBase {
/**
* 画面初始化.
*/
@OperationLogAnnotation(operModul = "自动排产",operType = "查询",operDesc = "初始化")
public EiInfo initLoad(EiInfo inInfo) {
try {
String planInfoNo = inInfo.getString("inqu_status-0-planInfoNo");
String factoryCode = inInfo.getString("inqu_status-0-factoryCode");
String factoryName = HPXSTools.XsOrg.get(factoryCode).getOrgCname();
//找到生产计划
List<HPSC004> hpsc004List = HPSCTools.HpSc004.queryByParent(planInfoNo);
List<Long> matIds = hpsc004List.stream().map(HPSC004 :: getMatId).sorted().collect(Collectors.toList());
List<HPSC005> hpsc005List = HPSCTools.HpSc005.listByMatId(matIds);
//过滤掉已经分派的订单
List<HPSC005> hpsc005sFilter = hpsc005List.stream().filter(hpsc005 -> hpsc005.getStatus() == 0).collect(Collectors.toList());
//根据厂区找到组织
List<Map> orgList = HPXSTools.XsOrg.queryParent(factoryCode, "prodGroup");
//找对应的任务重量
Org org = new Org();
List<HPSC003C> untotalWtList = new ArrayList<>();
for (Map orgMap : orgList) {
HPSC003C hpsc003C = new HPSC003C();
String orgId = orgMap.get("orgId").toString();
Map map1 = new HashMap();
map1.put("factoryCode", factoryCode);
map1.put("orgNo", orgId);
List<HPSC005C> hpsc005CList = DaoBase.getInstance().query("HPSC005C.sumUnTotalWt",map1);
HPSC005C hpsc005C = hpsc005CList.get(0);
hpsc003C.setOrgId(orgId);
hpsc003C.setUntotalWt(hpsc005C.getUnTotalWt());
untotalWtList.add(hpsc003C);
}
List<HPSC003C> untotalWtSorted = new ArrayList<>();
untotalWtSorted = untotalWtList.stream().sorted(Comparator.comparing(HPSC003C :: getUntotalWt)).collect(Collectors.toList());
//智能分派
if (CollectionUtils.isNotEmpty(untotalWtSorted) && CollectionUtils.isNotEmpty(hpsc005sFilter)) {
//当前生产组小于分派任务,循环生产组进行分配
int untotalWtSortedSize = untotalWtSorted.size();
int hpsc005sFilterSize = hpsc005sFilter.size();
int i = 0;
int j = 0;
while (i < hpsc005sFilterSize) {
if (j + 1 > untotalWtSortedSize) {
j = 0;
}
HPSC005 hpsc005 = hpsc005sFilter.get(i);
HPSC003C hpsc003C = untotalWtSorted.get(j);
hpsc005.setOrgNo(hpsc003C.getOrgId());
hpsc005.setOrgName(HPXSTools.XsOrg.get(hpsc003C.getOrgId()).getOrgCname());
hpsc005.setFactoryCode(factoryCode);
hpsc005.setFactoryName(factoryName);
i++;
j++;
}
inInfo.addBlock(EiConstant.resultBlock).addRows(hpsc005sFilter);
}
Map parmMap = new HashMap();
parmMap.put("orgType","prodGroup");
parmMap.put("parentOrgId", factoryCode);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.GROUP_RECORD_BLOCK_ID), null, false);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询操作.
*/
@Override
@OperationLogAnnotation(operModul = "自动排产",operType = "查询")
public EiInfo query(EiInfo inInfo) {
return inInfo;
}
}
......@@ -13,6 +13,7 @@ import com.baosight.hpjx.hp.ds.domain.HPDS002;
import com.baosight.hpjx.hp.pz.domain.HPPZ011;
import com.baosight.hpjx.hp.pz.tools.HPPZTools;
import com.baosight.hpjx.hp.sc.domain.*;
import com.baosight.hpjx.hp.sc.tools.HPSCTools;
import com.baosight.hpjx.hp.xs.domain.Org;
import com.baosight.hpjx.hp.xs.tools.HPXSTools;
import com.baosight.hpjx.util.*;
......@@ -109,6 +110,7 @@ public class ServiceHPSC006 extends ServiceBase {
@OperationLogAnnotation(operModul = "生产下料",operType = "新增",operDesc = "新增")
@Override
public EiInfo insert(EiInfo inInfo) {
EiInfo outInfo = new EiInfo();
try {
HPSC006 HPSC006 = new HPSC006();
String productionOrderNo = inInfo.getString("productionOrderNo");
......@@ -140,25 +142,32 @@ public class ServiceHPSC006 extends ServiceBase {
}
DaoUtils.insert("HPSC006.insert",HPSC006);
}
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsg("新增成功!");
//刷新
outInfo = this.refreshHPSC006(outInfo, productionOrderNo);
outInfo.setStatus(EiConstant.STATUS_SUCCESS);
outInfo.setMsg("新增成功!");
} catch (PlatException e) {
e.printStackTrace();
inInfo.setStatus(EiConstant.STATUS_FAILURE);
inInfo.setMsg("新增失败!原因参见详细错误描述!");
inInfo.setDetailMsg(e.getMessage());
outInfo.setStatus(EiConstant.STATUS_FAILURE);
outInfo.setMsg("新增失败!原因参见详细错误描述!");
outInfo.setDetailMsg(e.getMessage());
logError("新增失败", e.getMessage());
return inInfo;
return outInfo;
}
return query(inInfo);
return outInfo;
}
private EiInfo refreshHPSC006(EiInfo inInfo, String productionOrderNo) {
List<HPSC006> HPSC006 = HPSCTools.Hpsc006.get(productionOrderNo);
inInfo.addBlock(CommonConstant.Field.DETAIL).addRows(HPSC006);
return inInfo;
}
/**
* 修改操作.
*/
@OperationLogAnnotation(operModul = "生产下料",operType = "修改",operDesc = "修改")
public EiInfo update(EiInfo inInfo) {
EiInfo outInfo = new EiInfo();
try {
HPSC006 HPSC006 = new HPSC006();
String productionOrderNo = inInfo.getString("productionOrderNo");
......@@ -184,16 +193,18 @@ public class ServiceHPSC006 extends ServiceBase {
HPSC006.setFactoryName(HPXSTools.XsOrg.get(HPSC006.getOrgNo()).getOrgCname());
DaoUtils.update("HPSC006.update",HPSC006);
}
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsg("修改成功!");
//刷新
outInfo = this.refreshHPSC006(outInfo, productionOrderNo);
outInfo.setStatus(EiConstant.STATUS_SUCCESS);
outInfo.setMsg("新增成功!");
} catch (PlatException e) {
inInfo.setStatus(EiConstant.STATUS_FAILURE);
inInfo.setMsg("操作失败!原因参见详细错误描述!");
inInfo.setDetailMsg(e.getMessage());
outInfo.setStatus(EiConstant.STATUS_FAILURE);
outInfo.setMsg("操作失败!原因参见详细错误描述!");
outInfo.setDetailMsg(e.getMessage());
logError("修改失败", e.getMessage());
return inInfo;
return outInfo;
}
return query(inInfo);
return outInfo;
}
/**
......@@ -262,6 +273,7 @@ public class ServiceHPSC006 extends ServiceBase {
*/
@OperationLogAnnotation(operModul = "生产下料",operType = "新增",operDesc = "分派")
public EiInfo assign(EiInfo eiInfo) {
EiInfo outInfo = new EiInfo();
try {
String ids = eiInfo.get("ids").toString();
String factoryCode = eiInfo.get("factoryCode").toString();
......@@ -270,6 +282,8 @@ public class ServiceHPSC006 extends ServiceBase {
String groupName = eiInfo.get("groupName").toString();
String [] id = ids.split(",");
HPSC006 hpsc006 = HPSCTools.Hpsc006.getById(NumberUtils.toLong(id[0]));
String productionOrderNo = hpsc006.getProductionOrderNo();
for (int i = 0; i < id.length; i++) {
// 更新HPSC005的数据
HPSC006 HPSC006 = new HPSC006();
......@@ -282,16 +296,18 @@ public class ServiceHPSC006 extends ServiceBase {
DaoUtils.update("HPSC006.updateAssign", HPSC006.toMap());
}
eiInfo.setStatus(EiConstant.STATUS_SUCCESS);
eiInfo.setMsg("分派成功!");
//刷新
outInfo = this.refreshHPSC006(outInfo, productionOrderNo);
outInfo.setStatus(EiConstant.STATUS_SUCCESS);
outInfo.setMsg("新增成功!");
} catch (PlatException e) {
eiInfo.setStatus(EiConstant.STATUS_FAILURE);
eiInfo.setMsg("分派失败!原因参见详细错误描述!");
eiInfo.setDetailMsg(e.getMessage());
outInfo.setStatus(EiConstant.STATUS_FAILURE);
outInfo.setMsg("分派失败!原因参见详细错误描述!");
outInfo.setDetailMsg(e.getMessage());
logError("分派失败", e.getMessage());
return eiInfo;
return outInfo;
}
return query(eiInfo);
return outInfo;
}
/**
......
......@@ -117,7 +117,7 @@ public class ServiceHPSC007 extends ServiceBase {
DaoUtils.insert("HPSC007.insert",HPSC007);
}
// 修改下料表中的字段
AssertUtils.isGt(totalNum, HPSC006.getNum(), "登记数量不能大于计划数量!");
HPSC006.setActualCompletionNum(HPSC006.getActualCompletionNum().add(totalNum));
HPSC006.setActualCompletionTotalWt(HPSC006.getActualCompletionTotalWt().add(actualCompletionTotalWt));
if (HPSC006.getActualCompletionNum().compareTo(HPSC006.getNum()) >= 0) {
......@@ -181,6 +181,7 @@ public class ServiceHPSC007 extends ServiceBase {
DaoUtils.insert("HPSC007.update",HPSC007);
}
// 修改下料表中的字段
AssertUtils.isGt(HPSC006.getActualCompletionNum().add(totalNum), HPSC006.getNum(), "登记数量不能大于计划数量!");
HPSC006.setActualCompletionNum(HPSC006.getActualCompletionNum().add(totalNum));
HPSC006.setActualCompletionTotalWt(HPSC006.getActualCompletionTotalWt().add(actualCompletionTotalWt));
if (HPSC006.getActualCompletionNum().compareTo(HPSC006.getNum()) >= 0) {
......
......@@ -169,4 +169,6 @@
<include refid="updateRevise"/>
WHERE PROD_TASK_NO = #prodTaskNo#
</update>
</sqlMap>
......@@ -212,5 +212,18 @@
<include refid="condition" />
</select>
<!--根据产区和生产组找到剩余工作总量-->
<select id="sumUnTotalWt" parameterClass="java.util.HashMap"
resultClass="com.baosight.hpjx.hp.sc.domain.HPSC005C">
SELECT
COALESCE(
(SUM( T1.NUM ) - SUM( T1.COMPLETE_NUM )) * T2.UNIT_WT
, 0) AS unTotalWt
FROM
${hpjxSchema}.T_HPSC005A T1
LEFT JOIN ${hpjxSchema}.T_HPSC005 T2 ON T1.PROD_ORDER_NO = T2.PROD_ORDER_NO
WHERE
T1.ORG_NO = #orgNo#
AND T1.FACTORY_CODE = #factoryCode#
</select>
</sqlMap>
......@@ -137,18 +137,20 @@ public class HPSCTools {
//总量
int num2 = NumberUtils.toint(list2.get(0));
if (num1 == 0) {
//都已经提交
Map map4 = new HashMap();
map4.put("projCode",projCode);
map4.put("materialStatus",2);
DaoUtils.update("HPSC001.checkByProjCode",map4);
} else if (num1 > 0 && num1 < num2) {
// 部分提交
Map map4 = new HashMap();
map4.put("projCode",projCode);
map4.put("materialStatus",1);
DaoUtils.update("HPSC001.checkByProjCode",map4);
if (num2 > 0) {
if (num1 == 0) {
//都已经提交
Map map4 = new HashMap();
map4.put("projCode",projCode);
map4.put("materialStatus",2);
DaoUtils.update("HPSC001.checkByProjCode",map4);
} else if (num1 > 0 && num1 < num2) {
// 部分提交
Map map4 = new HashMap();
map4.put("projCode",projCode);
map4.put("materialStatus",1);
DaoUtils.update("HPSC001.checkByProjCode",map4);
}
}
}
......@@ -360,6 +362,21 @@ public class HPSCTools {
map.put("planCompletionDate", planCompletionDate);
DaoUtils.update(HPSqlConstant.HPSC003.UPDATE_DATE, map);
}
/**
* 查询
*
* @param id
* @return
*/
public static HPSC003 getEntityByPlanInfoNo(String planInfoNo) {
AssertUtils.isNull(planInfoNo, "生产订单号不能为空");
Map queryMap = new HashMap();
queryMap.put("planInfoNo", planInfoNo);
List<HPSC003> results = DaoBase.getInstance().query(HPSC003.QUERY, queryMap);
AssertUtils.isNull(results, String.format("生产订单号[%s]信息不存在", planInfoNo));
return results.get(0);
}
}
/**
......@@ -829,6 +846,21 @@ public class HPSCTools {
AssertUtils.isNull(results, String.format("生产下料ID[%s]信息不存在", id));
return results.get(0);
}
/**
* 查询
*
* @param prodOrderNo
* @return
*/
public static List<HPSC006> get(String productionOrderNo) {
AssertUtils.isEmpty(productionOrderNo, "生产订单号不能为空");
Map queryMap = new HashMap();
queryMap.put("productionOrderNo", productionOrderNo);
List<HPSC006> results = DaoBase.getInstance().query(HPSC006.QUERY, queryMap);
AssertUtils.isNull(results, String.format("生产订单[%s]信息不存在", productionOrderNo));
return results;
}
}
public static class Hpsc007 {
......
......@@ -8,6 +8,14 @@ import java.io.Serializable;
*/
public class User implements Serializable {
public static final String FIELD_USER_ID = "userId"; /* 用户ID*/
public static final String FIELD_USER_NAME = "userName"; /* 用户中文名*/
public static final String FIELD_LOGIN_NAME = "loginName"; /* 登录ID*/
public static final String FIELD_GENDER = "gender"; /* 性别*/
public static final String FIELD_MOBILE = "mobile"; /* 手机号*/
public static final String FIELD_EMAIL = "email"; /* 邮箱*/
public static final String FIELD_COMPANY_CODE = "companyCode"; /* 企业代码*/
/**
* 用户ID
*/
......@@ -24,6 +32,11 @@ public class User implements Serializable {
private String loginName;
/**
* 性别
*/
private String gender;
/**
* 手机号
*/
private String mobile;
......@@ -85,4 +98,12 @@ public class User implements Serializable {
public void setCompanyCode(String companyCode) {
this.companyCode = companyCode;
}
public String getGender() {
return gender;
}
public void setGender(String gender) {
this.gender = gender;
}
}
......@@ -133,14 +133,19 @@
) AS T1,
@LEVEL:=@LEVEL+1 AS LEVEL
FROM ${platSchema}.TXSOG01,
(SELECT @CODES:=#parentOrgId#, @LEVEL:= 0) T4
<isNotEmpty property="parentOrgId">
(SELECT @CODES:=#parentOrgId#, @LEVEL:= 0) T4
</isNotEmpty>
<isEmpty property="parentOrgId">
(SELECT @CODES:='root', @LEVEL:= 0) T4
</isEmpty>
WHERE @CODES IS NOT NULL
) T2,
${platSchema}.TXSOG01 T3
LEFT JOIN ${platSchema}.TXSOG01 T5 ON T3.FACTORY_CODE = T5.ORG_ID
WHERE 1=1
AND FIND_IN_SET(T3.ORG_ID, T2.CODES)
AND T3.ORG_TYPE IN ('prodGroup', 'cutGroup', 'factory')
AND T3.ORG_TYPE IN ('prodGroup', 'cutGroup')
<isNotEmpty prepend=" AND " property="orgType">
T3.ORG_TYPE = #orgType#
</isNotEmpty>
......
......@@ -26,6 +26,7 @@
USER_ID as "userId", <!-- 用户id -->
USER_NAME as "userName", <!-- 用户名 -->
LOGIN_NAME as "loginName", <!-- 登录id -->
GENDER as "gender", <!-- 性别 -->
MOBILE as "mobile", <!-- 手机号 -->
EMAIL as "email", <!-- 邮箱 -->
COMPANY_CODE as "companyCode" <!-- 企业编码 -->
......
......@@ -5,12 +5,22 @@ import com.baosight.hpjx.core.enums.OrgTypeEnum;
import com.baosight.hpjx.hp.xs.domain.Org;
import com.baosight.hpjx.hp.xs.domain.User;
import com.baosight.hpjx.util.AssertUtils;
import com.baosight.hpjx.util.MapUtils;
import com.baosight.hpjx.util.ObjectUtils;
import com.baosight.hpjx.util.RsaUtils;
import com.baosight.hpjx.util.StringUtils;
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.soa.XLocalManager;
import com.baosight.iplat4j.core.web.threadlocal.UserSession;
import com.baosight.xservices.xs.constants.LoginConstants;
import org.springframework.util.CollectionUtils;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* @author:songx
......@@ -61,6 +71,91 @@ public class HPXSTools {
List<User> results = DaoBase.getInstance().query("HPXSUser.query", paramMap);
return CollectionUtils.isEmpty(results) ? null : results.get(0);
}
/**
* 查询
*
* @param loginNames
* @return
*/
public static List<User> list(List<String> loginNames) {
if (CollectionUtils.isEmpty(loginNames)) {
return null;
}
Map queryMap = new HashMap();
queryMap.put("loginNames", loginNames);
return DaoBase.getInstance().query("HPXSUser.query", queryMap);
}
/**
* 查询
*
* @param loginNames
* @return
*/
public static Map<String, User> map(List<String> loginNames) {
List<User> results = list(loginNames);
if (CollectionUtils.isEmpty(results)) {
return null;
}
return results.stream().collect(Collectors.toMap(User::getLoginName, item -> item));
}
/**
* 初始化新增用户
*
* @param companyCode
* @param userId
* @param userName
* @param gender
* @param mobile
*/
public static void addUser(String companyCode, String userId, String userName, String gender, String mobile)
throws Exception {
Map inInfoRowMap = new HashMap();
inInfoRowMap.put("userId", userId);
inInfoRowMap.put("loginName", userId);
inInfoRowMap.put("userName", userName);
// 使用公钥加密密码
String password = RsaUtils.encryptByPublicKey(LoginConstants.rsaPublicKey, companyCode);
inInfoRowMap.put("password", password);
inInfoRowMap.put("rePass", password);
inInfoRowMap.put("email", " ");
inInfoRowMap.put("gender", StringUtils.isBlank(gender) ? " " : gender);
inInfoRowMap.put("mobile", StringUtils.isBlank(mobile) ? " " : mobile);
inInfoRowMap.put("companyCode", companyCode);
EiInfo inInfo = new EiInfo();
inInfo.addBlock("details").addRow(inInfoRowMap);
inInfo.set(EiConstant.serviceName, "XS0102");
inInfo.set(EiConstant.methodName, "insert");
EiInfo outInfo = XLocalManager.call(inInfo);
if (outInfo.getStatus() < 0) {
throw new PlatException(outInfo.getMsg());
}
}
/**
* 设置用户信息
*
* @param inInfo
* @param keyName
*/
public static void setUserInfo(EiInfo inInfo, String keyName) {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
List<String> keyValues = ObjectUtils.listKey(resultRows, keyName);
Map<String, User> resultMap = map(keyValues);
if (MapUtils.isEmpty(resultMap)) {
return;
}
for (Map resultRow : resultRows) {
String keyValue = MapUtils.getString(resultRow, keyName);
User dbUser = resultMap.get(keyValue);
resultRow.put(User.FIELD_USER_NAME, dbUser == null ? "" : dbUser.getUserName());
resultRow.put(User.FIELD_GENDER, dbUser == null ? "" : dbUser.getGender());
resultRow.put(User.FIELD_MOBILE, dbUser == null ? "" : dbUser.getMobile());
resultRow.put(User.FIELD_EMAIL, dbUser == null ? "" : dbUser.getEmail());
}
}
}
/**
......@@ -112,6 +207,25 @@ public class HPXSTools {
AssertUtils.isNull(results, String.format("组织[%s]不存在厂区信息", orgId));
return results.get(0);
}
/**
* 查询
*
* @param orgId
* @return
*/
public static List<Map> queryParent(String orgId,String orgType) {
AssertUtils.isNull(orgId, "组织ID不能为空");
AssertUtils.isNull(orgType, "组织类型不能为空");
Map queryMap = new HashMap();
queryMap.put("parentOrgId", orgId);
queryMap.put("orgType", orgType);
List<Map> results = DaoBase.getInstance().query("HPXSOrg.queryGroupComboBox", queryMap);
AssertUtils.isNull(results, String.format("组织[%s]不存在父级信息", orgId));
return results;
}
}
......
......@@ -188,6 +188,17 @@
WHERE ID = #id#
</update>
<!-- 移动端已处理 -->
<update id="doProcess2">
UPDATE hpjx.t_hpzl001
SET
STATUS = #status#,
CHECK_USER = #checkUser#, <!-- 检查人 -->
CHECK_USER_NAME = #checkUserName#, <!-- 检查人名称 -->
<include refid="updateRevise"/>
WHERE CHECK_NO = #checkNo#
</update>
<!-- 更新附件信息 -->
<update id="updateAffix">
UPDATE hpjx.t_hpzl001
......
......@@ -210,11 +210,11 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils {
*
* @return
*/
public static String formatShort(String dateTime) {
if (StringUtils.isBlank(dateTime)) {
return dateTime;
public static String formatShort(Object dateTime) {
if (ObjectUtils.isNullBlank(dateTime)) {
return dateTime == null ? null : dateTime.toString();
}
return dateTime.replaceAll("-", "")
return dateTime.toString().replaceAll("-", "")
.replaceAll("/", "")
.replaceAll(":", "")
.replaceAll(" ", "");
......
......@@ -20,7 +20,7 @@
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="invent_name_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFSelect ename="inqu_status-0-spec" cname="规格" colWidth="3" filter="contains">
<EF:EFSelect ename="inqu_status-0-spec" cname="规格(MM)" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="spec_name_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
......@@ -30,7 +30,6 @@
<EF:EFRegion id="result" title="记录集">
<EF:EFInput ename="inqu_result-0-hpsc006Id" type="hidden"/>
<EF:EFGrid blockId="result" autoDraw="override" autoFit="true" checkMode="row">
<EF:EFColumn ename="id" cname="库存ID" enable="false" width="60" align="center"/>
<EF:EFComboColumn ename="inventType" cname="存货类型" enable="false" width="10" align="center">
<EF:EFCodeOption codeName="hpjx.hpkc.inventType" />
</EF:EFComboColumn>
......@@ -42,7 +41,7 @@
blockName="invent_name_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#">
</EF:EFComboColumn>
<EF:EFComboColumn ename="inventRecordId" cname="规格" enable="false" width="100" align="center"
<EF:EFComboColumn ename="inventRecordId" cname="规格(MM)" enable="false" width="100" align="center"
blockName="invent_spec_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#">
</EF:EFComboColumn>
......@@ -50,8 +49,8 @@
<EF:EFColumn ename="applyRemark" cname="申请说明" width="150" editType="textarea" copy="true"/>
<EF:EFColumn ename="amount" cname="库存数量" enable="false" width="120" align="right" format="{0:N0}"
sumType="all"/>
<EF:EFColumn ename="unitWeight" cname="单量" enable="false" width="120" align="right" format="{0:N3}"/>
<EF:EFColumn ename="weight" cname="库存重量" enable="false" width="120" align="right" format="{0:N3}"
<EF:EFColumn ename="unitWeight" cname="单量(KG)" enable="false" width="120" align="right" format="{0:N3}"/>
<EF:EFColumn ename="weight" cname="库存重量(KG)" enable="false" width="120" align="right" format="{0:N3}"
sumType="all"/>
<EF:EFColumn ename="remark" cname="备注" enable="false" width="150"/>
</EF:EFGrid>
......
let whNameGlobalData = [];
$(function () {
IPLATUI.EFGrid = {
"result": {
columns: [],
columns: [{
field: "whCode",
template: function (dataItem) {
for (let i = 0; i < whNameGlobalData.length; i++) {
if (whNameGlobalData[i]['valueField'] === dataItem['whCode']) {
return whNameGlobalData[i]['textField'];
}
}
return "";
},
editor: function (container, options) {
let inInfo = new EiInfo();
// 1.原料,2.耗材
inInfo.set("inqu_status-0-inventTypes", [3]);
inInfo.set("inqu_status-0-whType", options.model["inventType"]);
inInfo.set("inqu_status-0-isSplicingSymbol", false);
inInfo.set("serviceName", "HPPZ007");
inInfo.set("methodName", "queryComboBox");
inInfo.set("blockId", "wh_record_block_id");
inInfo.set("field", options.field);
refreshSelect(container, inInfo);
}
},],
dataBound: function () {
}
}
......@@ -23,9 +46,28 @@ $(function () {
$(window).load(function () {
// 初始化查询
query();
// 仓库名称
initWh()
});
/**
* 初始化仓库
*/
let initWh = function () {
let inInfo = new EiInfo();
// 1.原料,2.耗材
inInfo.set("inqu_status-0-inventTypes", [3]);
inInfo.set("inqu_status-0-isSplicingSymbol", false);
EiCommunicator.send("HPPZ007", "queryComboBox", inInfo, {
onSuccess: function (ei) {
whNameGlobalData = ei.getBlock("wh_record_block_id").getMappedRows();
},
onFail: function (ei) {
}
}, {async: false});
}
/**
* 查询
*/
var query = function (e) {
......
......@@ -30,23 +30,24 @@
<EF:EFColumn ename="prdtName" cname="部件名称" enable="false" width="120" align="center"/>
<EF:EFColumn ename="partName" cname="零件名称" enable="false" width="120" align="center"/>
<EF:EFColumn ename="partSpec" cname="零件规格" enable="false" width="150" align="center"/>
<EF:EFComboColumn ename="whCode" cname="仓库名称" width="120" align="center"
<%-- <EF:EFComboColumn ename="whCode" cname="仓库名称" width="120" align="center"
blockName="wh_record_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#" required="true">
</EF:EFComboColumn>
</EF:EFComboColumn>--%>
<EF:EFColumn ename="whCode" cname="仓库名称" width="120" align="center" required="true"/>
<EF:EFColumn ename="applyNum" cname="入库数量" width="120" align="right" format="{0:N0}" required="true"/>
<EF:EFColumn ename="remark1" cname="入库说明" width="150"/>
<EF:EFColumn ename="completeNum" cname="已入库数量" enable="false" width="120" align="right" format="{0:N0}"
hidden="true"/>
<EF:EFColumn ename="unCompleteNum" cname="待入库数量" enable="false" width="120" align="right" format="{0:N0}"/>
<EF:EFColumn ename="num" cname="任务数量" enable="false" width="120" align="right" format="{0:N0}"/>
<EF:EFColumn ename="totalWt" cname="任务重量(KG)" enable="false" width="120" align="right" format="{0:N3}"/>
<EF:EFColumn ename="totalWt" cname="任务重量(T)" enable="false" width="120" align="right" format="{0:N3}"/>
<EF:EFColumn ename="factoryName" cname="厂区名称" enable="false" width="150" align="center"/>
<EF:EFColumn ename="orgName" cname="生产组名称" enable="false" width="150" align="center"/>
<EF:EFColumn ename="remark" cname="备注" enable="false" width="150"/>
<%-- <EF:EFColumn ename="projCode" cname="项目号" enable="false" width="140" align="center"/>
<EF:EFColumn ename="prodTaskNo" cname="生产任务号" enable="false" width="150" align="center"/>
<EF:EFColumn ename="prodOrderNo" cname="生产订单号" enable="false" width="140" align="center"/>--%>
<%-- <EF:EFColumn ename="remark" cname="备注" enable="false" width="150"/>
<EF:EFColumn ename="projCode" cname="项目号" enable="false" width="140" align="center"/>
<EF:EFColumn ename="prodTaskNo" cname="生产任务号" enable="false" width="150" align="center"/>
<EF:EFColumn ename="prodOrderNo" cname="生产订单号" enable="false" width="140" align="center"/>--%>
<EF:EFColumn ename="prdtCode" cname="部件编码" enable="false" width="120" align="center" hidden="true"/>
<EF:EFColumn ename="partCode" cname="零件编码" enable="false" width="120" align="center" hidden="true"/>
<EF:EFColumn ename="factoryCode" cname="厂区编码" enable="false" width="150" hidden="true"/>
......
......@@ -44,6 +44,7 @@
<%-- <EF:EFColumn ename="length" cname="长(MM)" format="{0:N3}" maxLength="20" width="90" align="right" enable="false"/>
<EF:EFColumn ename="width" cname="宽(MM)" format="{0:N3}" maxLength="20" width="90" align="right" enable="false"/>
<EF:EFColumn ename="thick" cname="厚(MM)" format="{0:N3}" maxLength="20" width="90" align="right" enable="false"/>--%>
<EF:EFColumn ename="prdtSpec" cname="规格" enable="false" width="150" align="center"/>
<EF:EFColumn ename="amount" cname="数量" format="{0:N0}" maxLength="20" width="90" align="right" required="true" enable="false"/>
<EF:EFColumn ename="unitWeight" cname="单重(T)" format="{0:N3}" maxLength="20" width="90" align="right" enable="false"/>
<EF:EFColumn ename="weight" cname="重量(T)" format="{0:N3}" maxLength="20" width="90" align="right" enable="false"/>
......
let groupGlobalData = [];
$(function () {
IPLATUI.EFGrid.result = {
pageable: {
pageSize: 20,
pageSizes: [10, 20, 50, 70, 100],
},
columns: [{
field: "groupCode",
template: function (dataItem) {
for (let i = 0; i < groupGlobalData.length; i++) {
if (groupGlobalData[i]['valueField'] === dataItem['groupCode']) {
return groupGlobalData[i]['textField'];
}
}
return "";
},
editor: function (container, options) {
let inInfo = new EiInfo();
inInfo.set("inqu_status-0-parentOrgId", options.model["factoryCode"]);
inInfo.set("inqu_status-0-orgType", options.model["groupType"]);
inInfo.set("inqu_status-0-isSplicingSymbol", false);
inInfo.set("serviceName", "HPXSOrg");
inInfo.set("methodName", "queryGroupComboBox");
inInfo.set("blockId", "group_record_block_id");
inInfo.set("field", options.field);
refreshSelect(container, inInfo);
}
}],
loadComplete: function (grid) {
},
onSave: function (e) {
// 阻止默认请求,使用自定义保存
e.preventDefault();
save();
},
onDelete: function (e) {
// 阻止默认请求,使用自定义删除
e.preventDefault();
deleteFunc();
},
onSuccess: function (e) {
}
}
// 查询
$("#QUERY").on("click", query);
// 用工登记
$("#CHECK_IN").on("click", checkIn);
});
/**
* 页面加载时执行
*/
$(window).load(function () {
// 生产部门
initGroup();
// 查询
query();
});
/**
* 初始化生产部门
*/
let initGroup = function () {
let inInfo = new EiInfo();
inInfo.set("inqu_status-0-parentOrgId", 'root');
inInfo.set("inqu_status-0-isSplicingSymbol", false);
EiCommunicator.send("HPXSOrg", "queryGroupComboBox", inInfo, {
onSuccess: function (ei) {
groupGlobalData = ei.getBlock("group_record_block_id").getMappedRows();
},
onFail: function (ei) {
}
}, {async: false});
}
/**
* 查询
*/
let query = function () {
resultGrid.dataSource.page(1);
}
/**
* 保存
*/
let save = function () {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
for (let i = 0; i < rows.length; i++) {
let item = rows[i];
if (isBlank(item['factoryCode'])) {
message("选中的第" + (i + 1) + "行\"工厂\",不能为空!");
return;
}
if (isBlank(item['groupType'])) {
message("选中的第" + (i + 1) + "行\"部门类型\",不能为空!");
return;
}
if (isBlank(item['groupCode'])) {
message("选中的第" + (i + 1) + "行\"生产部门\",不能为空!");
return;
}
if (isBlank(item['userName'])) {
message("选中的第" + (i + 1) + "行\"姓名\",不能为空!");
return;
}
if (isBlank(item['gender'])) {
message("选中的第" + (i + 1) + "行\"性别\",不能为空!");
return;
}
if (isBlank(item['mobile'])) {
message("选中的第" + (i + 1) + "行\"联系方式\",不能为空!");
return;
}
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HPPZ013", "save", true);
}
});
}
/**
* 删除
*/
let deleteFunc = function () {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"删除\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HPPZ013", "delete", true);
}
});
}
/**
* 用工登记
*/
let checkIn = function () {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
JSColorbox.open({
href: "HPPZ013A?methodName=initLoad",
title: "<div style='text-align: center;'>用工登记</div>",
width: "30%",
height: "50%",
callbackName: checkInCallback
});
}
/**
* 登记日期回调
*/
let checkInCallback = function (regDate) {
let inInfo = new EiInfo();
inInfo.set("main-0-regDate", regDate);
JSUtils.submitGridsData("result", "HPPZ014", "checkIn", true,
function (res) {
if (res.status > -1) {
// 关闭弹窗
JSColorbox.close();
}
}, inInfo
);
}
<!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:EFSelect cname="工厂" blockId="inqu_status" ename="factoryCode" row="0" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="factory_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFSelect cname="部门类型" blockId="inqu_status" ename="groupType" row="0" colWidth="3" filter="contains"
defultValue="">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="xs.og.orgType" condition="ITEM_CODE IN ('prodGroup', 'cutGroup')"/>
</EF:EFSelect>
<EF:EFSelect cname="生产部门" blockId="inqu_status" ename="groupCode" row="0" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="group_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFInput cname="姓名" blockId="inqu_status" ename="userName" row="0" colWidth="3"/>
</div>
<div class="row">
<EF:EFSelect cname="性别" blockId="inqu_status" ename="gender" row="0" colWidth="3">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="xservices.xs.sex"/>
</EF:EFSelect>
<EF:EFInput cname="联系方式" blockId="inqu_status" ename="mobile" row="0" colWidth="3"/>
<EF:EFSelect cname="状态" blockId="inqu_status" ename="status" row="0" colWidth="3">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="ctdy.hppz.userStatus"/>
</EF:EFSelect>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="记录集">
<EF:EFGrid blockId="result" autoDraw="override" checkMode="row">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFComboColumn ename="factoryCode" cname="厂区" width="110" align="center" defaultValue="" required="true"
filter="contains" readonly="true">
<EF:EFOptions blockId="factory_record_block_id" valueField="valueField" textField="textField"/>
</EF:EFComboColumn>
<EF:EFComboColumn ename="groupType" cname="部门类型" width="80" align="center" required="true"
readonly="true">
<EF:EFCodeOption codeName="xs.og.orgType" condition="ITEM_CODE IN ('prodGroup', 'cutGroup')"/>
</EF:EFComboColumn>
<EF:EFColumn ename="groupCode" cname="生产部门" width="120" align="center" required="true" readonly="true"/>
<EF:EFColumn ename="userId" cname="工号" enable="false" width="120" align="center"/>
<EF:EFColumn ename="userName" cname="姓名" width="120" align="center" required="true" readonly="true"/>
<EF:EFComboColumn ename="gender" cname="性别" width="80" align="center" required="true" readonly="true"
valueField="valueField" textField="textField">
<EF:EFCodeOption codeName="xservices.xs.sex"/>
</EF:EFComboColumn>
<EF:EFColumn ename="mobile" cname="联系方式" width="120" align="center" required="true" readonly="true"/>
<EF:EFComboColumn ename="status" cname="状态" width="80" align="center" defaultValue="1"
valueField="valueField" textField="textField">
<EF:EFCodeOption codeName="ctdy.hppz.userStatus"/>
</EF:EFComboColumn>
<EF:EFColumn ename="remark" cname="备注" width="150"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
$(function () {
// 登记
$("#CONFIRM").on("click", confirm);
});
/**
* 页面加载时执行
*/
$(window).load(function () {
// 默认当天
$("#inqu_status-0-regDate").val(currDate());
});
/**
* 登记
*/
let confirm = function () {
let regDate = $("#inqu_status-0-regDate").val();
if (isBlank(regDate)) {
message("请选择登记日期");
return;
}
JSUtils.confirm("确定进行\"登记\"操作? ", {
ok: function () {
parent.JSColorbox.setValueCallback(regDate);
}
});
}
<!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>
<EF:EFRegion id="inqu" title="">
<div class="row">
<EF:EFDatePicker cname="登记日期" blockId="inqu_status" ename="regDate" row="0" colWidth="3" ratio="2:10"
role="date" format="yyyy-MM-dd" parseFormats="['yyyyMMdd']" readonly="true"/>
</div>
</EF:EFRegion>
</EF:EFPage>
$(function () {
IPLATUI.EFGrid.result = {
pageable: {
pageSize: 20,
pageSizes: [10, 20, 50, 70, 100],
},
columns: [],
onDelete: function (e) {
// 阻止默认请求,使用自定义删除
e.preventDefault();
deleteFunc();
}
}
// 查询
$("#QUERY").on("click", query);
});
/**
* 页面加载时执行
*/
$(window).load(function () {
// 查询
query();
});
/**
* 查询
*/
let query = function () {
resultGrid.dataSource.page(1);
}
/**
* 删除
*/
let deleteFunc = function () {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"删除\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HPPZ014", "delete", true);
}
});
}
<!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:EFSelect cname="工厂" blockId="inqu_status" ename="factoryCode" row="0" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="factory_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFSelect cname="部门类型" blockId="inqu_status" ename="groupType" row="0" colWidth="3" filter="contains"
defultValue="">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="xs.og.orgType" condition="ITEM_CODE IN ('prodGroup', 'cutGroup')"/>
</EF:EFSelect>
<EF:EFSelect cname="生产部门" blockId="inqu_status" ename="groupCode" row="0" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="group_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFInput cname="姓名" blockId="inqu_status" ename="userName" row="0" colWidth="3"/>
</div>
<div class="row">
<EF:EFSelect cname="性别" blockId="inqu_status" ename="gender" row="0" colWidth="3">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="xservices.xs.sex"/>
</EF:EFSelect>
<EF:EFInput cname="联系方式" blockId="inqu_status" ename="mobile" row="0" colWidth="3"/>
<EF:EFDateSpan startCname="登记日期(从)" endCname="至" blockId="inqu_status"
startName="regDateFrom" endName="regDateTo" row="0" role="date"
format="yyyy-MM-dd" ratio="3:3" satrtRatio="4:8" endRatio="4:8" readonly="true">
</EF:EFDateSpan>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="记录集">
<EF:EFGrid blockId="result" autoDraw="override" checkMode="row">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFComboColumn ename="factoryCode" cname="厂区" enable="false" width="110" align="center">
<EF:EFOptions blockId="factory_record_block_id" valueField="valueField" textField="textField"/>
</EF:EFComboColumn>
<EF:EFComboColumn ename="groupType" cname="部门类型" enable="false" width="80" align="center">
<EF:EFCodeOption codeName="xs.og.orgType" condition="ITEM_CODE IN ('prodGroup', 'cutGroup')"/>
</EF:EFComboColumn>
<EF:EFComboColumn ename="groupCode" cname="生产部门" enable="false" width="110" align="center">
<EF:EFOptions blockId="group_record_block_id" valueField="valueField" textField="textField"/>
</EF:EFComboColumn>
<EF:EFColumn ename="userId" cname="工号" enable="false" width="120" align="center"/>
<EF:EFColumn ename="userName" cname="姓名" enable="false" width="120" align="center"/>
<EF:EFComboColumn ename="gender" cname="性别" enable="false" width="80" align="center"
valueField="valueField" textField="textField">
<EF:EFCodeOption codeName="xservices.xs.sex"/>
</EF:EFComboColumn>
<EF:EFColumn ename="mobile" cname="联系方式" enable="false" width="120" align="center"/>
<EF:EFColumn ename="regDate" cname="登记日期" enable="false" width="100" align="center"
editType="date" dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
......@@ -22,9 +22,11 @@ $(function () {
template: function (item) {
let auditStatus = item.status;
let template = '';
if (auditStatus == 0) {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;" ' +
'onclick="check(' + item.id + ',1)" >提交</a>';
if (auditStatus) {
if (auditStatus == 0) {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;" ' +
'onclick="check(' + item.id + ',1)" >提交</a>';
}
}
// else if (auditStatus == 1) {
// template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;" ' +
......
......@@ -100,6 +100,7 @@ $(function () {
if(e.eiInfo.extAttr.methodName == 'save'
||e.eiInfo.extAttr.methodName == 'delete'){
query();
refreshTree();
}
},
query: function () {
......@@ -396,8 +397,7 @@ $(function () {
NotificationUtil({msg: ei.msg, detailMsg: ei.detailMsg}, "error");
} else {
NotificationUtil(ei.msg);
var tree = $("#materialTree").data("kendoTreeView");
setTimeout(function(){ tree.reload("root");}, 500);//更新树
refreshTree();
query();
}
},
......@@ -492,6 +492,17 @@ $(window).load(function () {
let query = function () {
resultGrid.dataSource.page(1);
}
let refreshTree = function () {
//更新树
var tree = $("#materialTree").data("kendoTreeView");
var inInfo = new EiInfo();
EiCommunicator.send("HPSC002", "queryTreeNode", inInfo, {//传入参数
onSuccess: function (inInfo) {
tree.reload("root");//更新树
}
});
}
function openUploadFile(id) {
uploadFileWindow.open().center();
// rowId = id;
......@@ -552,6 +563,7 @@ function deleteFunc() {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"删除\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HPSC002", "delete", true);
updateTree();
}
});
}
......@@ -600,10 +612,22 @@ function saveFunc() {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HPSC002", "save", true);
updateTree();
}
});
}
}
//更新树
function updateTree() {
var tree = $("#materialTree").data("kendoTreeView");
var inInfo = new EiInfo();
EiCommunicator.send("HPSC002", "queryTreeNode", inInfo, {//传入参数
onSuccess: function (inInfo) {
tree.reload("root");//更新树
}
});
}
......@@ -169,6 +169,8 @@ function check(id, auditStatus,planInfoNo) {
EiCommunicator.send('HPSC003', 'submitPlan', inEiInfo, {
onSuccess(response) {
NotificationUtil(response.msg);
console.log(response)
autoProductionschedul(response.get('planInfoNo'));
resultGrid.dataSource.page(1);
},
onFail(errorMessage, status, e) {
......@@ -213,7 +215,48 @@ function check(id, auditStatus,planInfoNo) {
}
);
// autoProductionschedul('SCJH24030700006');
}
/**
* 自动排产提示
*/
let autoProductionschedul = function (planInfoNo) {
JSUtils.confirm(" 生产计划提交成功,已生成生产订单!是否自动排产? ", {
ok: function () {
JSColorbox.open({
href: "HPSC003A?methodName=initLoad&inqu_status-0-planInfoNo=" + planInfoNo,
title: "<div style='text-align: center;'>自动排产</div>",
width: "30%",
height: "80%",
callbackName: autoProductionschedulCallback
});
}
});
}
function autoProductionschedulCallback (factoryCode,planInfoNo) {
JSColorbox.close();
if (factoryCode) {
if (planInfoNo) {
JSColorbox.open({
href: "HPSC003B?methodName=initLoad&inqu_status-0-planInfoNo=" + planInfoNo +
'&inqu_status-0-factoryCode=' + factoryCode,
title: "<div style='text-align: center;'>自动排产</div>",
// width: "80%",
// height: "80%",
callbackName: autoProductionschedulCallback1
});
} else {
message("生产计划单号不能为空!");
return;
}
} else {
message("请选择工厂生成生产任务!");
return;
}
}
function autoProductionschedulCallback1 () {
JSColorbox.close();
}
let query = function () {
......
......@@ -60,7 +60,7 @@
</EF:EFComboColumn>
<EF:EFColumn enable="false" ename="prdtCode" cname="零件编码" hidden = "true"/>
<EF:EFColumn enable="false" ename="prdtName" readonly="true" cname="零件名称"/>
<EF:EFColumn enable="false" ename="spec" cname="规格(MM)" align="center" readonly="true"/>
<EF:EFColumn enable="false" ename="spec" cname="规格" align="center" readonly="true"/>
<EF:EFColumn enable="false" ename="remark" cname="备注" readonly="true"/>
<EF:EFColumn enable="false" ename="num" readonly="true" width="80" align="right" cname="数量" format="{0:N0}"/>
<EF:EFColumn enable="false" ename="unitWt" readonly="true" width="80" align="right" cname="单重(T)"/>
......
$(function () {
/**
* 取消
*/
$('#cancel').on('click',function () {
// 关闭弹窗
parent.JSColorbox.setValueCallback();
})
/**
* 确认
*/
$('#confirm').on('click',function () {
var factoryCode = $('#inqu_status-0-factoryCode').val();
var planInfoNo = $('#inqu_status-0-planInfoNo').val();
if (factoryCode) {
if (planInfoNo) {
parent.JSColorbox.setValueCallback(factoryCode,planInfoNo);
} else {
message("生产计划单号不能为空!");
return;
}
} else {
message("请选择工厂生成生产任务!");
return;
}
})
});
<!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="选择工厂">
<EF:EFInput ename="inqu_status-0-planInfoNo" cname="生产计划单号" type="hidden"/>
<div class="row">
<EF:EFSelect cname="厂区" ename="factoryCode" blockId="inqu_status" row="0" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="factory_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
</div>
<br/>
<span style='color: red;font-size: 13px;'>请选择工厂生成生产任务!</span>
<div class="row">
<EF:EFButton ename="cancel" cname="取消" type="button" class="btn-align-right"/>
<EF:EFButton ename="confirm" cname="确认" type="button" class="btn-align-right"/>
</div>
</EF:EFRegion>
</EF:EFPage>
$(function () {
IPLATUI.EFGrid = {
"result" : {
toolbarConfig: {
hidden: true, // true时,不显示功能按钮,但保留setting导出按钮
},
columns: [{
field: "operator",
title: "操作",
template: function (item) {
let template = '';
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="deleteRow(' + item.rowNo + ')" >删除</a>';
return template
}
}]
}
}
});
/**
* 查询
*/
function query() {
resultGrid.dataSource.page(1);
}
function deleteRow(rowNo) {
resultGrid.removeRows([rowNo]);// 刷新行号
refreshRowNo();
}
let refreshRowNo =function() {
let allRows = resultGrid.getDataItems();
for (let i = 0; i < allRows.length; i++) {
resultGrid.setCellValue(i, "rowNo", i);
resultGrid.refresh();
}
}
$(window).load(function () {
refreshRowNo();
});
/**
* 取消
*/
$('#cancel').on('click',function () {
// 关闭弹窗
parent.JSColorbox.close();
})
/**
* 确认
*/
$('#confirm').on('click',function () {
})
<!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="result" title="记录集">
<EF:EFGrid blockId="result" autoDraw="override">
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="80" align="center"/>
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="rowNo" cname="行号" hidden="true"/>
<EF:EFColumn ename="projName" cname="项目名称" enable="false" width="140" align="center"/>
<EF:EFColumn ename="prdtName" cname="部件名称" enable="false" width="100" align="center"/>
<EF:EFColumn ename="partName" cname="零件名称" enable="false" width="100" align="center"/>
<EF:EFColumn ename="partSpec" cname="规格" enable="false" width="100" align="center"/>
<EF:EFColumn ename="num" cname="数量" enable="false" width="100" align="right" format="{0:N0}"/>
<EF:EFColumn ename="unitWt" cname="单重(T)" enable="false" width="100" align="right" format="{0:N3}"/>
<EF:EFColumn ename="totalWt" cname="重量(T)" enable="false" width="100" align="right" format="{0:N3}"/>
<EF:EFColumn ename="remark1" cname="零件备注"/>
<EF:EFColumn ename="factoryName" cname="厂区" enable="false" width="140" align="center"/>
<EF:EFColumn ename="factoryCode" cname="厂区" enable="false" width="140" align="center" hidden="true"/>
<EF:EFColumn ename="orgName" cname="生产组" enable="false" width="140" align="center" hidden="true"/>
<EF:EFComboColumn ename="orgNo" cname="生产组" width="110" align="center" defaultValue=""
filter="contains">
<EF:EFOptions blockId="group_record_block_id" valueField="valueField" textField="textField"/>
</EF:EFComboColumn>
</EF:EFGrid>
</EF:EFRegion>
<span style='color: red;font-size: 13px;'>注:只会对未分派的订单进行自动排产!</span>
<div class="row">
<EF:EFButton ename="cancel" cname="取消" type="button" class="btn-align-right"/>
<EF:EFButton ename="confirm" cname="确认" type="button" class="btn-align-right"/>
</div>
</EF:EFPage>
......@@ -38,7 +38,7 @@
<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="partName" cname="零件名称" enable="false" width="120" align="center"/>
<EF:EFColumn ename="partSpec" cname="零件规格(MM)" enable="false" width="120" align="center"/>
<EF:EFColumn ename="partSpec" cname="零件规格" enable="false" width="120" align="center"/>
<EF:EFColumn ename="planCompletionDate" cname="计划完成日期" enable="false" width="100" align="center"
editType="date" dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']"/>
<EF:EFColumn ename="assignedNum" cname="派工数量" enable="false" width="80" align="right" format="{0:N0}"/>
......
......@@ -35,7 +35,7 @@
<EF:EFColumn ename="projName" cname="项目名称" enable="false" width="140" align="center"/>
<EF:EFColumn ename="prdtName" cname="部件名称" enable="false" width="100" align="center"/>
<EF:EFColumn ename="partName" cname="零件名称" enable="false" width="100" align="center"/>
<EF:EFColumn ename="partSpec" cname="零件规格(MM)" enable="false" width="100" align="center"/>
<EF:EFColumn ename="partSpec" cname="零件规格" enable="false" width="100" align="center"/>
<%--<EF:EFColumn ename="remark1" cname="零件备注"/>--%>
<EF:EFColumn ename="planCompletionDate" cname="计划完成日期" enable="false" width="120" align="center"
editType="date" dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']"/>
......
......@@ -15,13 +15,13 @@
</div>
<div class="row">
<EF:EFInput ename="detail-0-prdtName" cname="部件名称" colWidth="4" readonly="true"/>
<EF:EFInput ename="detail-0-prdtLength" cname="部件长" colWidth="4" readonly="true"/>
<EF:EFInput ename="detail-0-prdtWidth" cname="部件宽" colWidth="4" readonly="true"/>
<EF:EFInput ename="detail-0-prdtLength" cname="部件长(MM)" colWidth="4" readonly="true"/>
<EF:EFInput ename="detail-0-prdtWidth" cname="部件宽(MM)" colWidth="4" readonly="true"/>
</div>
<div class="row">
<EF:EFInput ename="detail-0-prdtThick" cname="部件厚" colWidth="4" readonly="true"/>
<EF:EFInput ename="detail-0-prdtThick" cname="部件厚(MM)" colWidth="4" readonly="true"/>
<EF:EFInput ename="detail-0-num" cname="部件数量" colWidth="4" readonly="true"/>
<EF:EFInput ename="detail-0-unitWt" cname="部件重量" colWidth="4" readonly="true"/>
<EF:EFInput ename="detail-0-unitWt" cname="部件重量(T)" colWidth="4" readonly="true"/>
</div>
<div class="row">
<EF:EFInput ename="detail-0-remark" cname="部件备注" colWidth="4" readonly="true"/>
......@@ -31,24 +31,24 @@
<EF:EFInput ename="detail-0-partName" cname="零件名称" colWidth="4" readonly="true"/>
</div>
<div class="row">
<EF:EFInput ename="detail-0-partLength" cname="零件长" colWidth="4" readonly="true"/>
<EF:EFInput ename="detail-0-partWidth" cname="零件宽" colWidth="4" readonly="true"/>
<EF:EFInput ename="detail-0-partThick" cname="零件厚" colWidth="4" readonly="true"/>
<EF:EFInput ename="detail-0-partLength" cname="零件长(MM)" colWidth="4" readonly="true"/>
<EF:EFInput ename="detail-0-partWidth" cname="零件宽(MM)" colWidth="4" readonly="true"/>
<EF:EFInput ename="detail-0-partThick" cname="零件厚(MM)" colWidth="4" readonly="true"/>
</div>
<div class="row">
<EF:EFInput ename="detail-0-remark1" cname="零件备注" colWidth="4" readonly="true"/>
<EF:EFInput ename="detail-0-num" cname="零件数量" colWidth="4" readonly="true"/>
<EF:EFInput ename="detail-0-unitWt" cname="零件重量" colWidth="4" readonly="true"/>
<EF:EFInput ename="detail-0-unitWt" cname="零件重量(T)" colWidth="4" readonly="true"/>
</div>
<div class="row">
<EF:EFInput ename="detail-0-assignedNum" cname="派工数量" colWidth="4" readonly="true"/>
<EF:EFInput ename="detail-0-totalWt" cname="派工重量" colWidth="4" readonly="true"/>
<EF:EFInput ename="detail-0-totalWt" cname="派工重量(T)" colWidth="4" readonly="true"/>
<EF:EFInput ename="detail-0-unassignedNum" cname="剩余数量" colWidth="4" readonly="true"/>
</div>
<div class="row">
<EF:EFInput ename="detail-0-unTotalWt" cname="剩余重量" colWidth="4" readonly="true"/>
<EF:EFInput ename="detail-0-unTotalWt" cname="剩余重量(T)" colWidth="4" readonly="true"/>
<EF:EFInput ename="detail-0-completeNum" cname="完成数量" colWidth="4" readonly="true"/>
<EF:EFInput ename="detail-0-actualCompletionTotalWt" cname="完成重量" colWidth="4" readonly="true"/>
<EF:EFInput ename="detail-0-actualCompletionTotalWt" cname="完成重量(T)" colWidth="4" readonly="true"/>
</div>
<div class="row">
<EF:EFDatePicker ename="detail-0-planCompletionDate" cname="计划完成日期" role="date" format="yyyy-MM-dd" parseFormats="['yyyyMMdd']" colWidth="4" readonly="true" />
......@@ -68,7 +68,7 @@
<div class="row">
<EF:EFInput cname="部件名称" blockId="result" ename="prdtName" row="0" colWidth="4" readonly="true"/>
<EF:EFInput cname="零件名称" blockId="result" ename="partName" row="0" colWidth="4" readonly="true"/>
<EF:EFInput cname="零件规格" blockId="result" ename="partSpec" row="0" colWidth="4" readonly="true"/>
<EF:EFInput cname="零件规格(MM)" blockId="result" ename="partSpec" row="0" colWidth="4" readonly="true"/>
</div>
<%--<div class="row">
<EF:EFInput cname="零件长" blockId="result" ename="partLength" row="0" colWidth="4" readonly="true"/>
......@@ -77,7 +77,7 @@
</div>--%>
<div class="row">
<EF:EFInput cname="任务数量" blockId="result" ename="num" row="0" colWidth="4" readonly="true"/>
<EF:EFInput cname="任务重量" blockId="result" ename="totalWt" row="0" colWidth="4" readonly="true"/>
<EF:EFInput cname="任务重量(T)" blockId="result" ename="totalWt" row="0" colWidth="4" readonly="true"/>
<EF:EFInput cname="完成数量" blockId="result" ename="completeNum" row="0" colWidth="4" readonly="true"/>
</div>
<div class="row">
......
......@@ -397,7 +397,7 @@ assignCallback = function (row) {
msg: '修改成功'
});
// 刷新列表
resultGrid.dataSource.page(1);
detailGrid.setEiInfo(ei);
// 关闭弹窗
JSColorbox.close();
}
......@@ -456,8 +456,10 @@ function saveFunc() {
if(flag) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGridsData("detail", "HPSC006", "insert", true);
query();
JSUtils.submitGridsData("detail", "HPSC006", "insert", true,
function (e) {
detailGrid.setEiInfo(e);
});
}
});
}
......
......@@ -45,7 +45,7 @@
<EF:EFInput ename="productionOrderNo" type="hidden"/>
<EF:EFGrid blockId="detail" autoDraw="no">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" width="140" enable="false" readonly="false"/>
<EF:EFColumn ename="operator" cname="操作" width="200" enable="false" readonly="false"/>
<EF:EFColumn enable="false" ename="reqNum" cname="领料记录" width="80" align="center" readonly="true"/>
<%-- <EF:EFComboColumn cname="材料类型" ename="inventType" width="80" align="center" required="true" >--%>
......@@ -77,7 +77,7 @@
<EF:EFColumn ename="unitWt" format="{0:N3}" width="80" cname="单重(T)" maxLength="12" displayType="0.000"
data-regex="/^-?[0-9]{1,9}([.][0-9]{1,3})?$/"
data-errorprompt="请输入数字,该值最大可设置9位整数和3位小数!"/>
<EF:EFColumn enable="false" format="{0:N3}" ename="totalWt" width="80" maxLength="12" displayType="0.000" cname="总重"/>
<EF:EFColumn enable="false" format="{0:N3}" ename="totalWt" width="80" maxLength="12" displayType="0.000" cname="总重(T)"/>
<EF:EFComboColumn ename="factoryCode" cname="厂区" width="110" align="center" defaultValue=""
filter="contains" readonly="true">
......
......@@ -15,13 +15,13 @@
</div>
<div class="row">
<EF:EFInput ename="result-0-prdtName" cname="部件名称" colWidth="4" readonly="true"/>
<EF:EFInput ename="result-0-prdtLength" cname="部件长" colWidth="4" readonly="true"/>
<EF:EFInput ename="result-0-prdtWidth" cname="部件宽" colWidth="4" readonly="true"/>
<EF:EFInput ename="result-0-prdtLength" cname="部件长(MM)" colWidth="4" readonly="true"/>
<EF:EFInput ename="result-0-prdtWidth" cname="部件宽(MM)" colWidth="4" readonly="true"/>
</div>
<div class="row">
<EF:EFInput ename="result-0-prdtThick" cname="部件厚" colWidth="4" readonly="true"/>
<EF:EFInput ename="result-0-prdtThick" cname="部件厚(MM)" colWidth="4" readonly="true"/>
<EF:EFInput ename="result-0-num" cname="部件数量" colWidth="4" readonly="true"/>
<EF:EFInput ename="result-0-unitWt" cname="部件重量" colWidth="4" readonly="true"/>
<EF:EFInput ename="result-0-unitWt" cname="部件重量(T)" colWidth="4" readonly="true"/>
</div>
<div class="row">
<EF:EFInput ename="result-0-remark" cname="部件备注" colWidth="4" readonly="true"/>
......@@ -31,24 +31,24 @@
<EF:EFInput ename="result-0-partName" cname="零件名称" colWidth="4" readonly="true"/>
</div>
<div class="row">
<EF:EFInput ename="result-0-partLength" cname="零件长" colWidth="4" readonly="true"/>
<EF:EFInput ename="result-0-partWidth" cname="零件宽" colWidth="4" readonly="true"/>
<EF:EFInput ename="result-0-partThick" cname="零件厚" colWidth="4" readonly="true"/>
<EF:EFInput ename="result-0-partLength" cname="零件长(MM)" colWidth="4" readonly="true"/>
<EF:EFInput ename="result-0-partWidth" cname="零件宽(MM)" colWidth="4" readonly="true"/>
<EF:EFInput ename="result-0-partThick" cname="零件厚(MM)" colWidth="4" readonly="true"/>
</div>
<div class="row">
<EF:EFInput ename="result-0-remark1" cname="零件备注" colWidth="4" readonly="true"/>
<EF:EFInput ename="result-0-num" cname="零件数量" colWidth="4" readonly="true"/>
<EF:EFInput ename="result-0-unitWt" cname="零件重量" colWidth="4" readonly="true"/>
<EF:EFInput ename="result-0-unitWt" cname="零件重量(T)" colWidth="4" readonly="true"/>
</div>
<div class="row">
<EF:EFInput ename="result-0-assignedNum" cname="派工数量" colWidth="4" readonly="true"/>
<EF:EFInput ename="result-0-totalWt" cname="派工重量" colWidth="4" readonly="true"/>
<EF:EFInput ename="result-0-totalWt" cname="派工重量(T)" colWidth="4" readonly="true"/>
<EF:EFInput ename="result-0-unassignedNum" cname="剩余数量" colWidth="4" readonly="true"/>
</div>
<div class="row">
<EF:EFInput ename="result-0-unTotalWt" cname="剩余重量" colWidth="4" readonly="true"/>
<EF:EFInput ename="result-0-unTotalWt" cname="剩余重量(T)" colWidth="4" readonly="true"/>
<EF:EFInput ename="result-0-completeNum" cname="完成数量" colWidth="4" readonly="true"/>
<EF:EFInput ename="result-0-actualCompletionTotalWt" cname="完成重量" colWidth="4" readonly="true"/>
<EF:EFInput ename="result-0-actualCompletionTotalWt" cname="完成重量(T)" colWidth="4" readonly="true"/>
</div>
<div class="row">
<EF:EFDatePicker ename="result-0-planCompletionDate" cname="计划完成日期" role="date" format="yyyy-MM-dd" parseFormats="['yyyyMMdd']" colWidth="4" readonly="true" />
......
......@@ -58,15 +58,15 @@
blockName="invent_name_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#">
</EF:EFComboColumn>
<EF:EFComboColumn ename="inventRecordId" cname="规格" enable="false" width="120" align="center"
<EF:EFComboColumn ename="inventRecordId" cname="规格(MM)" enable="false" width="120" align="center"
blockName="invent_spec_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#">
</EF:EFComboColumn>
<EF:EFColumn ename="amount" cname="数量" enable="false" format="{0:N0}" maxLength="20" width="100"
align="right"/>
<EF:EFColumn ename="unitWeight" cname="单重" enable="false" format="{0:N3}" maxLength="20" width="100"
<EF:EFColumn ename="unitWeight" cname="单重(KG)" enable="false" format="{0:N3}" maxLength="20" width="100"
align="right"/>
<EF:EFColumn ename="weight" cname="重量" enable="false" format="{0:N3}" maxLength="20" width="100"
<EF:EFColumn ename="weight" cname="重量(KG)" enable="false" format="{0:N3}" maxLength="20" width="100"
align="right"/>
<EF:EFColumn ename="remark" cname="备注" enable="false" width="100" align="center"/>
<EF:EFColumn ename="oldReqNo" cname="原领料单号" enable="false" width="140" align="center"/>
......
......@@ -197,6 +197,19 @@ function refreshInputSelect(container, inInfo) {
}
/**
* 当前日期 YYYY-MM-DD
*
* @returns {string}
*/
function currDate() {
const date = new Date();
const year = date.getFullYear();
const month = date.getMonth() + 1; // 月份从0开始,需要加1
const day = date.getDate();
return year + '-' + (month < 10 ? '0' + month : month) + '-' + (day < 10 ? '0' + day : day);
}
/**
* 当前日期 YYYYMMDD
*
* @returns {string}
......
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