Commit 09582736 by wancheng

采购计划提交

parent 925e8d5a
......@@ -56,6 +56,7 @@ public class HPCG002 extends DaoEPBase {
public static final String INSERT = "HPCG002.insert";
public static final String UPDATE = "HPCG002.update";
public static final String DELETE = "HPCG002.delete";
public static final String CHECK = "HPCG002.check";
private Long id = new Long(0); /* ID*/
private String companyCode = " "; /* 公司编码*/
......@@ -66,11 +67,11 @@ public class HPCG002 extends DaoEPBase {
private String updatedBy = " "; /* 修改人*/
private String updatedName = " "; /* 修改人名称*/
private String updatedTime = " "; /* 修改时间*/
private Integer deleteFlag = 0; /* 是否删除 0-否1-是*/
private Integer deleteFlag; /* 是否删除 0-否1-是*/
private String proPlanDate = " "; /* 采购计划日期*/
private String proPlanNo = " "; /* 采购计划单号*/
private String inventType = " "; /* 存货类型*/
private Integer proPlanStatus = 0; /* 提交状态 0-未提交 1-部分提交 2-全部提交*/
private Integer proPlanStatus; /* 提交状态 0-未提交 1-部分提交 2-全部提交*/
/**
* initialize the metadata.
......
......@@ -4,6 +4,7 @@ import com.baosight.hpjx.aspect.annotation.OperationLogAnnotation;
import com.baosight.hpjx.common.DdynamicEnum;
import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.core.security.UserSessionUtils;
import com.baosight.hpjx.hp.cg.domain.HPCG002;
import com.baosight.hpjx.hp.constant.HPConstant;
import com.baosight.hpjx.hp.xs.domain.HPXS006;
import com.baosight.hpjx.util.CommonMethod;
......@@ -28,17 +29,10 @@ public class ServiceHPCG002 extends ServiceBase {
/**
* 画面初始化.
*/
@OperationLogAnnotation(operModul = "售后维修",operType = "查询",operDesc = "初始化")
@OperationLogAnnotation(operModul = "采购计划",operType = "查询",operDesc = "初始化")
public EiInfo initLoad(EiInfo inInfo) {
try {
/*inInfo.setCell(EiConstant.queryBlock,ACConstants.ROW_CODE_0, "userId",UserSessionUtils.getFactoryCode().get(0));*/
inInfo = super.query(inInfo, HPXS006.QUERY, new HPXS006());
Map map = new HashMap();
map.put("companyCode", UserSessionUtils.getCompanyCode());
map.put("factoryCodes", getFactoryCode(inInfo));
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.REP_USER_ID_BLOCK_ID), map,true);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.CUSTOMER_RECORD_BLOCK_ID), null);
inInfo = super.query(inInfo, HPCG002.QUERY, new HPCG002());
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
......@@ -50,150 +44,15 @@ public class ServiceHPCG002 extends ServiceBase {
* 查询操作.
*/
@Override
@OperationLogAnnotation(operModul = "售后维修",operType = "查询")
@OperationLogAnnotation(operModul = "采购计划",operType = "查询")
public EiInfo query(EiInfo inInfo) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HPXS006.FIELD_REP_DATE,
DateUtils.formatShort(inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HPXS006.FIELD_REP_DATE)));
EiInfo outInfo = super.query(inInfo, HPXS006.QUERY, new HPXS006());
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, "createdDateFrom",
DateUtils.formatShort(inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, "createdDateFrom")));
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, "createdDateTo",
DateUtils.formatShort(inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, "createdDateTo")));
EiInfo outInfo = super.query(inInfo, HPCG002.QUERY, new HPCG002());
return outInfo;
}
/**
* 保存操作.
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "售后维修",operType = "保存",operDesc = "保存")
public EiInfo save(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 写入数据
for (int i = 0; i < resultRows.size(); i++) {
HPXS006 hpsc006 = new HPXS006();
hpsc006.fromMap(resultRows.get(i));
hpsc006.setRepDate(DateUtils.formatShort(hpsc006.getRepDate()));
/* HPPZ003 fPz003 = new HPPZ003();
if (hpsc001.getPrinc2().trim().isEmpty()) {
fPz003.setCustCode(SequenceGenerator.getNextSequence(HPConstant.SequenceId.HPPZ003_CUST_CODE));
fPz003.setCustType(CompanyTypeEnum.GQ.getCode());
fPz003.setCustName(resultRows.get(i).get("princ2Name").toString());
fPz003.setCompanyName(resultRows.get(i).get("princ2Name").toString());
DaoUtils.insert("HPPZ003.insert", fPz003);
hpsc001.setPrinc2(fPz003.getCustCode());
}*/
if (hpsc006.getId() == null || hpsc006.getId() == 0) {
this.add(hpsc006);
} else {
this.modify(hpsc006);
}
}
//inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 新增
*
* @param hpxs006
* @throws Exception
*/
private void add(HPXS006 hpxs006) throws Exception {
hpxs006.setRepOrderNo(SequenceGenerator.getNextSequence(HPConstant.SequenceId.HPXS006_PROD_NO));
DaoUtils.insert(HPXS006.INSERT, hpxs006);
}
/**
* 修改数据
*
* @param hpxs006
*/
private void modify(HPXS006 hpxs006) {
DaoUtils.update(HPXS006.UPDATE, hpxs006);
}
/**
* 删除操作.
*/
@OperationLogAnnotation(operModul = "售后维修",operType = "删除")
public EiInfo delete(EiInfo eiInfo) {
HPXS006 hpxs006 = new HPXS006();
EiBlock eiBlock = eiInfo.getBlock(EiConstant.resultBlock);
try {
for (int i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
hpxs006.fromMap(map);
this.dao.delete(HPXS006.DELETE, hpxs006.toMap());
}
} catch (PlatException e) {
eiInfo.setStatus(EiConstant.STATUS_FAILURE);
eiInfo.setMsg("删除失败,原因参见详细错误描述!");
eiInfo.setDetailMsg(e.getMessage());
logError("删除失败!", e.getMessage());
return eiInfo;
}
eiInfo.setStatus(EiConstant.STATUS_SUCCESS);
eiInfo.setMsg("删除成功!");
return query(eiInfo);
}
/**
*审核
*/
@OperationLogAnnotation(operModul = "售后维修",operType = "审核")
public EiInfo check(EiInfo eiInfo) {
HPXS006 hpxs006 = new HPXS006();
EiBlock eiBlock = eiInfo.getBlock(EiConstant.resultBlock);
try {
for (int i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
hpxs006.fromMap(map);
DaoUtils.update(HPXS006.CHECK, hpxs006.toMap());
}
} catch (PlatException e) {
eiInfo.setStatus(EiConstant.STATUS_FAILURE);
eiInfo.setMsg("审核失败,原因参见详细错误描述!");
eiInfo.setDetailMsg(e.getMessage());
logError("审核失败!", e.getMessage());
return eiInfo;
}
eiInfo.setStatus(EiConstant.STATUS_SUCCESS);
eiInfo.setMsg("审核成功!");
return eiInfo;
}
/**
* @param inInfo
* @return
*/
public List<String> getFactoryCode(EiInfo inInfo) {
List<String> factorycodes = new ArrayList();
try {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, "userId", UserSessionUtils.getUserId());
inInfo = super.query(inInfo, HPXS006.QUERYFACTORY);
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
List rows = new ArrayList();
for (int i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
String factory = (String) map.get("factoryCode");
factorycodes.add(factory);
}
} catch (Exception e) {
LogUtils.setMsg(inInfo, e, "查询组失败");
}
return factorycodes;
}
}
package com.baosight.hpjx.hp.cg.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.dao.DaoUtils;
import com.baosight.hpjx.core.security.UserSessionUtils;
import com.baosight.hpjx.hp.cg.domain.HPCG002;
import com.baosight.hpjx.hp.cg.domain.HPCG002A;
import com.baosight.hpjx.hp.constant.HPConstant;
import com.baosight.hpjx.hp.kc.domain.HPKC001;
import com.baosight.hpjx.hp.xs.domain.HPXS006;
import com.baosight.hpjx.util.CommonMethod;
import com.baosight.hpjx.util.DateUtils;
import com.baosight.hpjx.util.LogUtils;
import com.baosight.hpjx.util.contants.ACConstants;
import com.baosight.iplat4j.core.ei.EiBlock;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.service.impl.ServiceBase;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import java.util.*;
/**
*
*/
public class ServiceHPCG002A extends ServiceBase {
// 指定存货类型
private static final Integer[] DEFAULT_INVENT_CODE = {InventTypeEnum.RAW.getCode(),
InventTypeEnum.CONSUMABLE.getCode()};
/**
* 画面初始化.
*/
@OperationLogAnnotation(operModul = "采购计划详情",operType = "查询",operDesc = "初始化")
public EiInfo initLoad(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HPCG002A.QUERY, new HPCG002A());
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.SPEC_NAME_BLOCK_ID), queryMap);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_ALL_BLOCK_ID), queryMap, false);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.FACTORY_RECORD_BLOCK_ID), null, false);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.SUPPLIER_RECORD_BLOCK_ID), null, false);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HPCG002A().eiMetadata);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询操作.
*/
@Override
@OperationLogAnnotation(operModul = "采购计划详情",operType = "查询")
public EiInfo query(EiInfo inInfo) {
EiInfo outInfo = super.query(inInfo, HPCG002A.QUERY, new HPCG002A());
return outInfo;
}
/**
* 保存操作.
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "采购计划详情",operType = "保存",operDesc = "保存")
public EiInfo save(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 写入数据
for (int i = 0; i < resultRows.size(); i++) {
HPCG002A hpcg002A = new HPCG002A();
hpcg002A.fromMap(resultRows.get(i));
if (hpcg002A.getId() == null || hpcg002A.getId() == 0) {
this.add(hpcg002A);
} else {
this.modify(hpcg002A);
}
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 新增
*
* @param hpcg002A
* @throws Exception
*/
private void add(HPCG002A hpcg002A) throws Exception {
DaoUtils.insert(HPCG002A.INSERT, hpcg002A);
}
/**
* 修改数据
*
* @param hpcg002A
*/
private void modify(HPCG002A hpcg002A) {
DaoUtils.update(HPCG002A.UPDATE, hpcg002A);
}
/**
* 删除操作.
*/
@OperationLogAnnotation(operModul = "采购计划详情",operType = "删除")
public EiInfo delete(EiInfo eiInfo) {
HPCG002A hpcg002A = new HPCG002A();
EiBlock eiBlock = eiInfo.getBlock(EiConstant.resultBlock);
try {
for (int i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
hpcg002A.fromMap(map);
this.dao.delete(HPXS006.DELETE, hpcg002A.toMap());
}
} catch (PlatException e) {
eiInfo.setStatus(EiConstant.STATUS_FAILURE);
eiInfo.setMsg("删除失败,原因参见详细错误描述!");
eiInfo.setDetailMsg(e.getMessage());
logError("删除失败!", e.getMessage());
return eiInfo;
}
eiInfo.setStatus(EiConstant.STATUS_SUCCESS);
eiInfo.setMsg("删除成功!");
return query(eiInfo);
}
/**
*审核
*/
@OperationLogAnnotation(operModul = "采购计划详情",operType = "提交")
public EiInfo check(EiInfo eiInfo) {
HPCG002A hpcg002A = new HPCG002A();
EiBlock eiBlock = eiInfo.getBlock(EiConstant.resultBlock);
EiInfo inInfo = new EiInfo();
HPCG002 hpcg002 = new HPCG002();
try {
for (int i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
hpcg002A.fromMap(map);
hpcg002.setId(hpcg002A.getParentId());
hpcg002.setProPlanStatus(hpcg002A.getProPlanStatus());
inInfo.setCell(EiConstant.queryBlock,ACConstants.ROW_CODE_0, HPCG002A.FIELD_PARENT_ID,hpcg002A.getParentId());
DaoUtils.update(HPCG002A.CHECK, hpcg002A.toMap());
}
EiInfo outInfo = super.query(inInfo, HPCG002A.QUERY, new HPCG002A());
EiBlock outBlock = outInfo.getBlock(EiConstant.resultBlock);
Integer num = 0;
for (int i = 0; i < outBlock.getRowCount(); i++) {
Map<?, ?> map = outBlock.getRow(i);
hpcg002A.fromMap(map);
if(hpcg002A.getProApplyStatus()==1){
num = num+1;
}
DaoUtils.update(HPCG002A.CHECK, hpcg002A.toMap());
}
if(num==outBlock.getRowCount()&&hpcg002.getProPlanStatus()!=2){
hpcg002.setProPlanStatus(2);
DaoUtils.update(HPCG002.CHECK, hpcg002.toMap());
}else if(num!=outBlock.getRowCount()&&hpcg002.getProPlanStatus()!=1){
hpcg002.setProPlanStatus(1);
DaoUtils.update(HPCG002.CHECK, hpcg002.toMap());
}
eiInfo.setStatus(EiConstant.STATUS_SUCCESS);
eiInfo.setMsg("提交成功!");
} catch (PlatException e) {
eiInfo.setStatus(EiConstant.STATUS_FAILURE);
eiInfo.setMsg("提交失败,原因参见详细错误描述!");
eiInfo.setDetailMsg(e.getMessage());
logError("提交失败!", e.getMessage());
return eiInfo;
}
return eiInfo;
}
/**
* @param inInfo
* @return
*/
public List<String> getFactoryCode(EiInfo inInfo) {
List<String> factorycodes = new ArrayList();
try {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, "userId", UserSessionUtils.getUserId());
inInfo = super.query(inInfo, HPXS006.QUERYFACTORY);
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
List rows = new ArrayList();
for (int i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
String factory = (String) map.get("factoryCode");
factorycodes.add(factory);
}
} catch (Exception e) {
LogUtils.setMsg(inInfo, e, "查询组失败");
}
return factorycodes;
}
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN" "http://ibatis.apache.org/dtd/sql-map-2.dtd"> <!-- table information
Generate time : 2024-04-26 17:16:55
Generate time : 2024-04-26 16:24:58
Version : 1.0
schema : hpjx
tableName : T_HPCG002
......@@ -21,34 +21,22 @@
-->
<sqlMap namespace="HPCG002">
<sql id="condition">
<isNotEmpty prepend=" AND " property="id">
ID = #id#
<sql id="authCondition">
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCodes">
DEP_CODE IN <iterate close=")" open="(" conjunction="," property="depCodes">#depCodes[]#</iterate>
</isNotEmpty>
</sql>
<sql id="condition">
<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>
......@@ -64,12 +52,6 @@
<isNotEmpty prepend=" AND " property="proPlanStatus">
PRO_PLAN_STATUS = #proPlanStatus#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdDateFrom">
PRO_PLAN_DATE &gt;= CONCAT(REPLACE(#createdDateFrom#, '-', ''), '000000')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdDateTo">
PRO_PLAN_DATE &lt;= CONCAT(REPLACE(#createdDateTo#, '-', ''), '235959')
</isNotEmpty>
</sql>
<select id="query" parameterClass="java.util.HashMap"
......@@ -91,6 +73,7 @@
PRO_PLAN_STATUS as "proPlanStatus" <!-- 提交状态 0-未提交 1-部分提交 2-全部提交 -->
FROM ${hpjxSchema}.T_HPCG002 WHERE 1=1
<include refid="condition" />
<include refid="authCondition" />
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
......@@ -105,6 +88,7 @@
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hpjxSchema}.T_HPCG002 WHERE 1=1
<include refid="condition" />
<include refid="authCondition" />
</select>
<!--
......@@ -196,4 +180,12 @@
ID = #id#
</update>
<update id="check">
UPDATE ${hpjxSchema}.T_HPCG002
SET
PRO_PLAN_STATUS = #proPlanStatus# <!-- 提交状态 0-未提交 1-部分提交 2-全部提交 -->
WHERE
ID = #id#
</update>
</sqlMap>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN" "http://ibatis.apache.org/dtd/sql-map-2.dtd"> <!-- table information
Generate time : 2024-04-26 17:16:55
Generate time : 2024-04-26 16:57:22
Version : 1.0
schema : hpjx
tableName : T_HPCG002A
......@@ -38,136 +38,117 @@
<sql id="authCondition">
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
A.DEP_CODE = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCodes">
DEP_CODE IN <iterate close=")" open="(" conjunction="," property="depCodes">#depCodes[]#</iterate>
A.DEP_CODE IN <iterate close=")" open="(" conjunction="," property="depCodes">#depCodes[]#</iterate>
</isNotEmpty>
</sql>
<sql id="condition">
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
A.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#
A.DEP_CODE = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deleteFlag">
DELETE_FLAG = #deleteFlag#
A.DELETE_FLAG = #deleteFlag#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="custCode">
CUST_CODE = #custCode#
A.CUST_CODE = #custCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="proApplyDate">
PRO_APPLY_DATE = #proApplyDate#
A.PRO_APPLY_DATE = #proApplyDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="proApplyNo">
PRO_APPLY_NO = #proApplyNo#
A.PRO_APPLY_NO = #proApplyNo#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="whCode">
WH_CODE = #whCode#
A.WH_CODE = #whCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="whName">
WH_NAME = #whName#
A.WH_NAME = #whName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventType">
INVENT_TYPE = #inventType#
A.INVENT_TYPE = #inventType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventCode">
INVENT_CODE = #inventCode#
A.INVENT_CODE = #inventCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventName">
INVENT_NAME = #inventName#
A.INVENT_NAME = #inventName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventRecordId">
INVENT_RECORD_ID = #inventRecordId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="applyAmount">
APPLY_AMOUNT = #applyAmount#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="applyUnitWeight">
APPLY_UNIT_WEIGHT = #applyUnitWeight#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="applyWeight">
APPLY_WEIGHT = #applyWeight#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="planAmount">
PLAN_AMOUNT = #planAmount#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="planWeight">
PLAN_WEIGHT = #planWeight#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="remark">
REMARK = #remark#
A.INVENT_RECORD_ID = #inventRecordId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="proApplyStatus">
PRO_APPLY_STATUS = #proApplyStatus#
A.PRO_APPLY_STATUS = #proApplyStatus#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryCode">
FACTORY_CODE = #factoryCode#
A.FACTORY_CODE = #factoryCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryName">
FACTORY_NAME = #factoryName#
A.FACTORY_NAME = #factoryName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="parentId">
PARENT_ID = #parentId#
A.PARENT_ID = #parentId#
</isNotEmpty>
</sql>
<select id="query" parameterClass="java.util.HashMap"
resultClass="com.baosight.hpjx.hp.cg.domain.HPCG002A">
SELECT
ID as "id", <!-- 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-是 -->
CUST_CODE as "custCode", <!-- 供应商编码 -->
PRO_APPLY_DATE as "proApplyDate", <!-- 采购申请日期 -->
PRO_APPLY_NO as "proApplyNo", <!-- 采购申请单号 -->
WH_CODE as "whCode", <!-- 仓库编码 -->
WH_NAME as "whName", <!-- 仓库名称 -->
INVENT_TYPE as "inventType", <!-- 存货类型 -->
INVENT_CODE as "inventCode", <!-- 存货编码 -->
INVENT_NAME as "inventName", <!-- 存货名称 -->
INVENT_RECORD_ID as "inventRecordId", <!-- 存货档案ID -->
APPLY_AMOUNT as "applyAmount", <!-- 申请数量 -->
APPLY_UNIT_WEIGHT as "applyUnitWeight", <!-- 申请单重 -->
APPLY_WEIGHT as "applyWeight", <!-- 重量 -->
PLAN_AMOUNT as "planAmount", <!-- 计划数量 -->
PLAN_WEIGHT as "planWeight", <!-- 计划重量 -->
REMARK as "remark", <!-- 备注 -->
PRO_APPLY_STATUS as "proApplyStatus", <!-- 提交状态 0-未提交 1-已提交 -->
FACTORY_CODE as "factoryCode", <!-- 厂区编码 -->
FACTORY_NAME as "factoryName", <!-- 厂区名称 -->
PARENT_ID as "parentId" <!-- 父级ID -->
FROM ${hpjxSchema}.T_HPCG002A WHERE 1=1
A.ID as "id", <!-- ID -->
A.COMPANY_CODE as "companyCode", <!-- 公司编码 -->
A.DEP_CODE as "depCode", <!-- 部门编码 -->
A.CREATED_BY as "createdBy", <!-- 创建人 -->
A.CREATED_NAME as "createdName", <!-- 创建人名称 -->
A.CREATED_TIME as "createdTime", <!-- 创建时间 -->
A.UPDATED_BY as "updatedBy", <!-- 修改人 -->
A.UPDATED_NAME as "updatedName", <!-- 修改人名称 -->
A.UPDATED_TIME as "updatedTime", <!-- 修改时间 -->
A.DELETE_FLAG as "deleteFlag", <!-- 是否删除 0-否1-是 -->
A.CUST_CODE as "custCode", <!-- 供应商编码 -->
A.PRO_APPLY_DATE as "proApplyDate", <!-- 采购申请日期 -->
A.PRO_APPLY_NO as "proApplyNo", <!-- 采购申请单号 -->
A.WH_CODE as "whCode", <!-- 仓库编码 -->
A.WH_NAME as "whName", <!-- 仓库名称 -->
A.INVENT_TYPE as "inventType", <!-- 存货类型 -->
A.INVENT_CODE as "inventCode", <!-- 存货编码 -->
A.INVENT_NAME as "inventName", <!-- 存货名称 -->
A.INVENT_RECORD_ID as "inventRecordId", <!-- 存货档案ID -->
D.SPEC as "spec", <!-- 规格 -->
D.LENGTH as "length", <!-- 长 -->
D.WIDTH as "width", <!-- 宽 -->
D.THICK as "thick", <!-- 厚 -->
D.MATERIAL as "material", <!-- 材质 -->
D.COEFFICIENT as "coefficient", <!-- 系数 -->
D.UNIT as "unit", <!-- 单位 -->
A.APPLY_AMOUNT as "applyAmount", <!-- 申请数量 -->
A.APPLY_UNIT_WEIGHT as "applyUnitWeight", <!-- 申请单重 -->
A.APPLY_WEIGHT as "applyWeight", <!-- 重量 -->
A.REMARK as "remark", <!-- 备注 -->
A.PRO_APPLY_STATUS as "proApplyStatus", <!-- 提交状态 0-未提交 1-已提交 -->
A.FACTORY_CODE as "factoryCode", <!-- 厂区编码 -->
A.FACTORY_NAME as "factoryName", <!-- 厂区名称 -->
A.PARENT_ID as "parentId", <!-- 父级ID -->
ifnull(B.AMOUNT,0) as "invAmount", <!-- 库存数量 -->
ifnull(B.WEIGHT,0) as "invWeight", <!-- 库存重量 -->
case when A.APPLY_AMOUNT > ifnull(B.AMOUNT,0)
then A.APPLY_AMOUNT - ifnull(B.AMOUNT,0)
else A.APPLY_AMOUNT end as "planAmount", <!-- 计划数量 -->
case when A.PLAN_WEIGHT != 0 then A.PLAN_WEIGHT
when A.PLAN_WEIGHT != 0 and A.APPLY_AMOUNT > ifnull(B.AMOUNT,0)
then (A.APPLY_AMOUNT - ifnull(B.AMOUNT,0))*A.APPLY_UNIT_WEIGHT
else A.APPLY_WEIGHT end as "planWeight", <!-- 计划重量 -->
C.PRO_PLAN_STATUS as "proPlanStatus" <!-- 采购计划提交状态 0-未提交 1-部分提交 2-全部提交 -->
FROM ${hpjxSchema}.T_HPCG002A A
LEFT JOIN ${hpjxSchema}.T_HPKC010 B ON A.WH_CODE = B.WH_CODE AND A.INVENT_CODE = B.INVENT_CODE AND A.INVENT_RECORD_ID = B.INVENT_RECORD_ID
LEFT JOIN ${hpjxSchema}.T_HPCG002 C ON C.ID = A.PARENT_ID
LEFT JOIN ${hpjxSchema}.T_HPPZ006 D ON D.ID = A.INVENT_RECORD_ID
WHERE 1=1
<include refid="condition" />
<include refid="authCondition" />
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
......@@ -182,6 +163,7 @@
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hpjxSchema}.T_HPCG002A WHERE 1=1
<include refid="condition" />
<include refid="authCondition" />
</select>
<!--
......@@ -348,4 +330,12 @@
ID = #id#
</update>
<update id="check">
UPDATE ${hpjxSchema}.T_HPCG002A
SET
PRO_APPLY_STATUS = #proApplyStatus# <!-- 提交状态 0-未提交 1-已提交 -->
WHERE
ID = #id#
</update>
</sqlMap>
......@@ -2,10 +2,33 @@ $(function () {
$("#QUERY").on("click", query);
IPLATUI.EFGrid.result = {
pageable: {
pageSize: 20,
pageSizes: [10, 20, 50, 70, 100],
},
columns: [
{
field: "operator",
template: function (item) {
let template = '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' +
'onclick="jump(' + item.id + ')" >计划详情</a>';
return template;
}
}
],
}
});
let query = function () { resultGrid.dataSource.page(1);}
function jump(id) {
var herf = ctx + "\\web\\" + "HPCG002A?inqu_status-0-parentId=" + id + "&efParentFormEname=HPCG002";
window.open(herf);
}
......@@ -11,7 +11,9 @@
<%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<script>
var ctx = "${ctx}";
</script>
<EF:EFPage title="采购计划">
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
......@@ -23,12 +25,11 @@
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hpjx.hpkc.inventType" condition="ITEM_CODE IN ('1', '2')"/>
</EF:EFSelect>
</div>
<EF:EFSelect blockId="inqu_status" row="0" ename="proPlanStatus" cname="提交状态" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hpjx.hpxs.repStatus"/>
<EF:EFCodeOption codeName="hpjx.hpcg.proPlanStatus"/>
</EF:EFSelect>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="明细信息">
......@@ -43,8 +44,8 @@
readonly="true">
<EF:EFCodeOption codeName="hpjx.hpkc.inventType" condition="ITEM_CODE IN ('1', '2')"/>
</EF:EFComboColumn>
<EF:EFComboColumn ename="repStatus" cname="维修状态" width="80" align="center" readonly="true" required="true" defaultValue="0">
<EF:EFCodeOption codeName="hpjx.hpxs.repStatus"/>
<EF:EFComboColumn ename="proPlanStatus" cname="提交状态" width="80" align="center" readonly="true" required="true" defaultValue="0">
<EF:EFCodeOption codeName="hpjx.hpcg.proPlanStatus"/>
</EF:EFComboColumn>
<%-- <EF:EFColumn cname="创建人" ename="createdName" align="center" width="150" readonly="true" required="false" enable="false"/>
<EF:EFColumn cname="创建时间" ename="createdTime" parseFormats="['yyyyMMddHHmmss']" editType="datetime"
......
let whNameGlobalData = [];
let inventNameGlobalData = [];
let inventAllGlobalData = [];
$(function () {
$("#QUERY").on("click", query);
......@@ -11,18 +14,19 @@ $(function () {
columns: [{
field: "operator",
template: function (item) {
let auditStatus = item.repStatus;
let auditStatus = item.proApplyStatus;
let template = '';
if (auditStatus) {
if (auditStatus == 0) {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;" ' +
'onclick="check(' + item.id + ',1)" >审核</a>';
'onclick="check(' + item.id + ',1, \''+ item.custCode + '\',\''+ item.parentId + '\',\''+ item.proPlanStatus + '\')" >提交</a>';
}
}
return template;
}
}],
loadComplete: function(grid) {
loadComplete: function (grid) {
},
onSave: function (e) {
......@@ -45,19 +49,43 @@ $(function () {
}
}
downKeyUp();
// 规格
initSpec();
});
let query = function () { resultGrid.dataSource.page(1);}
/**
* 初始化规格
*/
let initSpec = function () {
let inInfo = new EiInfo();
// 1.原料,2.耗材
inInfo.set("inqu_status-0-inventTypes", [1, 2]);
inInfo.set("inqu_status-0-isSplicingSymbol", false);
EiCommunicator.send("HPPZ006", "queryComboBoxAll", inInfo, {
onSuccess: function (ei) {
inventAllGlobalData = ei.getBlock("invent_all_block_id").getMappedRows();
},
onFail: function (ei) {
}
}, {async: false});
}
function check(id, auditStatus) {
function check(id, auditStatus,custCode,parentid,proPlanStatus) {
if (isBlank(custCode)) {
message("行供应商不能为空");
return;
}
const inEiInfo = new EiInfo();
inEiInfo.set("result-0-id", id);
inEiInfo.set("result-0-repStatus", auditStatus);
EiCommunicator.send('HPXS006', 'check', inEiInfo, {
inEiInfo.set("result-0-parentId", parentid);
inEiInfo.set("result-0-proApplyStatus", auditStatus);
inEiInfo.set("result-0-proPlanStatus", proPlanStatus);
EiCommunicator.send('HPCG002A', 'check', inEiInfo, {
onSuccess(response) {
//NotificationUtil(response.msg);
message("审核成功");
message("提交成功");
resultGrid.dataSource.page(1);
},
onFail(errorMessage, status, e) {
......@@ -94,30 +122,26 @@ function save() {
return;
}
for (let i = 0; i < rows.length; i++) {
if (rows[i]['repStatus']==1) {
message("勾选的第" + (i + 1) + "行已维修不允许修改!");
if (rows[i]['proApplyStatus']==1) {
message("勾选的第" + (i + 1) + "行已提交不允许修改!");
return;
}
if (isBlank(rows[i]['repDate'])) {
message("勾选的第" + (i + 1) + "行维修日期不能为空");
if (isBlank(rows[i]['custCode'])) {
message("勾选的第" + (i + 1) + "行供应商不能为空");
return;
}
if (isBlank(rows[i]['repCustomId'])) {
message("勾选的第" + (i + 1) + "行客户名称不能为空");
if (!isPositiveInteger(rows[i]['planAmount'])) {
message("勾选的第" + (index + 1) + "行\"计划数量\"必须是大于0的整数");
return;
}
if (isBlank(rows[i]['repUserId'])) {
message("勾选的第" + (i + 1) + "行维修人员不能为空");
return;
}
if (isBlank(rows[i]['repStatus'])) {
message("勾选的第" + (i + 1) + "行维修状态不能为空");
return;
if(!isPositiveNumber(rows[i]['planWeight'])){
message("选中的第"+(index+1)+"行\"计划重量\"必须是大于0的数");
return ;
}
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作?", {
ok: function () {
JSUtils.submitGridsData("result", "HPXS006", "save", true);
JSUtils.submitGridsData("result", "HPCG002A", "save", true);
}
})
}
......
......@@ -16,6 +16,10 @@
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<EF:EFInput cname="采购申请单号" ename="inqu_status-0-proApplyNo" colWidth="3"/>
<EF:EFSelect cname="供应商名称" ename="inqu_status-0-repCustomId" colWidth="3" filter="contains" defultValue="">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="supplier_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
</div>
</EF:EFRegion>
......@@ -26,15 +30,15 @@
<EF:EFColumn ename="companyCode" cname="公司编码" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="120" align="center"/>
<EF:EFComboColumn ename="custCode" cname="供应商名称" width="120" align="center" required="true"
blockName="customer_record_block_id" textField="textField" valueField="valueField"
blockName="supplier_record_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#" readonly="false"
filter="contains">
</EF:EFComboColumn>
<EF:EFColumn ename="proApplyDate" cname="采购申请单号" enable="false" width="140" align="center"/>
<EF:EFColumn ename="proApplyDate" cname="采购申请日期" width="100" align="center" editType="date" readonly="false"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true"/>
<EF:EFColumn ename="proApplyNo" cname="采购申请单号" enable="false" width="140" align="center" readonly="true"/>
<EF:EFColumn ename="proApplyDate" cname="采购申请日期" width="100" align="center" editType="date" readonly="true"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" />
<EF:EFComboColumn ename="factoryCode" required="true" cname="厂区" width="110" align="center" defaultValue=""
<EF:EFComboColumn ename="factoryCode" cname="厂区" width="110" align="center" defaultValue=""
filter="contains" readonly="true">
<EF:EFOptions blockId="factory_record_block_id" valueField="valueField" textField="textField"/>
</EF:EFComboColumn>
......@@ -42,9 +46,9 @@
readonly="true">
<EF:EFCodeOption codeName="hpjx.hpkc.inventType" condition="ITEM_CODE IN ('1', '2')"/>
</EF:EFComboColumn>
<EF:EFColumn ename="whCode" cname="仓库名称" width="120" align="center" required="true" readonly="true"/>
<EF:EFColumn ename="whCode" cname="仓库名称" width="120" align="center" readonly="true"/>
<EF:EFColumn ename="inventCode" cname="存货编码" hidden="true"/>
<EF:EFColumn ename="inventName" cname="存货名称" width="150" align="center" required="true" readonly="true"/>
<EF:EFColumn ename="inventName" cname="存货名称" width="150" align="center" readonly="true"/>
<EF:EFColumn ename="inventRecordId" cname="规格ID" width="120" align="center" readonly="true" hidden="true"/>
<EF:EFColumn ename="spec" cname="规格" width="120" align="center" readonly="true"/>
<EF:EFColumn ename="length" cname="长(MM)" width="80" align="right" format="{0:N3}" readonly="true"/>
......@@ -54,16 +58,17 @@
<EF:EFColumn ename="material" cname="材质" width="80" align="center" readonly="true"/>
<EF:EFColumn ename="unit" cname="单位" width="80" align="center" readonly="true"/>
<EF:EFColumn ename="applyAmount" cname="申请数量" format="{0:N0}" maxLength="20" width="100" align="right"
required="true" readonly="true"/>
readonly="true"/>
<EF:EFColumn ename="applyWeight" cname="申请重量(T)" enable="false" width="120" align="right" format="{0:N3}"/>
<EF:EFColumn ename="applyAmount" cname="现有库存数量" format="{0:N0}" maxLength="20" width="100" align="right"
required="true" readonly="true"/>
<EF:EFColumn ename="applyWeight" cname="现有库存重量(T)" enable="false" width="120" align="right" format="{0:N3}"/>
<EF:EFColumn ename="invAmount" cname="现有库存数量" format="{0:N0}" maxLength="20" width="100" align="right"
readonly="true"/>
<EF:EFColumn ename="invWeight" cname="现有库存重量(T)" enable="false" width="120" align="right" format="{0:N3}"/>
<EF:EFColumn ename="planAmount" cname="计划数量" format="{0:N0}" maxLength="20" width="100" align="right"
required="true" readonly="true"/>
<EF:EFColumn ename="planWeight" cname="计划重量(T)" enable="false" width="120" align="right" format="{0:N3}"/>
<EF:EFComboColumn ename="proApplyStatus" cname="提交状态" width="80" align="center" readonly="true" required="true" defaultValue="0">
<EF:EFCodeOption codeName="hpjx.hpxs.repStatus"/>
enable="false"/>
<EF:EFColumn ename="planWeight" cname="计划重量(T)" width="120" align="right" format="{0:N3}"
required="true"/>
<EF:EFComboColumn ename="proApplyStatus" cname="提交状态" width="80" align="center" readonly="true" defaultValue="0">
<EF:EFCodeOption codeName="hpjx.hpcg.proApplyStatus"/>
</EF:EFComboColumn>
<%-- <EF:EFColumn cname="创建人" ename="createdName" align="center" width="150" readonly="true" required="false" enable="false"/>
<EF:EFColumn cname="创建时间" ename="createdTime" parseFormats="['yyyyMMddHHmmss']" editType="datetime"
......
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