Commit 98d770c8 by liulei

生产下料、销售出库、生产领料优化

parent 9dd3a92c
......@@ -46,6 +46,8 @@ public class HPKC002 extends DaoEPBase {
public static final String FIELD_KC_ID = "kcId"; /* 库存ID*/
public static final String FIELD_OLD_REQ_NO = "oldReqNo"; /* 原领料单号*/
public static final String FIELD_DELETE_FLAG = "deleteFlag"; /* 是否删除0.否1.是*/
public static final String FIELD_PROJ_CODE = "projCode"; /* 项目编码*/
public static final String FIELD_PROJ_NAME = "projName"; /* 项目名称*/
public static final String COL_ID = "ID"; /* 主键id*/
public static final String COL_COMPANY_CODE = "COMPANY_CODE"; /* 企业编码 预留*/
......@@ -71,6 +73,8 @@ public class HPKC002 extends DaoEPBase {
public static final String COL_KC_ID = "KC_ID"; /* 库存ID*/
public static final String COL_OLD_REQ_NO = "OLD_REQ_NO"; /* 原领料单号*/
public static final String COL_DELETE_FLAG = "DELETE_FLAG"; /* 是否删除0.否1.是*/
public static final String COL_PROJ_CODE = "PROJ_CODE"; /* 项目编码*/
public static final String COL_PROJ_NAME = "PROJ_NAME"; /* 项目名称*/
public static final String QUERY = "HPKC002.query";
public static final String COUNT = "HPKC002.count";
......@@ -102,6 +106,8 @@ public class HPKC002 extends DaoEPBase {
private Long kcId; /* 库存ID*/
private String oldReqNo = " "; /* 原领料单号*/
private Integer deleteFlag; /* 是否删除0.否1.是*/
private String projCode = " "; /* 项目编码*/
private String projName = " "; /* 项目名称*/
/**
* initialize the metadata.
......@@ -214,6 +220,14 @@ public class HPKC002 extends DaoEPBase {
eiColumn = new EiColumn(FIELD_DELETE_FLAG);
eiColumn.setDescName("是否删除0.否1.是");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_PROJ_CODE);
eiColumn.setDescName("项目编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_PROJ_NAME);
eiColumn.setDescName("项目名称");
eiMetadata.addMeta(eiColumn);
}
......@@ -609,6 +623,39 @@ public class HPKC002 extends DaoEPBase {
public void setDeleteFlag(Integer deleteFlag) {
this.deleteFlag = deleteFlag;
}
/**
* get the projCode - 项目编码.
* @return the projCode
*/
public String getProjCode() {
return this.projCode;
}
/**
* set the projCode - 项目编码.
*
* @param projCode - 项目编码
*/
public void setProjCode(String projCode) {
this.projCode = projCode;
}
/**
* get the projName - 项目名称.
* @return the projName
*/
public String getProjName() {
return this.projName;
}
/**
* set the projName - 项目名称.
*
* @param projName - 项目名称
*/
public void setProjName(String projName) {
this.projName = projName;
}
/**
* get the value from Map.
*
......@@ -641,6 +688,8 @@ public class HPKC002 extends DaoEPBase {
setKcId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_KC_ID)), kcId));
setOldReqNo(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_OLD_REQ_NO)), oldReqNo));
setDeleteFlag(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_DELETE_FLAG)), deleteFlag));
setProjCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PROJ_CODE)), projCode));
setProjName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PROJ_NAME)), projName));
}
/**
......@@ -674,6 +723,8 @@ public class HPKC002 extends DaoEPBase {
map.put(FIELD_KC_ID, StringUtils.toString(kcId, eiMetadata.getMeta(FIELD_KC_ID)));
map.put(FIELD_OLD_REQ_NO, StringUtils.toString(oldReqNo, eiMetadata.getMeta(FIELD_OLD_REQ_NO)));
map.put(FIELD_DELETE_FLAG, StringUtils.toString(deleteFlag, eiMetadata.getMeta(FIELD_DELETE_FLAG)));
map.put(FIELD_PROJ_CODE, StringUtils.toString(projCode, eiMetadata.getMeta(FIELD_PROJ_CODE)));
map.put(FIELD_PROJ_NAME, StringUtils.toString(projName, eiMetadata.getMeta(FIELD_PROJ_NAME)));
return map;
}
......
......@@ -53,6 +53,8 @@ public class HPKC004 extends DaoEPBase {
public static final String FIELD_UPDATED_NAME = "updatedName"; /* 修改人名称*/
public static final String FIELD_UPDATED_TIME = "updatedTime"; /* 修改时间*/
public static final String FIELD_DELETE_FLAG = "deleteFlag"; /* 是否删除*/
public static final String FIELD_INVENT_RECORD_ID = "inventRecordId"; /* 存货档案ID*/
public static final String COL_ID = "ID"; /* ID*/
public static final String COL_COMPANY_CODE = "COMPANY_CODE"; /* 企业编码 预留*/
......@@ -85,6 +87,7 @@ public class HPKC004 extends DaoEPBase {
public static final String COL_UPDATED_NAME = "UPDATED_NAME"; /* 修改人名称*/
public static final String COL_UPDATED_TIME = "UPDATED_TIME"; /* 修改时间*/
public static final String COL_DELETE_FLAG = "DELETE_FLAG"; /* 是否删除*/
public static final String COL_INVENT_RECORD_ID = "INVENT_RECORD_ID"; /* 存货档案ID*/
public static final String QUERY = "HPKC004.query";
public static final String COUNT = "HPKC004.count";
......@@ -123,6 +126,7 @@ public class HPKC004 extends DaoEPBase {
private String updatedName = " "; /* 修改人名称*/
private String updatedTime = " "; /* 修改时间*/
private Integer deleteFlag; /* 是否删除*/
private Long inventRecordId = new Long(0); /* 存货档案ID*/
/**
* initialize the metadata.
......@@ -273,7 +277,9 @@ public class HPKC004 extends DaoEPBase {
eiColumn.setDescName("是否删除");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_INVENT_RECORD_ID);
eiColumn.setDescName("存货档案ID");
eiMetadata.addMeta(eiColumn);
}
/**
......@@ -780,6 +786,22 @@ public class HPKC004 extends DaoEPBase {
this.deleteFlag = deleteFlag;
}
/**
* get the inventRecordId - 存货档案ID.
* @return the inventRecordId
*/
public Long getInventRecordId() {
return this.inventRecordId;
}
/**
* set the inventRecordId - 存货档案ID.
*
* @param inventRecordId - 存货档案ID
*/
public void setInventRecordId(Long inventRecordId) {
this.inventRecordId = inventRecordId;
}
/**
* get the value from Map.
*
* @param map - source data map
......@@ -818,6 +840,7 @@ public class HPKC004 extends DaoEPBase {
setUpdatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_NAME)), updatedName));
setUpdatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_TIME)), updatedTime));
setDeleteFlag(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_DELETE_FLAG)), deleteFlag));
setInventRecordId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_INVENT_RECORD_ID)), inventRecordId));
}
/**
......@@ -858,7 +881,7 @@ public class HPKC004 extends DaoEPBase {
map.put(FIELD_UPDATED_NAME, StringUtils.toString(updatedName, eiMetadata.getMeta(FIELD_UPDATED_NAME)));
map.put(FIELD_UPDATED_TIME, StringUtils.toString(updatedTime, eiMetadata.getMeta(FIELD_UPDATED_TIME)));
map.put(FIELD_DELETE_FLAG, StringUtils.toString(deleteFlag, eiMetadata.getMeta(FIELD_DELETE_FLAG)));
map.put(FIELD_INVENT_RECORD_ID, StringUtils.toString(inventRecordId, eiMetadata.getMeta(FIELD_INVENT_RECORD_ID)));
return map;
}
}
......@@ -41,6 +41,7 @@ public class HPKC010 extends DaoEPBase {
public static final String FIELD_UPDATED_NAME = "updatedName"; /* 更新人名称*/
public static final String FIELD_UPDATED_TIME = "updatedTime"; /* 更新时间*/
public static final String FIELD_VERSION = "version"; /* 版本号*/
public static final String FIELD_PROJ_NAME = "projName"; /* 项目名称*/
public static final String COL_ID = "ID";
public static final String COL_COMPANY_CODE = "COMPANY_CODE"; /* 企业编码*/
......@@ -61,6 +62,7 @@ public class HPKC010 extends DaoEPBase {
public static final String COL_UPDATED_NAME = "UPDATED_NAME"; /* 更新人名称*/
public static final String COL_UPDATED_TIME = "UPDATED_TIME"; /* 更新时间*/
public static final String COL_VERSION = "VERSION"; /* 版本号*/
public static final String COL_PROJ_NAME = "PROJ_NAME"; /* 项目名称*/
public static final String QUERY = "HPKC010.query";
public static final String COUNT = "HPKC010.count";
......@@ -87,6 +89,7 @@ public class HPKC010 extends DaoEPBase {
private String updatedName = " "; /* 更新人名称*/
private String updatedTime = " "; /* 更新时间*/
private Integer version; /* 版本号*/
private String projName = " "; /* 项目名称*/
/**
* initialize the metadata.
......@@ -179,6 +182,10 @@ public class HPKC010 extends DaoEPBase {
eiColumn = new EiColumn(FIELD_VERSION);
eiColumn.setDescName("版本号");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_PROJ_NAME);
eiColumn.setDescName("项目名称");
eiMetadata.addMeta(eiColumn);
}
......@@ -495,6 +502,22 @@ public class HPKC010 extends DaoEPBase {
this.version = version;
}
/**
* get the projName - 项目名称.
* @return the projName
*/
public String getProjName() {
return this.projName;
}
/**
* set the projName - 项目名称.
*
* @param projName - 项目名称
*/
public void setProjName(String projName) {
this.projName = projName;
}
/**
* get the value from Map.
*
* @param map - source data map
......@@ -521,6 +544,7 @@ public class HPKC010 extends DaoEPBase {
setUpdatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_NAME)), updatedName));
setUpdatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_TIME)), updatedTime));
setVersion(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_VERSION)), version));
setProjName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PROJ_NAME)), projName));
}
/**
......@@ -549,6 +573,7 @@ public class HPKC010 extends DaoEPBase {
map.put(FIELD_UPDATED_NAME, StringUtils.toString(updatedName, eiMetadata.getMeta(FIELD_UPDATED_NAME)));
map.put(FIELD_UPDATED_TIME, StringUtils.toString(updatedTime, eiMetadata.getMeta(FIELD_UPDATED_TIME)));
map.put(FIELD_VERSION, StringUtils.toString(version, eiMetadata.getMeta(FIELD_VERSION)));
map.put(FIELD_PROJ_NAME, StringUtils.toString(projName, eiMetadata.getMeta(FIELD_PROJ_NAME)));
return map;
}
......
......@@ -49,6 +49,7 @@ public class ServiceHPKC002 extends ServiceBase {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_NAME_BLOCK_ID), queryMap);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_SPEC_BLOCK_ID), queryMap, false);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.SPEC_NAME_BLOCK_ID), queryMap, false);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.PROJ_RECORD_BLOCK_ID), null, false);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HPKC002().eiMetadata);
inInfo.setBlock(InventTypeEnum.generatorEiBlock());
} catch (PlatException e) {
......
......@@ -5,10 +5,14 @@ import com.baosight.hpjx.common.DdynamicEnum;
import com.baosight.hpjx.common.InventTypeEnum;
import com.baosight.hpjx.core.constant.CommonConstant;
import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.core.security.UserSessionUtils;
import com.baosight.hpjx.hp.constant.HPConstant;
import com.baosight.hpjx.hp.kc.domain.HPKC002;
import com.baosight.hpjx.hp.kc.domain.HPKC010;
import com.baosight.hpjx.hp.kc.tools.HPKCTools;
import com.baosight.hpjx.hp.sc.domain.HPSC001;
import com.baosight.hpjx.hp.sc.domain.HPSC005;
import com.baosight.hpjx.hp.sc.tools.HPSCTools;
import com.baosight.hpjx.util.AssertUtils;
import com.baosight.hpjx.util.BeanUtils;
import com.baosight.hpjx.util.CommonMethod;
......@@ -56,6 +60,8 @@ public class ServiceHPKC002A extends ServiceEPBase {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_NAME_BLOCK_ID), queryMap);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_SPEC_BLOCK_ID), queryMap, false);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.SPEC_NAME_BLOCK_ID), queryMap, false);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.SPEC_NAME_BLOCK_ID), queryMap, false);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.PROJ_RECORD_BLOCK_ID), null, false);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HPKC010().eiMetadata);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
......@@ -136,6 +142,7 @@ public class ServiceHPKC002A extends ServiceEPBase {
for (Map row : resultRows) {
BigDecimal applyAmount = MapUtils.getBigDecimal(row, "applyAmount");
String applyRemark = MapUtils.getString(row, "applyRemark");
String projName = MapUtils.getString(row, "projCode");
Long kcId = MapUtils.getLong(row, "id");
HPKC010 dbKc010 = dbKc010Map.get(kcId);
HPKC002 newKc002 = BeanUtils.copy(dbKc010, HPKC002.class);
......@@ -146,7 +153,12 @@ public class ServiceHPKC002A extends ServiceEPBase {
newKc002.setRemark(applyRemark);
newKc002.setKcId(kcId);
newKc002.setDeleteFlag(CommonConstant.YesNo.NO_0);
//绑定项目
HPSC001 HPSC001 = HPSCTools.HpSc001.getId(projName);
newKc002.setProjCode(HPSC001.getProjCode());
DaoUtils.insert(HPKC002.INSERT, newKc002);
// 修改库存数量
HPKCTools.updateStock(newKc002.getWhCode(), newKc002.getInventRecordId(),
newKc002.getAmount().negate(), dbKc010.getUnitWeight(), newKc002.getWeight().negate());
......
......@@ -7,6 +7,7 @@ import com.baosight.hpjx.core.constant.CommonConstant;
import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.hp.constant.HPConstant;
import com.baosight.hpjx.hp.kc.domain.HPKC004;
import com.baosight.hpjx.hp.kc.domain.HPKC010;
import com.baosight.hpjx.hp.kc.tools.HPKCTools;
import com.baosight.hpjx.util.BeanUtils;
import com.baosight.hpjx.util.CommonMethod;
......@@ -99,6 +100,7 @@ public class ServiceHPKC004 extends ServiceBase {
for (int i = 0; i < resultRows.size(); i++) {
HPKC004 fKc004 = new HPKC004();
fKc004.fromMap(resultRows.get(i));
HPKC010 hpkc010 = HPKCTools.HpKc010.listById(fKc004.getKcId());
DaoUtils.update(HPKC004.DELETE, fKc004);
// 生成红冲记录
HPKC004 dbKc004 = mapKc004.get(fKc004.getSaleNo());
......@@ -111,8 +113,12 @@ public class ServiceHPKC004 extends ServiceBase {
newKc004.setDeleteFlag(CommonConstant.YesNo.YES_1);
DaoUtils.insert(HPKC004.INSERT, newKc004);
// 修改库存
if (dbKc004.getProdNo().equals(" "))
HPKCTools.updateStock(dbKc004.getWhCode(), hpkc010.getInventRecordId(),
dbKc004.getAmount(), dbKc004.getWeight());
else
HPKCTools.updateProdStock(dbKc004.getWhCode(), dbKc004.getProdNo(),
dbKc004.getAmount(), dbKc004.getWeight());
dbKc004.getAmount(), dbKc004.getWeight());
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
......
package com.baosight.hpjx.hp.kc.service;
import com.baosight.hpjx.aspect.annotation.OperationLogAnnotation;
import com.baosight.hpjx.common.DdynamicEnum;
import com.baosight.hpjx.common.InventTypeEnum;
import com.baosight.hpjx.core.constant.CommonConstant;
import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.hp.constant.HPConstant;
import com.baosight.hpjx.hp.kc.domain.HPKC002;
import com.baosight.hpjx.hp.kc.domain.HPKC004;
import com.baosight.hpjx.hp.kc.domain.HPKC010;
import com.baosight.hpjx.hp.kc.tools.HPKCTools;
import com.baosight.hpjx.hp.sc.domain.HPSC001;
import com.baosight.hpjx.hp.sc.tools.HPSCTools;
import com.baosight.hpjx.util.*;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import java.math.BigDecimal;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 生产领料挑选库存
*
* @author:songx
* @date:2022/7/11,11:08
*/
public class ServiceHPKC004B extends ServiceEPBase {
// 指定存货类型
private static final Integer[] DEFAULT_INVENT_CODE = {InventTypeEnum.CONSUMABLE.getCode(),
InventTypeEnum.CONSUMABLE.getCode()};
/**
* 初始化
*
* @param inInfo
* @return
*/
@Override
@OperationLogAnnotation(operModul = "耗材库存查询", operType = "查询", operDesc = "销售出库单-耗材库存查询-初始化")
public EiInfo initLoad(EiInfo inInfo) {
try {
Map queryMap = new HashMap();
queryMap.put("inventTypes", DEFAULT_INVENT_CODE);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.WH_RECORD_BLOCK_ID), queryMap);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_NAME_BLOCK_ID), queryMap);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_SPEC_BLOCK_ID), queryMap, false);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.SPEC_NAME_BLOCK_ID), queryMap, false);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.SPEC_NAME_BLOCK_ID), queryMap, false);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.PROJ_RECORD_BLOCK_ID), null, false);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HPKC010().eiMetadata);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询数据列表
*
* @param inInfo
* @return
*/
@Override
@OperationLogAnnotation(operModul = "耗材库存查询", operType = "查询", operDesc = "销售出库单-耗材库存查询-查询")
public EiInfo query(EiInfo inInfo) {
try {
Map queryRow = EiInfoUtils.getFirstRow(inInfo);
queryRow.put("inventTypes", DEFAULT_INVENT_CODE);
inInfo = super.query(inInfo, HPKC010.QUERY, new HPKC010());
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
/**
* 生成出库单
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "库存查询",operType = "插入",operDesc = "销售出库单-耗材库存查询-生成出库单")
public EiInfo select(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 库存ID
List<Long> ids = ObjectUtils.listKey(resultRows, "id");
// 行锁
HPKCTools.HpKc010.lock(ids);
// 获取库存信息
Map<Long, HPKC010> dbKc010Map = HPKCTools.HpKc010.map(ids);
// 状态校验
this.checkData(resultRows, dbKc010Map);
// 生成销售库单
this.saveData(resultRows, dbKc010Map);
} catch (Exception e) {
LogUtils.setMsg(inInfo, e, "生成耗材出库单失败");
}
return inInfo;
}
/**
* 数据校验
*
* @param resultRows
* @param dbKc010Map
*/
private void checkData(List<Map> resultRows, Map<Long, HPKC010> dbKc010Map) {
for (Map row : resultRows) {
Long id = MapUtils.getLong(row, "id");
HPKC010 dbKc010 = dbKc010Map.get(id);
AssertUtils.isNull(dbKc010, "耗材库存号[" + id + "]不存在!");
// 校验数量
BigDecimal applyAmount = MapUtils.getBigDecimal(row, "applyAmount");
AssertUtils.isGt(applyAmount, dbKc010.getAmount(),
"耗材库存号[" + id + "]可用数量不足!");
}
}
/**
* 保存数据
*
* @param resultRows
* @param dbKc010Map
*/
private void saveData(List<Map> resultRows, Map<Long, HPKC010> dbKc010Map) {
for (Map row : resultRows) {
BigDecimal applyAmount = MapUtils.getBigDecimal(row, "applyAmount");
String applyRemark = MapUtils.getString(row, "applyRemark");
String projName = MapUtils.getString(row, "projCode");
Long kcId = MapUtils.getLong(row, "id");
HPKC010 dbKc010 = dbKc010Map.get(kcId);
HPKC004 newKc004 = BeanUtils.copy(dbKc010, HPKC004.class);
newKc004.setSaleNo(SequenceGenerator.getNextSequence(HPConstant.SequenceId.HPKC004_SALE_NO));
newKc004.setReceiptDate(DateUtils.shortDate());
newKc004.setAmount(applyAmount);
newKc004.setWeight(dbKc010.getUnitWeight().multiply(applyAmount));
newKc004.setRemark(applyRemark);
newKc004.setKcId(kcId);
newKc004.setIsPrint(CommonConstant.YesNo.NO_0);
newKc004.setDeleteFlag(CommonConstant.YesNo.NO_0);
//绑定项目
HPSC001 HPSC001 = HPSCTools.HpSc001.getId(projName);
newKc004.setProjCode(HPSC001.getProjCode());
newKc004.setProjName(projName);
DaoUtils.insert(HPKC004.INSERT, newKc004);
// 修改库存数量
HPKCTools.updateStock(newKc004.getWhCode(), dbKc010.getInventRecordId(),
newKc004.getAmount().negate(), dbKc010.getUnitWeight(), newKc004.getWeight().negate());
}
}
}
......@@ -26,7 +26,8 @@
REMARK as "remark", <!-- 备注 -->
KC_ID as "kcId", <!-- 库存ID -->
OLD_REQ_NO as "oldReqNo", <!-- 原领料单号 -->
DELETE_FLAG as "deleteFlag" <!-- 是否删除0.否1.是 -->
DELETE_FLAG as "deleteFlag", <!-- 是否删除0.否1.是 -->
PROJ_CODE as "projCode"
</sql>
<sql id="condition">
......
......@@ -556,6 +556,18 @@ public class HPKCTools {
queryMap.put("inventRecordId", inventRecordId);
return DaoBase.getInstance().query(HPKC010.QUERY, queryMap);
}
/**
* 查询
*
* @param id
* @return
*/
public static HPKC010 listById(Long id) {
Map queryMap = new HashMap();
queryMap.put("id", id);
return (HPKC010) DaoBase.getInstance().query(HPKC010.QUERY, queryMap).get(0);
}
/**
* 查询库存信息
......
......@@ -3,13 +3,18 @@ package com.baosight.hpjx.hp.mt.service;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.extra.servlet.multipart.UploadFile;
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.security.UserSessionUtils;
import com.baosight.hpjx.hp.constant.HPConstant;
import com.baosight.hpjx.hp.constant.HPSqlConstant;
import com.baosight.hpjx.hp.mt.untils.uploadUntil;
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;
......@@ -22,10 +27,7 @@ import com.baosight.iplat4j.ed.util.SequenceGenerator;
import org.apache.commons.collections.MapUtils;
import org.springframework.web.multipart.commons.CommonsMultipartFile;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
/**
* 鸿鹏机械APP移动端接口调用处
......@@ -140,6 +142,25 @@ public class ServiceHPMT002 extends ServiceBase {
}
/**
* 生产管理-质量巡检填报下拉
*
* @param inInfo
* @return
*/
public EiInfo pmQualityXl(EiInfo inInfo) {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
String companyCode = UserSessionUtils.getCompanyCode();
if (StrUtil.isEmpty(companyCode)) {
inInfo.setMsg("账号异常");
}
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);
return outInfo;
}
/**
* 生产管理-质量巡检新增
*
* @param inInfo
......@@ -147,24 +168,25 @@ public class ServiceHPMT002 extends ServiceBase {
*/
public EiInfo pmInsertQuality(EiInfo inInfo) {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
String projCode = MapUtils.getString(queryMap, "projCode");
String prodOrderNo = MapUtils.getString(queryMap, "prodOrderNo");
String docId = MapUtils.getString(queryMap, "docId");
String companyCode = UserSessionUtils.getCompanyCode();
if (StrUtil.isEmpty(companyCode)) {
inInfo.setMsg("账号异常");
}
try {
HPZL001 fZl001 = new HPZL001();
fZl001.fromMap(queryMap);
//处理文件
CommonsMultipartFile[] multipartFile = (CommonsMultipartFile[]) queryMap.get("multipartFile");
int num=0;
while (num<=multipartFile.length){
try {
uploadUntil.upload(multipartFile[num]);
}catch (Exception e){
LogUtils.setDetailMsg(inInfo, e, "上传失败");
}
num++;
}
Map sqlMap = new HashMap();
sqlMap.put("companyCode", companyCode);
sqlMap.put("projCode", projCode);
sqlMap.put("prodOrderNo", prodOrderNo);
HPSC005 HPSC005 =(HPSC005) dao.query("HPSC005.query",sqlMap );
HPZL001 fZl001 = new HPZL001();
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()));
// 生成单据号
......@@ -172,7 +194,23 @@ public class ServiceHPMT002 extends ServiceBase {
HPConstant.SequenceId.HPZL001_NUMBER));
fZl001.setDeleteFlag(CommonConstant.YesNo.NO_0);
DaoUtils.insert(HPZL001.INSERT, fZl001);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
//处理文件
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){
HPSC002A HPSC002A = new HPSC002A();
HPSC002A.setBizType(CommonConstant.YesNo.NO_0.toString());
HPSC002A.setDocId(docIds[num]);
HPSC002A.setMatId(HPZL001.getId());
HPSC002A.setCompanyCode(companyCode);
DaoUtils.insert(HPSC002A.INSERT, HPSC002A);
num++;
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("新增成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "新增失败");
......@@ -189,6 +227,7 @@ public class ServiceHPMT002 extends ServiceBase {
*/
public EiInfo pmModifyQuality(EiInfo inInfo) {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
String docId = MapUtils.getString(queryMap, "docId");
String companyCode = UserSessionUtils.getCompanyCode();
if (StrUtil.isEmpty(companyCode)) {
inInfo.setMsg("账号异常");
......@@ -196,12 +235,23 @@ public class ServiceHPMT002 extends ServiceBase {
try {
HPZL001 fZl001 = new HPZL001();
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);
//绑定文件
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("新增成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "新增失败");
......
......@@ -139,15 +139,6 @@
<include refid="getCondition"/>
</select>
<!-- 查询 -->
<select id="get2" resultClass="com.baosight.hpjx.hp.pz.domain.HPPZ011">
SELECT
<include refid="column2"/>
FROM ${hpjxSchema}.T_HPPZ011 A
WHERE 1=1
<include refid="condition2"/>
</select>
<insert id="insert">
INSERT INTO ${hpjxSchema}.T_HPPZ011 (
COMPANY_CODE, <!-- 企业编码 预留 -->
......
......@@ -1260,7 +1260,7 @@ public class HPSC005C extends DaoEPBase {
setFilePath5(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_FILE_PATH5)), filePath5));
setInventRecordId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_INVENT_RECORD_ID)), inventRecordId));
setCompleteNum(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_COMPLETE_NUM)), completeNum));
setTotalWt(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_UN_TOTAL_WT)), unTotalWt));
setUnTotalWt(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_UN_TOTAL_WT)), unTotalWt));
setActualCompletionDate(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_ACTUAL_COMPLETION_DATE)), actualCompletionDate));
setActualCompletionTotalWt(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_ACTUAL_COMPLETION_TOTAL_WT)), actualCompletionTotalWt));
}
......@@ -1319,7 +1319,7 @@ public class HPSC005C extends DaoEPBase {
map.put(FIELD_FILE_PATH5, StringUtils.toString(filePath5, eiMetadata.getMeta(FIELD_FILE_PATH5)));
map.put(FIELD_INVENT_RECORD_ID, StringUtils.toString(inventRecordId, eiMetadata.getMeta(FIELD_INVENT_RECORD_ID)));
map.put(FIELD_COMPLETE_NUM, StringUtils.toString(completeNum, eiMetadata.getMeta(FIELD_COMPLETE_NUM)));
map.put(FIELD_TOTAL_WT, StringUtils.toString(unTotalWt, eiMetadata.getMeta(FIELD_UN_TOTAL_WT)));
map.put(FIELD_UN_TOTAL_WT, StringUtils.toString(unTotalWt, eiMetadata.getMeta(FIELD_UN_TOTAL_WT)));
map.put(FIELD_ACTUAL_COMPLETION_DATE, StringUtils.toString(actualCompletionDate, eiMetadata.getMeta(FIELD_ACTUAL_COMPLETION_DATE)));
map.put(FIELD_ACTUAL_COMPLETION_TOTAL_WT, StringUtils.toString(actualCompletionTotalWt, eiMetadata.getMeta(FIELD_ACTUAL_COMPLETION_TOTAL_WT)));
return map;
......
......@@ -3,6 +3,7 @@ package com.baosight.hpjx.hp.sc.service;
import com.baosight.hpjx.aspect.annotation.OperationLogAnnotation;
import com.baosight.hpjx.hp.sc.domain.HPSC005A;
import com.baosight.hpjx.hp.sc.domain.HPSC005B;
import com.baosight.hpjx.hp.sc.domain.HPSC005C;
import com.baosight.hpjx.hp.sc.tools.HPSCTools;
import com.baosight.hpjx.util.EiInfoUtils;
import com.baosight.hpjx.util.LogUtils;
......@@ -31,6 +32,9 @@ public class ServiceHPSC005D extends ServiceBase {
try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
String prodTaskNo = MapUtils.getString(queryMap, "prodTaskNo");
String prodOrderNo =prodTaskNo.substring(0,prodTaskNo.indexOf("-"));
HPSC005C dbSc005 = HPSCTools.HpSc005.getDetails(prodOrderNo);
inInfo.addBlock("detail").addRow(dbSc005);
HPSC005B dbSc005b = HPSCTools.HpSc005b.get(prodTaskNo);
EiBlock resultBlock = inInfo.addBlock(EiConstant.resultBlock);
resultBlock.addRow(dbSc005b);
......
......@@ -11,6 +11,7 @@ import com.baosight.hpjx.hp.constant.HPConstant;
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.xs.domain.Org;
import com.baosight.hpjx.util.AssertUtils;
import com.baosight.hpjx.util.CommonMethod;
import com.baosight.hpjx.util.LogUtils;
......@@ -119,9 +120,10 @@ public class ServiceHPSC006 extends ServiceBase {
if(HPSC006.getFactoryCode()!=null && !(HPSC006.getFactoryCode().equals(" "))) {
AssertUtils.isEmpty(HPSC006.getOrgNo(), "已选择厂区,下料组不能为空");
HPSC006.setStatus(1);
HPPZ011 HPPZ011 =(HPPZ011) dao.get("HPPZ011.get2","groupCode", HPSC006.getOrgNo());
HPSC006.setOrgName(HPPZ011.getGroupName());
HPSC006.setFactoryName(HPPZ011.getFactoryName());
Org Org =(Org) dao.get("HPXSOrg.query","orgId",HPSC006.getOrgNo());
Org Fac =(Org) dao.get("HPXSOrg.query","orgId",Org.getParentOrgId());
HPSC006.setOrgName(Org.getOrgCname());
HPSC006.setFactoryName(Fac.getOrgCname());
}
DaoUtils.insert("HPSC006.insert",HPSC006);
}
......@@ -165,9 +167,10 @@ public class ServiceHPSC006 extends ServiceBase {
HPSC006.setTotalWt(totalWt);
HPSC006.setPlanCompletionDate(StringUtil.removeHorizontalLine(HPSC006.getPlanCompletionDate()));
HPSC006.setInventCode(HPPZTools.checkAndSavePZ04(HPSC006.getInventType(),HPSC006.getInventName()));
HPPZ011 HPPZ011 =(HPPZ011) dao.get("HPPZ011.get2","groupCode", HPSC006.getOrgNo());
HPSC006.setOrgName(HPPZ011.getGroupName());
HPSC006.setFactoryName(HPPZ011.getFactoryName());
Org Org =(Org) dao.get("HPXSOrg.query","orgId",HPSC006.getOrgNo());
Org Fac =(Org) dao.get("HPXSOrg.query","orgId",Org.getParentOrgId());
HPSC006.setOrgName(Org.getOrgCname());
HPSC006.setFactoryName(Fac.getOrgCname());
DaoUtils.update("HPSC006.update",HPSC006);
}
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
......@@ -248,9 +251,10 @@ public class ServiceHPSC006 extends ServiceBase {
public EiInfo assign(EiInfo eiInfo) {
try {
String ids = eiInfo.get("ids").toString();
String orgId = eiInfo.get("id").toString();
//先找到分派的组织
HPPZ011 HPPZ011 =(HPPZ011) dao.get("HPPZ011.get","id", orgId);
String factoryCode = eiInfo.get("factoryCode").toString();
String factoryName = eiInfo.get("factoryName").toString();
String groupCode = eiInfo.get("groupCode").toString();
String groupName = eiInfo.get("groupName").toString();
String [] id = ids.split(",");
for (int i = 0; i < id.length; i++) {
......@@ -258,10 +262,10 @@ public class ServiceHPSC006 extends ServiceBase {
HPSC006 HPSC006 = new HPSC006();
HPSC006.setId(NumberUtils.toLong(id[i]));
HPSC006.setStatus(1);
HPSC006.setOrgNo(HPPZ011.getGroupCode());
HPSC006.setOrgName(HPPZ011.getGroupName());
HPSC006.setFactoryCode(HPPZ011.getFactoryCode());
HPSC006.setFactoryName(HPPZ011.getFactoryName());
HPSC006.setOrgNo(groupCode);
HPSC006.setOrgName(groupName);
HPSC006.setFactoryCode(factoryCode);
HPSC006.setFactoryName(factoryName);
DaoUtils.update("HPSC006.updateAssign", HPSC006.toMap());
}
......
......@@ -3,6 +3,7 @@ package com.baosight.hpjx.hp.sc.service;
import com.baosight.hpjx.aspect.annotation.OperationLogAnnotation;
import com.baosight.hpjx.common.DdynamicEnum;
import com.baosight.hpjx.hp.pz.domain.HPPZ011;
import com.baosight.hpjx.hp.xs.domain.Org;
import com.baosight.hpjx.util.CommonMethod;
import com.baosight.hpjx.util.LogUtils;
import com.baosight.iplat4j.core.ei.EiConstant;
......@@ -29,7 +30,7 @@ public class ServiceHPSC098 extends ServiceBase {
public EiInfo initLoad(EiInfo inInfo) {
try {
Map queryMap = new HashMap();
queryMap.put("orgType", "dept");
queryMap.put("orgType", "cutGroup");
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.ORG_RECORD_BLOCK_ID), queryMap);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.GROUP_RECORD_BLOCK_ID), null);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HPPZ011().eiMetadata);
......@@ -49,7 +50,7 @@ public class ServiceHPSC098 extends ServiceBase {
@Override
public EiInfo query(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HPPZ011.QUERY, new HPPZ011());
inInfo = super.query(inInfo, "HPXSOrg.queryList", new HPPZ011());
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
......
......@@ -194,6 +194,19 @@
ORDER BY PROJ_CODE
</select>
<select id="queryProjCode" parameterClass="java.util.HashMap"
resultClass="com.baosight.hpjx.hp.sc.domain.HPSC001">
SELECT
PROJ_CODE as "projCode"
FROM hpjx.t_hpsc001 WHERE 1=1
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projName">
PROJ_NAME = #projName#
</isNotEmpty>
</select>
<update id="check">
UPDATE hpjx.t_hpsc001 SET status = #status# WHERE ID = #id#
</update>
......
......@@ -93,8 +93,8 @@
A.UNASSIGNED_NUM as "unassignedNum", <!-- 待派工数量 -->
A.DOCUMENT_TYPE as "documentType", <!-- 单据类型 0-非子母单;1-子母单 -->
B.COMPLETE_NUM as "completeNum", <!-- 已完成数量 -->
COALESCE(C.TOTAL_WT-C.ACTUAL_COMPLETION_NUM,0) as "unTotalWt", <!-- 剩余重量 -->
COALESCE(C.ACTUAL_COMPLETION_DATE,"") as "actualCompletionDate", <!-- 实际完工日期 -->
COALESCE(A.TOTAL_WT*A.UNASSIGNED_NUM,0) as "unTotalWt", <!-- 剩余重量 -->
COALESCE(C.ACTUAL_COMPLETION_DATE,"") as "actualCompletionDate", <!-- 实际完工日期 -->
COALESCE(C.ACTUAL_COMPLETION_NUM,0) as "actualCompletionTotalWt"<!-- 实际完工重量 -->
</sql>
......
......@@ -2,6 +2,7 @@ package com.baosight.hpjx.hp.sc.tools;
import com.baosight.hpjx.core.dao.DaoBase;
import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.core.security.UserSessionUtils;
import com.baosight.hpjx.hp.constant.HPSqlConstant;
import com.baosight.hpjx.hp.sc.domain.HPSC001;
import com.baosight.hpjx.hp.sc.domain.HPSC002;
......@@ -146,6 +147,23 @@ public class HPSCTools {
AssertUtils.isNull(results, String.format("项目编码[%s]信息不存在", projCode));
return results.get(0);
}
/**
* 查询
*
* @param projName
* @return
*/
public static HPSC001 getId(String projName) {
AssertUtils.isEmpty(projName, "项目编码不能为空");
String companyCode = UserSessionUtils.getCompanyCode();
Map queryMap = new HashMap();
queryMap.put("projName", projName);
queryMap.put("companyCode", companyCode);
List<HPSC001> results = DaoBase.getInstance().query("HPSC001.queryProjCode", queryMap);
AssertUtils.isNull(results.get(0).getProjCode(), String.format("项目名[%s]信息不存在", projName));
return results.get(0);
}
/**
* 查询
......
......@@ -119,4 +119,26 @@
ORDER BY T2.LEVEL, T3.ORG_ID
</select>
<!-- 查询组织信息 -->
<select id="queryList" resultClass="com.baosight.hpjx.hp.pz.domain.HPPZ011">
SELECT
A.ORG_ENAME AS "groupCode",
A.ORG_CNAME AS "groupName",
A.PARENT_ORG_ID AS "factoryCode",
B.ORG_CNAME AS "factoryName"
FROM iplat.TXSOG01 A LEFT JOIN (
SELECT
ORG_ENAME,
ORG_CNAME
FROM iplat.TXSOG01 WHERE COMPANY_CODE=#companyCode#
) B ON A.PARENT_ORG_ID=B.ORG_ENAME
WHERE A.ORG_TYPE = 'cutGroup' AND A.COMPANY_CODE=#companyCode#
<isNotEmpty prepend=" AND " property="factoryName">
B.ORG_CNAME LIKE CONCAT('%', #factoryName#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="groupName">
A.ORG_CNAME LIKE CONCAT('%', #groupName#, '%')
</isNotEmpty>
</select>
</sqlMap>
......@@ -46,6 +46,10 @@
<EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" autoFit="true" isFloat="true" checkMode="row">
<EF:EFColumn ename="id" cname="主键id" hidden="true"/>
<EF:EFComboColumn ename="projCode" cname="项目名称" enable="false" width="120" align="center"
blockName="proj_record_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#">
</EF:EFComboColumn>
<EF:EFColumn ename="reqNo" cname="领料单号" enable="false" width="140" align="center"/>
<EF:EFColumn ename="receiptDate" cname="单据日期" enable="false" width="90" align="center"
editType="date" dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']"/>
......
let projNameGlobalData = [];
$(function () {
IPLATUI.EFGrid = {
"result": {
columns: [],
columns: [{
field: "projCode",
title: "项目名称",
template: function (dataItem) {
for (let i = 0; i < projNameGlobalData.length; i++) {
if (projNameGlobalData[i]['textField'] === dataItem['projName']) {
//dataItem["prdtCode"] = projNameGlobalData[i]['valueField']
resultGrid.setCellValue(0, "projCode", projNameGlobalData[i]['valueField']);
return projNameGlobalData[i]['textField'];
}
}
return dataItem["projCode"];
},
editor: function (container, options) {
var grid = container.closest(".k-grid").data("kendoGrid");
var cellIndex = grid.cellIndex(container);
var input = $('<input />');
input.attr("name", options.field);
input.attr("id", options.field);
input.appendTo(container);
let eiInfo = new EiInfo();
eiInfo.set("isSplicingSymbol",false);
var dataSource;
EiCommunicator.send("HPSC001", "queryComboBox", eiInfo, {
onSuccess: function (ei) {
dataSource = ei.getBlock("proj_record_block_id").getMappedRows();
projNameGlobalData = dataSource;
},
onFail: function (ei) {
}
}, {async: false});
input.kendoAutoComplete({
valuePrimitive: true,
dataSource: dataSource,
dataTextField: "textField",
dataValueField: "valueField",
required: "true",
optionLabelTemplate: "#:textField#",
valueTemplate: "#:valueField#",
template: "#:textField#",
filter: "contains"
});
}
}],
dataBound: function () {
}
}
......
......@@ -31,7 +31,7 @@
<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="100" align="center">
<EF:EFCodeOption codeName="hpjx.hpkc.inventType"/>
<EF:EFCodeOption codeName="hpjx.hpkc.inventType" />
</EF:EFComboColumn>
<EF:EFComboColumn ename="whCode" cname="仓库名称" enable="false" width="120" align="center"
blockName="wh_record_block_id" textField="textField" valueField="valueField"
......@@ -45,6 +45,7 @@
blockName="invent_spec_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#">
</EF:EFComboColumn>
<EF:EFColumn ename="projCode" cname="项目名称" width="200" align="center" required="true" maxLength="50"/>
<EF:EFColumn ename="applyAmount" cname="申请数量" width="120" align="right" format="{0:N0}" required="true"/>
<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}"
......
......@@ -24,6 +24,9 @@ $(function () {
// 挑选库存
$("#SELECT_STOCK").on("click", selectStock);
// 挑选耗材
$("#SELECT_CONSUMABLES").on("click", selectConsumables);
// 导出打印
$("#PRINT").on("click", exportPrint);
});
......@@ -46,7 +49,7 @@ let query = function () {
/**
* 挑选库存
* 挑选耗材
*/
let selectStock = function () {
JSColorbox.open({
......@@ -59,6 +62,19 @@ let selectStock = function () {
}
/**
* 挑选库存
*/
let selectConsumables = function () {
JSColorbox.open({
href: "HPKC004B?methodName=initLoad",
title: "<div style='text-align: center;'>耗材查询</div>",
width: "90%",
height: "80%",
callbackName: selectStockCallback
});
}
/**
* 挑选库存回调
*/
let selectStockCallback = function () {
......
......@@ -40,14 +40,22 @@
<EF:EFColumn ename="receiptDate" cname="单据日期" enable="false" width="90" align="center"
editType="date" dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']"/>
<EF:EFColumn ename="projName" cname="项目名称" enable="false" width="140" align="center"/>
<EF:EFColumn ename="inventName" cname="部件名称" enable="false" width="120" align="center"/>
<EF:EFComboColumn ename="whCode" cname="仓库名称" enable="false" width="120" align="center"
blockName="wh_record_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#">
</EF:EFComboColumn>
<EF:EFColumn ename="inventName" cname="部件名称/存货名称" enable="false" width="150" align="center"/>
<EF:EFColumn ename="subInventName" cname="零件名称" enable="false" width="120" align="center"/>
<EF:EFColumn ename="length" cname="长" enable="false" width="100" align="right" format="{0:N3}"/>
<EF:EFColumn ename="width" cname="宽" enable="false" width="100" align="right" format="{0:N3}"/>
<EF:EFColumn ename="thick" cname="厚" enable="false" width="100" align="right" format="{0:N3}"/>
<EF:EFComboColumn ename="inventRecordId" cname="规格" enable="false" width="120" align="center" hidden="true"
blockName="invent_spec_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#">
</EF:EFComboColumn>
<EF:EFColumn ename="length" cname="长(MM)" enable="false" width="100" align="right" format="{0:N3}"/>
<EF:EFColumn ename="width" cname="宽(MM)" enable="false" width="100" align="right" format="{0:N3}"/>
<EF:EFColumn ename="thick" cname="厚(MM)" enable="false" width="100" align="right" format="{0:N3}"/>
<EF:EFColumn ename="amount" cname="数量" enable="false" width="100" align="right" format="{0:N0}"/>
<EF:EFColumn ename="unitWeight" cname="单重" enable="false" width="100" align="right" format="{0:N3}"/>
<EF:EFColumn ename="weight" cname="总重" enable="false" width="100" align="right" format="{0:N3}"/>
<EF:EFColumn ename="unitWeight" cname="单重(KG)" enable="false" width="100" align="right" format="{0:N3}"/>
<EF:EFColumn ename="weight" cname="总重(KG)" enable="false" width="100" align="right" format="{0:N3}"/>
<EF:EFComboColumn ename="isPrint" cname="是否打印" width="80" align="center">
<EF:EFCodeOption codeName="hpjx.hpjx.isPrint"/>
</EF:EFComboColumn>
......
let projNameGlobalData = [];
$(function () {
IPLATUI.EFGrid = {
"result": {
columns: [{
field: "projCode",
title: "项目名称",
template: function (dataItem) {
for (let i = 0; i < projNameGlobalData.length; i++) {
if (projNameGlobalData[i]['textField'] === dataItem['projName']) {
//dataItem["prdtCode"] = projNameGlobalData[i]['valueField']
resultGrid.setCellValue(0, "projCode", projNameGlobalData[i]['valueField']);
return projNameGlobalData[i]['textField'];
}
}
return dataItem["projCode"];
},
editor: function (container, options) {
var grid = container.closest(".k-grid").data("kendoGrid");
var cellIndex = grid.cellIndex(container);
var input = $('<input />');
input.attr("name", options.field);
input.attr("id", options.field);
input.appendTo(container);
let eiInfo = new EiInfo();
eiInfo.set("isSplicingSymbol",false);
var dataSource;
EiCommunicator.send("HPSC001", "queryComboBox", eiInfo, {
onSuccess: function (ei) {
dataSource = ei.getBlock("proj_record_block_id").getMappedRows();
projNameGlobalData = dataSource;
},
onFail: function (ei) {
}
}, {async: false});
input.kendoAutoComplete({
valuePrimitive: true,
dataSource: dataSource,
dataTextField: "textField",
dataValueField: "valueField",
required: "true",
optionLabelTemplate: "#:textField#",
valueTemplate: "#:valueField#",
template: "#:textField#",
filter: "contains"
});
}
}],
dataBound: function () {
}
}
};
$("#ef_form_head").hide();
// 查询
$("#QUERY").on("click", query);
// 选择
$("#BTN_SELECT").on("click", select);
});
/**
* 页面加载时执行
*/
$(window).load(function () {
// 初始化查询
query();
});
/**
* 查询
*/
var query = function (e) {
resultGrid.dataSource.page(1);
};
/**
* 选择库存
*/
let select = function () {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据")
return;
}
for (let i = 0; i < rows.length; i++) {
let applyAmount = rows[i]['applyAmount'];
let amount = rows[i]['amount'];
if (!isPositiveInteger(applyAmount)) {
message("勾选的第" + (i + 1) + "行数量必须是大于0的整数");
return;
}
if (parseFloat(applyAmount) > parseFloat(amount)) {
message("第" + (i + 1) + "行申请数量不能大于库存数量");
return;
}
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据生成出库单吗? ", {
ok: function () {
JSUtils.submitGridsData("result", "HPKC004B", "select",
true, function (e) {
var status = e.getStatus();
if (status !== -1) {
parent.JSColorbox.setValueCallback();
}
}
);
}
});
}
<!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="查询区域" type="query">
<div class="row">
<EF:EFSelect cname="存货类型" ename="inqu_status-0-inventType" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hpjx.hpkc.inventType" condition="ITEM_CODE IN ('1', '2')"/>
</EF:EFSelect>
<EF:EFSelect cname="仓库名称" ename="inqu_status-0-whCode" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="wh_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFSelect cname="存货名称" ename="inqu_status-0-inventCode" colWidth="3" filter="contains">
<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:EFOption label="全部" value=""/>
<EF:EFOptions blockId="spec_name_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="记录集">
<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="100" align="center">
<EF:EFCodeOption codeName="hpjx.hpkc.inventType" condition="ITEM_CODE IN ('2')"/>
</EF:EFComboColumn>
<EF:EFComboColumn ename="whCode" cname="仓库名称" enable="false" width="120" align="center"
blockName="wh_record_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#">
</EF:EFComboColumn>
<EF:EFComboColumn ename="inventCode" cname="存货名称" enable="false" width="120" align="center"
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"
blockName="invent_spec_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#">
</EF:EFComboColumn>
<EF:EFColumn ename="projCode" cname="项目名称" width="200" align="center" required="true" maxLength="50"/>
<EF:EFColumn ename="applyAmount" cname="申请数量" width="120" align="right" format="{0:N0}" required="true"/>
<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}"
sumType="all"/>
<EF:EFColumn ename="remark" cname="备注" enable="false" width="150"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
......@@ -6,32 +6,82 @@
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<EF:EFPage title="生产任务详情">
<EF:EFRegion id="inqu" title="订单详情">
<EF:EFInput ename="inqu_status-0-prodOrderNo" cname="项目号" type="hidden"/>
<div class="row">
<EF:EFInput ename="detail-0-productionOrderNo" cname="生产订单号" colWidth="4" readonly="true"/>
<EF:EFInput ename="detail-0-projCode" cname="项目号" colWidth="4" readonly="true"/>
<EF:EFInput ename="detail-0-projName" cname="项目名称" colWidth="4" readonly="true"/>
</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"/>
</div>
<div class="row">
<EF:EFInput ename="detail-0-prdtThick" 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"/>
</div>
<div class="row">
<EF:EFInput ename="detail-0-remark" cname="部件备注" colWidth="4" readonly="true"/>
<EF:EFSelect ename="detail-0-partType" cname="零件类型" colWidth="4" readonly="true">
<EF:EFCodeOption codeName="hpjx.hpkc.inventType"/>
</EF:EFSelect>
<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"/>
</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"/>
</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-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-completeNum" cname="完成数量" colWidth="4" readonly="true"/>
<EF:EFInput ename="detail-0-actualCompletionTotalWt" cname="完成重量" 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" />
<EF:EFDatePicker ename="detail-0-actualCompletionDate" cname="实际完成时间" role="date" format="yyyy-MM-dd" parseFormats="['yyyyMMdd']" colWidth="4" readonly="true" />
</div>
</EF:EFRegion>
<EF:EFRegion id="inqu" title="任务详情">
<div class="row">
<EF:EFInput cname="生产任务号" blockId="result" ename="prodTaskNo" row="0" colWidth="4" readonly="true"/>
<EF:EFInput cname="生产订单号" blockId="result" ename="prodOrderNo" row="0" colWidth="4" readonly="true"/>
<%-- <EF:EFInput cname="生产订单号" blockId="result" ename="prodOrderNo" row="0" colWidth="4" readonly="true"/>--%>
</div>
<div class="row">
<%--<div class="row">
<EF:EFInput cname="项目号" blockId="result" ename="projCode" row="0" colWidth="4" readonly="true"/>
<EF:EFInput cname="项目名称" blockId="result" ename="projName" row="0" colWidth="4" readonly="true"/>
<EF:EFInput cname="部件名称" blockId="result" ename="prdtName" row="0" colWidth="4" readonly="true"/>
</div>
</div>--%>
<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="重量" blockId="result" ename="totalWt" row="0" colWidth="4" readonly="true"/>
</div>
<div class="row">
<%--<div class="row">
<EF:EFInput cname="零件长" blockId="result" ename="partLength" row="0" colWidth="4" readonly="true"/>
<EF:EFInput cname="零件宽" blockId="result" ename="partWidth" row="0" colWidth="4" readonly="true"/>
<EF:EFInput cname="零件厚" blockId="result" ename="partThick" row="0" colWidth="4" readonly="true"/>
</div>
</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="完成数量" blockId="result" ename="completeNum" row="0" colWidth="4" readonly="true"/>
<EF:EFInput cname="剩余数量" blockId="result" ename="unCompleteNum" row="0" colWidth="4" readonly="true"/>
<EF:EFInput cname="数量" blockId="result" ename="num" row="0" colWidth="4" readonly="true"/>
</div>
<div class="row">
<EF:EFInput cname="剩余数量" blockId="result" ename="unCompleteNum" row="0" colWidth="4" readonly="true"/>
<EF:EFDatePicker cname="计划完成日期" blockId="result" ename="planCompletionDate" row="0" colWidth="4"
format="yyyy-MM-dd" readonly="true"/>
<EF:EFInput cname="厂区名称" blockId="result" ename="factoryName" row="0" colWidth="4" readonly="true"/>
......
......@@ -15,28 +15,53 @@ $(function () {
message("请至少选择一条需要分派的数据");
return;
}
JSColorbox.open({
href: "HPSC098?methodName=initLoad",
title: "<div style='text-align: center;'>选择组织</div>",
width: "40%",
height: "70%",
callbackName: assignCallback
});
//分派可修改,不做判断
let num = 0;
rows.forEach(function(element) {
if (element.status == 1) {
num++;
let flag = true;
$.each(rows, function(index, item) {
let status = item.get("status");
if (status === "1") {
IPLAT.alert({
message: "选中的第" + (index + 1) + "行\"生产中的项目\",不能批量派工!",
okFn: function (e) {
},
title: '错误'
});
flag = false;
return false;
}
if (status === "2") {
IPLAT.alert({
message: "选中的第" + (index + 1) + "行\"已完成的项目\",不能批量派工!",
okFn: function (e) {
},
title: '错误'
});
flag = false;
return false;
}
ids.push(element.id)
});
// if (num > 0) {
// message("勾选的数据中有已经分派的数据!");
// return;
// } else {
//
// }
if(flag) {
JSColorbox.open({
href: "HPSC098?methodName=initLoad&inqu_status-0-orgType=cutGroup",
title: "<div style='text-align: center;'>选择组织</div>",
width: "40%",
height: "70%",
callbackName: assignCallback
});
//分派可修改,不做判断
let num = 0;
rows.forEach(function (element) {
if (element.status == 1) {
num++;
}
ids.push(element.id)
});
// if (num > 0) {
// message("勾选的数据中有已经分派的数据!");
// return;
// } else {
//
// }
}
});
IPLATUI.EFGrid = {
"result" : {
......@@ -166,9 +191,9 @@ $(function () {
editor: function (container, options) {
let inInfo = new EiInfo();
inInfo.set("inqu_status-0-factoryCode", options.model["factoryCode"]);
// 1:生产
inInfo.set("inqu_status-0-groupType", 1);
inInfo.set("serviceName", "HPPZ011");
// cutGroup:下料
inInfo.set("inqu_status-0-orgType", 'cutGroup');
inInfo.set("serviceName", "HPXSOrg");
inInfo.set("methodName", "queryGroupComboBox");
inInfo.set("blockId", "group_record_block_id");
inInfo.set("field", options.field);
......@@ -271,8 +296,8 @@ query = function () {
$(window).load(function () {
// 生产组名称
let inInfo = new EiInfo();
inInfo.set("inqu_status-0-groupType", 1);
EiCommunicator.send("HPPZ011", "queryGroupComboBox", inInfo, {
inInfo.set("inqu_status-0-orgType", 'cutGroup');
EiCommunicator.send("HPXSOrg", "queryGroupComboBox", inInfo, {
onSuccess: function (ei) {
factoryGroupGlobalData = ei.getBlock("group_record_block_id").getMappedRows();
},
......@@ -302,10 +327,13 @@ function checkIn(id) {
checkInCallback = function () {
}
assignCallback = function (id) {
assignCallback = function (row) {
var info = new EiInfo()
info.set("ids",ids.join(','));
info.set("id",id);
info.set("factoryCode",row.factoryCode);
info.set("factoryName",row.factoryName);
info.set("groupCode",row.groupCode);
info.set("groupName",row.groupName);
EiCommunicator.send("HPSC006","assign",info,{
onSuccess:function(ei){//返回结果集
if (ei["status"] == -1) {
......@@ -331,6 +359,7 @@ assignCallback = function (id) {
*/
function saveFunc() {
let rows = detailGrid.getCheckedRows();
rows.status
if (rows.length < 1) {
message("请选择数据");
return;
......
......@@ -23,12 +23,12 @@ $(function () {
let row = rows[0];
let isInput= decodeURI(window.location.href.split("&")[1]);
if(isInput==="isInput"){
parent.JSColorbox.setValueCallback(row.id);
parent.JSColorbox.setValueCallback(row);
return;
};
JSUtils.confirm("确定分派? ", {
ok: function () {
parent.JSColorbox.setValueCallback(row.id);
parent.JSColorbox.setValueCallback(row);
}
});
});
......
......@@ -7,20 +7,19 @@
<EF:EFPage title="组织机构">
<EF:EFRegion id="inqu" title="查询条件">
<EF:EFInput cname="组类型" ename="groupType" blockId="inqu_status" row="0" type="hidden"/>
<EF:EFInput cname="组类型" ename="orgType" blockId="inqu_status" row="0" type="hidden"/>
<div class="row">
<EF:EFInput cname="厂区名称" ename="factoryName" blockId="inqu_status" row="0" colWidth="3"/>
<EF:EFInput cname="生产组名称" ename="groupName" blockId="inqu_status" row="0" colWidth="3"/>
<EF:EFInput cname="下料组名称" ename="groupName" blockId="inqu_status" row="0" colWidth="3"/>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="single,row">
<EF:EFColumn ename="id" cname="内码" hidden="true"/>
<EF:EFColumn ename="factoryCode" cname="厂区编码" enable="false" width="120" align="center"/>
<EF:EFColumn ename="factoryName" cname="厂区名称" enable="false" width="120" align="center"/>
<EF:EFColumn ename="groupCode" cname="生产组编码" enable="false" width="120" align="center"/>
<EF:EFColumn ename="groupName" cname="生产组名称" enable="false" width="120" align="center"/>
<EF:EFColumn ename="groupCode" cname="下料组生编码" enable="false" width="120" align="center"/>
<EF:EFColumn ename="groupName" cname="下料组名称" enable="false" width="120" align="center"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
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