Commit 5f952217 by liuyang

Merge branch 'dev' of http://git.pseer.com:8800/platform/hg-smart into dev-ly

parents 7da6bf3f 7f947997
......@@ -116,6 +116,15 @@ public class UserSessionUtils extends UserSession {
}
/**
* 获取登录用户的组织信息
*
* @return
*/
public static List<Org> getOrg() {
return HGXSTools.XsOrg.queryByUser();
}
/**
* 获取登录用户的公司编码
*
* @return
......
package com.baosight.hggp.hg.cg.constant;
/**
* @author:songx
* @date:2024/9/4,9:24
*/
public class HgCgSqlConst {
/**
*
* @author:songx
* @date:2024/9/4,11:22
*/
public class HgCg003 {
// 模块名称:HGCW003
private static final String MODULE_NAME = "HGCG003.";
// 修改状态
public static final String UPDATE_STATUS = MODULE_NAME + "updateStatus";
}
/**
* @author:songx
* @date:2024/8/30,16:25
*/
public class HgCg003A {
// 模块名称:HGCW003A
private static final String MODULE_NAME = "HGCG003A.";
//
public static final String QUERY_BY_QUALITY_TESTING = MODULE_NAME + "queryByQualityTesting";
// 修改数量
public static final String UPDATE_QTY = MODULE_NAME + "updateQty";
}
}
package com.baosight.hggp.hg.cg.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.math.BigDecimal;
import java.util.HashMap;
import java.util.Map;
/**
* Project: <br>
* Title:Hgcg003a.java <br>
* Description: <br>
*
* Copyrigth:Baosight Software LTD.co Copyright (c) 2019. <br>
*
* @version 1.0
* @history 2024-09-04 9:15:38 create
*/
public class HGCG003B1 extends HGCG003B {
private static final long serialVersionUID = 1L;
public static final String FIELD_SUP_CODE = "supCode"; /* 供应商编码*/
public static final String FIELD_SUP_NAME = "supName"; /* 供应商名称*/
public static final String FIELD_PUR_USER_ID = "purUserId"; /* 采购员*/
public static final String FIELD_PUR_USER_NAME = "purUserName"; /* 采购员名称*/
public static final String FIELD_SOURCE = "source"; /* 数据来源 根据采购数据来源小代码 目前0默认采购合同,1手动录入*/
private String supCode = " "; /* 供应商编码*/
private String supName = " "; /* 供应商名称*/
private String purUserId = " "; /* 采购员*/
private String purUserName = " "; /* 采购员名称*/
private Integer source; /* 数据来源 根据采购数据来源小代码 目前0默认采购合同,1手动录入*/
/**
* initialize the metadata.
*/
public void initMetaData() {
EiColumn eiColumn;
eiColumn = new EiColumn(FIELD_SUP_CODE);
eiColumn.setDescName("供应商编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_SUP_NAME);
eiColumn.setDescName("供应商名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_PUR_USER_ID);
eiColumn.setDescName("采购员");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_PUR_USER_NAME);
eiColumn.setDescName("采购员名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_SOURCE);
eiColumn.setDescName("数据来源");
eiMetadata.addMeta(eiColumn);
}
/**
* the constructor.
*/
public HGCG003B1() {
super.initMetaData();
initMetaData();
}
public String getSupCode() {
return supCode;
}
public void setSupCode(String supCode) {
this.supCode = supCode;
}
public String getSupName() {
return supName;
}
public void setSupName(String supName) {
this.supName = supName;
}
public String getPurUserId() {
return purUserId;
}
public void setPurUserId(String purUserId) {
this.purUserId = purUserId;
}
public String getPurUserName() {
return purUserName;
}
public void setPurUserName(String purUserName) {
this.purUserName = purUserName;
}
public Integer getSource() {
return source;
}
public void setSource(Integer source) {
this.source = source;
}
/**
* get the value from Map.
*
* @param map - source data map
*/
@Override
public void fromMap(Map map) {
super.fromMap(map);
setSupCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_SUP_CODE)), supCode));
setSupName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_SUP_NAME)), supName));
setPurUserId(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PUR_USER_ID)), purUserId));
setPurUserName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PUR_USER_NAME)), purUserName));
setSource(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_SOURCE)), source));
}
/**
* set the value to Map.
*/
@Override
public Map toMap() {
Map map = super.toMap();
map.put(FIELD_SUP_CODE, StringUtils.toString(supCode, eiMetadata.getMeta(FIELD_SUP_CODE)));
map.put(FIELD_SUP_NAME, StringUtils.toString(supName, eiMetadata.getMeta(FIELD_SUP_NAME)));
map.put(FIELD_PUR_USER_ID, StringUtils.toString(purUserId, eiMetadata.getMeta(FIELD_PUR_USER_ID)));
map.put(FIELD_PUR_USER_NAME, StringUtils.toString(purUserName, eiMetadata.getMeta(FIELD_PUR_USER_NAME)));
map.put(FIELD_SOURCE, StringUtils.toString(source, eiMetadata.getMeta(FIELD_SOURCE)));
return map;
}
}
......@@ -5,6 +5,7 @@ import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.enums.DeleteFlagEnum;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.cg.constant.HgCgSqlConst;
import com.baosight.hggp.hg.cg.domain.*;
import com.baosight.hggp.hg.cg.tools.HGCGTools;
import com.baosight.hggp.hg.cg.utils.HGCGUtils;
......@@ -343,7 +344,7 @@ public class ServiceHGCG003 extends ServiceBase {
hgcg003.fromMap(map);
HGCG003 old = HGCGTools.HgCg003.get(hgcg003.getId());
hgcg003.setReceiveNo(old.getReceiveNo());
DaoUtils.update(HGCG003.UPDATE_STATUS, hgcg003);
DaoUtils.update(HgCgSqlConst.HgCg003.UPDATE_STATUS, hgcg003);
this.putInStorageData(old);
}
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
......
......@@ -153,18 +153,24 @@ public class ServiceHGCG003A extends ServiceBase {
fCg002B.setPurUnitWeight(bcReceiveWeight.divide(bcReceiveQty, 3, RoundingMode.HALF_UP));
}
// 含税总金额
BigDecimal amount;
BigDecimal taxIncludeAmount;
if (HgCgConst.CalculationMethod.S1.equals(fCg002B.getCalculationMethod())) {
amount = bcReceiveWeight.multiply(dbCg002b.getPrice());
taxIncludeAmount = bcReceiveWeight.multiply(dbCg002b.getPrice());
} else {
amount = bcReceiveQty.multiply(dbCg002b.getPrice());
taxIncludeAmount = bcReceiveQty.multiply(dbCg002b.getPrice());
}
// 如果税率不为空,总金额减去税
// 如果税率不为空,计算不含税金
if (dbCg002b.getTaxRate() != null) {
BigDecimal taxRate = dbCg002b.getTaxRate().multiply(new BigDecimal("0.01")).add(BigDecimal.ONE);
amount = amount.divide(taxRate, 2, RoundingMode.HALF_UP);
BigDecimal amount = taxIncludeAmount.divide(taxRate, 2, RoundingMode.HALF_UP);
BigDecimal taxAmount = taxIncludeAmount.subtract(amount);
fCg002B.setAmount(amount);
fCg002B.setTaxAmount(taxAmount);
} else {
fCg002B.setAmount(taxIncludeAmount);
fCg002B.setTaxAmount(BigDecimal.ZERO);
}
fCg002B.setAmount(amount);
fCg002B.setTaxIncludeAmount(taxIncludeAmount);
}
}
......@@ -191,10 +197,13 @@ public class ServiceHGCG003A extends ServiceBase {
.reduce(BigDecimal.ZERO, BigDecimal::add);
newCg003.setReceiveWeight(receiveWeight);
newCg003.setReceiveUnitWeight(receiveWeight.divide(bcReceiveQtySum, 3, RoundingMode.HALF_UP));
// 计算收货总金额
BigDecimal receiveAmount = fCg002Bs.stream().map(HGCG002B::getAmount)
.reduce(BigDecimal.ZERO, BigDecimal::add);
newCg003.setAmount(receiveAmount);
// 计算不含税总金额
newCg003.setAmount(fCg002Bs.stream().map(HGCG002B::getAmount).reduce(BigDecimal.ZERO, BigDecimal::add));
// 计算含税总金额
newCg003.setTaxIncludeAmount(fCg002Bs.stream().map(HGCG002B::getTaxIncludeAmount)
.reduce(BigDecimal.ZERO, BigDecimal::add));
// 计算总税额
newCg003.setTaxAmount(fCg002Bs.stream().map(HGCG002B::getTaxAmount).reduce(BigDecimal.ZERO, BigDecimal::add));
newCg003.setStatus(HGConstant.CgReceiveStatus.S_0);
newCg003.setDeleteFlag(DeleteFlagEnum.UN_REMOVE.getCode());
newCg003.setSource(HGConstant.CgSource.DEFAULT);
......
......@@ -94,7 +94,7 @@ public class ServiceHGCG003B extends ServiceBase {
try {
List<HGCG003B> fCg003Bs = MapUtils.toDaoEPBases(inInfo, HGCG003B.class);
HGCG003 cg003 = HGCGTools.HgCg003.get(fCg003Bs.get(0).getPrimaryId());
if (cg003.getSource().intValue() == HGConstant.CgSource.DEFAULT) {
if (cg003.getSource() == HGConstant.CgSource.DEFAULT) {
// 采购收货DB数据
Map<Long, HGCG003B> dbCg003BMap = HGCGUtils.HgCg003B.lockGetDataEp(fCg003Bs);
// 采购合同DB数据
......
......@@ -38,14 +38,17 @@
DEPOSIT_QTY as "depositQty", <!-- 入库数量 -->
RECEIVE_UNIT_WEIGHT as "receiveUnitWeight", <!-- 收货单重 -->
RECEIVE_WEIGHT as "receiveWeight", <!-- 收货重量 -->
PRICE as "price", <!-- 单价 -->
AMOUNT as "amount", <!-- 金额 -->
STATUS as "status", <!-- 状态:0-已收货,1-已入库,2-部分入库,3-退货 -->
SOURCE as "source", <!-- 数据来源 根据采购数据来源小代码 目前默认0采购合同,1手工录入 -->
INVENT_TYPE_DETAIL as "inventTypeDetail", <!-- 存货类型明细 -->
PROJ_CODE as "projCode", <!-- 项目编码 -->
PROJ_NAME as "projName", <!-- 项目名称 -->
IS_INVOICING as "isInvoicing"
STATUS as "status", <!-- 状态:0-已收货,1-已入库,2-部分入库,3-退货 -->
PRICE as "price", <!-- 单价 -->
AMOUNT as "amount", <!-- 金额(不含税金额) -->
TAX_INCLUDE_AMOUNT as "taxIncludeAmount", <!-- 含税金额 -->
TAX_AMOUNT as "taxAmount", <!-- 税额 -->
TAX_RATE as "taxRate", <!-- 税率 -->
INVENT_TYPE_DETAIL as "inventTypeDetail", <!-- 存货类型大类 -->
IS_INVOICING as "isInvoicing", <!-- 是否开票 -->
SOURCE as "source", <!-- 数据来源 根据采购数据来源小代码 目前0默认采购合同,1手动录入 -->
PROJ_CODE as "projCode", <!-- 项目编码 -->
PROJ_NAME as "projName" <!-- 项目名称 -->
</sql>
<sql id="condition">
......@@ -183,7 +186,6 @@
<insert id="insert">
INSERT INTO ${hggpSchema}.HGCG003 (
ID,
ACCOUNT_CODE, <!-- 企业编码 -->
DEP_CODE, <!-- 部门编码 -->
CREATED_BY, <!-- 记录创建者 -->
......@@ -211,23 +213,30 @@
WIDTH, <!-- 宽度 -->
THICK, <!-- 厚度 -->
RECEIVE_QTY, <!-- 收货数量 -->
DELIVER_QTY, <!-- 退货数量 -->
DEPOSIT_QTY, <!-- 入库数量 -->
RECEIVE_UNIT_WEIGHT, <!-- 收货单重 -->
RECEIVE_WEIGHT, <!-- 收货重量 -->
PRICE, <!-- 单价 -->
AMOUNT, <!-- 金额 -->
STATUS, <!-- 状态:0-已收货,1-已入库,2-部分入库,3-退货 -->
INVENT_TYPE_DETAIL,
IS_INVOICING,
PRICE, <!-- 单价 -->
AMOUNT, <!-- 金额(不含税金额) -->
TAX_INCLUDE_AMOUNT, <!-- 含税金额 -->
TAX_AMOUNT, <!-- 税额 -->
TAX_RATE, <!-- 税率 -->
INVENT_TYPE_DETAIL, <!-- 存货类型大类 -->
IS_INVOICING, <!-- 是否开票 -->
SOURCE, <!-- 数据来源 根据采购数据来源小代码 目前0默认采购合同,1手动录入 -->
PROJ_CODE, <!-- 项目编码 -->
PROJ_NAME, <!-- 项目名称 -->
SOURCE <!-- 数据来源 根据采购数据来源小代码 目前默认0采购合同,1手工录入 -->
PROJ_NAME <!-- 项目名称 -->
) VALUES (
#id#,#accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#,
#accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#,
#deleteFlag#, #companyCode#, #companyName#, #receiveDate#, #receiveNo#,
#planNo#, #contractNo#, #supCode#, #supName#, #purUserId#, #purUserName#,
#inventType#, #inventCode#, #inventName#, #specId#, #spec#, #material#,
#unit#, #length#, #width#, #thick#, #receiveQty#, #receiveUnitWeight#,
#receiveWeight#,#price#, #amount#, #status#,#inventTypeDetail#,#isInvoicing#,#projCode#,#projName#, #source#
#unit#, #length#, #width#, #thick#, #receiveQty#, #deliverQty#, #depositQty#,
#receiveUnitWeight#, #receiveWeight#, #status#, #price#, #amount#,
#taxIncludeAmount#, #taxAmount#, #taxRate#, #inventTypeDetail#, #isInvoicing#,
#source#, #projCode#, #projName#
)
<selectKey resultClass="long" keyProperty="id">
SELECT MAX(ID) AS "id" FROM ${hggpSchema}.HGCG003
......@@ -270,6 +279,9 @@
RECEIVE_QTY = #receiveQty#, <!-- 收货数量 -->
RECEIVE_WEIGHT = #receiveWeight#, <!-- 收货重量 -->
AMOUNT = #amount#, <!-- 金额 -->
TAX_INCLUDE_AMOUNT = #taxIncludeAmount#, <!-- 含税金额 -->
TAX_AMOUNT = #taxAmount#, <!-- 税额 -->
TAX_RATE = #taxRate#, <!-- 税率 -->
RECEIVE_DATE = REPLACE(#receiveDate#, '-', ''), <!-- 收货日期 -->
PROJ_CODE = #projCode#, <!-- 项目编号 -->
PROJ_NAME = #projName#, <!-- 项目名称 -->
......
......@@ -137,67 +137,66 @@ public class ServiceHGKC003 extends ServiceBase {
String.format("入库单【%s】已删除,请勿重复操作", fKc003.getDepositNo()));
AssertUtils.isTrue(fKc003.getSubmitStatus().compareTo(HGConstant.ProductStatus.WTJ) == 0,"入库单"+fKc003.getDepositNo()+"未提交,请勿退回");
}
/**
* 修改提交状态
*
* @param inInfo
* @return
*/
public EiInfo updateSubmitStatus(EiInfo inInfo){
int i = 0;
public EiInfo updateSubmitStatus(EiInfo inInfo) {
try {
HGKC003 hgkc003 = new HGKC003();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
for (i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
hgkc003.fromMap(map);
hgkc003 = HGKCTools.HgKc003.getId(hgkc003.getId());
//查看是否能获取到账期,获取不到就提示
HGCWTools.HgCw001.getAccountPeriod(hgkc003.getCompanyCode(),hgkc003.getDepositDate());
hgkc003.setSubmitStatus(HGConstant.ProductStatus.YTJ);
List<HGKC003> fKc003s = MapUtils.toDaoEPBases(inInfo, HGKC003.class);
for (HGKC003 fKc003 : fKc003s) {
HGKC003 dbKc003 = HGKCTools.HgKc003.getId(fKc003.getId());
// 查看是否能获取到账期,获取不到就提示
HGCWTools.HgCw001.getAccountPeriod(dbKc003.getCompanyCode(), dbKc003.getDepositDate());
dbKc003.setSubmitStatus(HGConstant.ProductStatus.YTJ);
// 校验数据
this.checkSubmitData(hgkc003);
DaoUtils.update(HGKC003.UPDATE_SUBMIT_STATUS, hgkc003);
//修改计划生产任务完工数量
HGSCTools.complete(hgkc003.getQualityId(),hgkc003.getInvQty().intValue(),hgkc003.getRectificationId(),HGConstant.StorageType.RK);
this.checkSubmitData(dbKc003);
DaoUtils.update(HGKC003.UPDATE_SUBMIT_STATUS, dbKc003);
// 修改计划生产任务完工数量
HGSCTools.complete(dbKc003.getQualityId(), dbKc003.getInvQty().intValue(), dbKc003.getRectificationId(),
HGConstant.StorageType.RK);
// 修改库存
HGKCUtils.HgKc010.updateInv(hgkc003.getCompanyCode(), hgkc003.getWhCode(), hgkc003.getPrdtCode(),
hgkc003.getInvQty(), hgkc003.getInvWeight());
HGKCUtils.HgKc010.updateInv(dbKc003.getCompanyCode(), dbKc003.getWhCode(), dbKc003.getPrdtCode(),
dbKc003.getInvQty(), dbKc003.getInvWeight());
}
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsgByKey("ep.1000", new String[]{String.valueOf(i), I18nMessages.getText("label.update", "提交")});
inInfo.setMsg("提交成功!");
} catch (PlatException e) {
e.printStackTrace();
inInfo.setStatus(EiConstant.STATUS_FAILURE);
ErrorCodeUtils.handleUpdateException(inInfo,i,e);
logError("修改失败", e.getMessage());
return inInfo;
LogUtils.setMsg(inInfo, e, "提交失败");
}
return inInfo;
}
private void checkSubmitData(HGKC003 hgkc003) {
AssertUtils.isEmpty(hgkc003.getWhCode(),"仓库编码不能为空!");
AssertUtils.isEmpty(hgkc003.getWhName(),"仓库名称不能为空!");
AssertUtils.isNull(hgkc003.getPrice(),"单价不能为空!");
/**
* 数据校验
*
* @param dbKc003
*/
private void checkSubmitData(HGKC003 dbKc003) {
AssertUtils.isEmpty(dbKc003.getWhCode(), "仓库编码不能为空!");
AssertUtils.isEmpty(dbKc003.getWhName(), "仓库名称不能为空!");
AssertUtils.isNull(dbKc003.getPrice(), "单价不能为空!");
//判断是不是最前工序,如果不是得提示
List<HGPZ005A> hgpz005AList = HGPZTools.HgPz005A.queryByInventCode(hgkc003.getPrdtCode());
List<HGKC003> hgkc003List = HGKCTools.HgKc003.getByQualityId(hgkc003.getQualityId());
List<HGPZ005A> hgpz005AList = HGPZTools.HgPz005A.queryByInventCode(dbKc003.getPrdtCode());
List<HGKC003> hgkc003List = HGKCTools.HgKc003.getByQualityId(dbKc003.getQualityId());
//当前提交的工序信息
HGPZ005A hgpz005AFilter = hgpz005AList.stream().filter(o->o.getInventCode().equals(hgkc003.getPrdtCode())).findAny().orElse(null);
AssertUtils.isNull(hgpz005AFilter,"此物料没有配置工序!");
for(HGKC003 entity : hgkc003List){
if(entity.getId().intValue() != hgkc003.getId().intValue()){
HGPZ005A hgpz005AFilter = hgpz005AList.stream().filter(o -> o.getInventCode().equals(dbKc003.getPrdtCode()))
.findAny().orElse(null);
AssertUtils.isNull(hgpz005AFilter, "此物料没有配置工序!");
for (HGKC003 entity : hgkc003List) {
if (entity.getId().intValue() != dbKc003.getId().intValue()) {
//遍历相同质检单的工序
HGPZ005A hgpz005A = hgpz005AList.stream().filter(o->o.getInventCode().equals(entity.getPrdtCode())).findAny().orElse(null);
HGPZ005A hgpz005A = hgpz005AList.stream().filter(o -> o.getInventCode().equals(entity.getPrdtCode()))
.findAny().orElse(null);
//如果未提交的生产单有比当前更靠前的工序,则需要提示
AssertUtils.isTrue(hgpz005A.getProcessOrder().compareTo(hgpz005AFilter.getProcessOrder()) < 0,hgpz005A.getInventCode()+"的工序“"+hgpz005A.getProcessName()+"“未提交,生产入库号为:"+entity.getDepositNo());
AssertUtils.isTrue(hgpz005A.getProcessOrder().compareTo(hgpz005AFilter.getProcessOrder()) < 0,
hgpz005A.getInventCode() + "的工序“" + hgpz005A.getProcessName() + "“未提交,生产入库号为:"
+ entity.getDepositNo());
}
}
}
/**
......
......@@ -20,96 +20,127 @@ import java.util.*;
* @Date 2024/5/6 19:48
*/
public class ServiceHGSC005A extends ServiceBase {
@OperationLogAnnotation(operModul = "生产计划详情", operType = "查询", operDesc = "初始化页面")
public EiInfo initLoad(EiInfo inInfo) {
try {
String planCode = inInfo.getCellStr(EiConstant.queryBlock,0,HGSC005A.FIELD_plan_code);
HGSC005 hgsc005 = HGSCTools.THGSC005.queryByPlanCode(planCode);
inInfo.setCell(EiConstant.queryBlock,0,HGSC005.FIELD_is_schedule,hgsc005.getIsSchedule());
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGSC005A().eiMetadata);
// inInfo = super.query(inInfo, HGSC005A.QUERY, new HGSC005A());
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.PLAN_PROCESS_BLOCK_ID), new HashMap<String, Object>(){{
put(HGSC005A.FIELD_plan_code,planCode);
}},false);
CommonMethod.comboBoxDefaultValue(inInfo,DdynamicEnum.PLAN_PROCESS_BLOCK_ID.getBlockId(),"全部");
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
@OperationLogAnnotation(operModul = "生产计划详情", operType = "查询", operDesc = "查询")
public EiInfo query(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HGSC005A.QUERY, new HGSC005A());
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
@OperationLogAnnotation(operModul = "生产计划详情", operType = "保存", operDesc = "保存计划详情")
public EiInfo update(EiInfo inInfo){
try {
List<HGSC005A> hgsc005AList = MapUtils.toDaoEPBases(inInfo, HGSC005A.class);
// 数据校验
this.checkSaveData(hgsc005AList);
// 保存数据
this.saveData(hgsc005AList);
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + hgsc005AList.size() + "]条数据保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
private void saveData(List<HGSC005A> hgsc005AList) {
for (HGSC005A hgsc005a : hgsc005AList) {
DaoUtils.update(HGSC005A.UPDATE_PLAN_DATE, hgsc005a);
}
}
private void checkSaveData(List<HGSC005A> hgsc005AList) {
AssertUtils.isEmpty(hgsc005AList,"保存数据为空,请勾选后修改保存!");
AssertUtils.isEmpty(hgsc005AList.get(0).getPlanCode(),"生产计划详情数据异常,请联系管理员!");
HGSC005 hgsc005 = HGSCTools.THGSC005.queryByPlanCode(hgsc005AList.get(0).getPlanCode());
AssertUtils.isTrue(Objects.isNull(hgsc005.getCommitStatus()),"生产计划状态异常,请联系管理员!");
AssertUtils.isTrue(hgsc005.getCommitStatus().compareTo(CommonConstant.YesNo.NO_0)>0,"生产计划已提交,不可修改!");
for (HGSC005A hgsc005a : hgsc005AList) {
AssertUtils.isEmpty(hgsc005a.getPlanStartDate(), String.format("产品[%s]计划开工日期为空!", hgsc005a.getProductName()));
AssertUtils.isEmpty(hgsc005a.getPlanEndDate(), String.format("产品[%s]计划完工日期为空!", hgsc005a.getProductName()));
AssertUtils.isTrue(DateUtil.toDate(hgsc005a.getPlanEndDate(),DateUtil.DATE10_PATTERN).compareTo(
DateUtil.toDate(hgsc005a.getPlanStartDate(),DateUtil.DATE10_PATTERN))<0,String.format("产品[%s]计划完工日期不能大于开工日期!", hgsc005a.getProductName()));
}
}
@OperationLogAnnotation(operModul = "生产计划详情", operType = "排产", operDesc = "排产")
public EiInfo schedule(EiInfo inInfo) {
try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
String planCode = MapUtils.getString(queryMap, "planCode");
HGSC005 hgsc005 = HGSCTools.THGSC005.queryByPlanCode(planCode);
this.checkScheduleData(hgsc005);
int count = HGSCTools.THGSC005A.schedule(planCode);
hgsc005.setIsSchedule(CommonConstant.YesNo.YES_1);
DaoUtils.update(HGSC005.UPDATE,hgsc005);
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + count + "]条数据排产成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "操作失败");
}
return inInfo;
}
private void checkScheduleData(HGSC005 hgsc005) {
AssertUtils.isTrue(hgsc005.getIsSchedule().compareTo(CommonConstant.YesNo.YES_1)==0,"当前计划已排产,请手动调整计划!");
}
/**
* 初始化
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "生产计划详情", operType = "查询", operDesc = "初始化页面")
public EiInfo initLoad(EiInfo inInfo) {
try {
String planCode = inInfo.getCellStr(EiConstant.queryBlock, 0, HGSC005A.FIELD_plan_code);
HGSC005 hgsc005 = HGSCTools.THGSC005.queryByPlanCode(planCode);
inInfo.setCell(EiConstant.queryBlock, 0, HGSC005.FIELD_is_schedule, hgsc005.getIsSchedule());
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGSC005A().eiMetadata);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.PLAN_PROCESS_BLOCK_ID),
new HashMap<String, Object>() {{
put(HGSC005A.FIELD_plan_code, planCode);
}}, false);
CommonMethod.comboBoxDefaultValue(inInfo, DdynamicEnum.PLAN_PROCESS_BLOCK_ID.getBlockId(), "全部");
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 修改数据
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "生产计划详情", operType = "查询", operDesc = "查询")
public EiInfo query(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HGSC005A.QUERY, new HGSC005A());
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsg("查询成功!");
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
/**
* 修改数据
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "生产计划详情", operType = "保存", operDesc = "保存计划详情")
public EiInfo update(EiInfo inInfo) {
try {
List<HGSC005A> hgsc005AList = MapUtils.toDaoEPBases(inInfo, HGSC005A.class);
// 数据校验
this.checkSaveData(hgsc005AList);
// 保存数据
this.saveData(hgsc005AList);
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + hgsc005AList.size() + "]条数据保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
private void saveData(List<HGSC005A> hgsc005AList) {
for (HGSC005A hgsc005a : hgsc005AList) {
DaoUtils.update(HGSC005A.UPDATE_PLAN_DATE, hgsc005a);
}
}
private void checkSaveData(List<HGSC005A> hgsc005AList) {
AssertUtils.isEmpty(hgsc005AList, "保存数据为空,请勾选后修改保存!");
AssertUtils.isEmpty(hgsc005AList.get(0).getPlanCode(), "生产计划详情数据异常,请联系管理员!");
HGSC005 hgsc005 = HGSCTools.THGSC005.queryByPlanCode(hgsc005AList.get(0).getPlanCode());
AssertUtils.isTrue(Objects.isNull(hgsc005.getCommitStatus()), "生产计划状态异常,请联系管理员!");
AssertUtils.isTrue(hgsc005.getCommitStatus().compareTo(CommonConstant.YesNo.NO_0) > 0, "生产计划已提交,不可修改!");
for (HGSC005A hgsc005a : hgsc005AList) {
AssertUtils.isEmpty(hgsc005a.getPlanStartDate(),
String.format("产品[%s]计划开工日期为空!", hgsc005a.getProductName()));
AssertUtils.isEmpty(hgsc005a.getPlanEndDate(), String.format("产品[%s]计划完工日期为空!", hgsc005a.getProductName()));
AssertUtils.isTrue(DateUtil.toDate(hgsc005a.getPlanEndDate(), DateUtil.DATE10_PATTERN).compareTo(
DateUtil.toDate(hgsc005a.getPlanStartDate(), DateUtil.DATE10_PATTERN)) < 0,
String.format("产品[%s]计划完工日期不能大于开工日期!", hgsc005a.getProductName()));
}
}
/**
* 排产
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "生产计划详情", operType = "排产", operDesc = "排产")
public EiInfo schedule(EiInfo inInfo) {
try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
String planCode = MapUtils.getString(queryMap, "planCode");
HGSC005 dbSc005 = HGSCTools.THGSC005.queryByPlanCode(planCode);
this.checkScheduleData(dbSc005);
int count = HGSCTools.THGSC005A.schedule(planCode);
dbSc005.setIsSchedule(CommonConstant.YesNo.YES_1);
DaoUtils.update(HGSC005.UPDATE, dbSc005);
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + count + "]条数据排产成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "操作失败");
}
return inInfo;
}
/**
* 排产校验数据
*
* @param dbSc005
*/
private void checkScheduleData(HGSC005 dbSc005) {
// AssertUtils.isEquals(hgsc005.getIsSchedule(), CommonConstant.YesNo.YES_1, "当前计划已排产,请手动调整计划!");
}
}
......@@ -152,9 +152,6 @@
<isNotEmpty prepend=" AND " property="unfinishWeight">
unfinish_weight = #unfinishWeight#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="accountCode">
account_code = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
created_by = #createdBy#
</isNotEmpty>
......@@ -173,19 +170,13 @@
<isNotEmpty prepend=" AND " property="updatedTime">
updated_time = #updatedTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="ids">
id IN <iterate close=")" open="(" conjunction="," property="ids">#ids[]#</iterate>
</isNotEmpty>
<!-- 移动端请求参数 -->
<isEqual prepend=" AND " property="completeStatus" compareValue="0">
trim(ifnull(complete_date,'')) = ''
</isEqual>
<isEqual prepend=" AND " property="completeStatus" compareValue="1">
trim(ifnull(complete_date,'')) != ''
</isEqual>
</sql>
<sql id="customCondition">
<include refid="condition"/>
<isNotEmpty prepend=" AND " property="ids">
id IN <iterate close=")" open="(" conjunction="," property="ids">#ids[]#</iterate>
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCodes">
COMPANY_CODE IN <iterate close=")" open="(" conjunction="," property="companyCodes">#companyCodes[]#</iterate>
</isNotEmpty>
......@@ -201,6 +192,13 @@
<isNotEmpty prepend=" AND " property="groupNames">
GROUP_NAME IN <iterate close=")" open="(" conjunction="," property="groupNames">#groupNames[]#</iterate>
</isNotEmpty>
<!-- 移动端请求参数 -->
<isEqual prepend=" AND " property="completeStatus" compareValue="0">
TRIM(IFNULL(COMPLETE_DATE, '')) = ''
</isEqual>
<isEqual prepend=" AND " property="completeStatus" compareValue="1">
TRIM(IFNULL(COMPLETE_DATE, '')) != ''
</isEqual>
</sql>
<sql id="appCustomCondition">
......@@ -265,7 +263,7 @@
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
id desc, product_type asc, product_name, process_order desc
ID DESC, PRODUCT_TYPE ASC, PRODUCT_NAME, PROCESS_ORDER DESC
</isEmpty>
</dynamic>
</sql>
......@@ -275,7 +273,6 @@
<include refid="column"/>
FROM ${hggpSchema}.HGSC007
WHERE 1=1
<include refid="condition"/>
<include refid="customCondition"/>
<include refid="orderBy"/>
</select>
......@@ -283,7 +280,6 @@
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hggpSchema}.HGSC007
WHERE 1=1
<include refid="condition"/>
<include refid="customCondition"/>
</select>
......@@ -530,7 +526,7 @@
</select>
<insert id="insert">
INSERT INTO ${hggpSchema}.HGSC007 (id,
INSERT INTO ${hggpSchema}.HGSC007 (
mat_id, <!-- 物料清单ID -->
order_id, <!-- 生产计划ID -->
order_detail_id, <!-- 生产计划明细ID -->
......@@ -573,13 +569,14 @@
updated_time, <!-- 更新时间 -->
spec,
length
)
VALUES (#id#, #matId#, #orderId#, #orderDetailId#, #techFlowId#, #techFlowName#, #inventProcessId#,
) VALUES (
#matId#, #orderId#, #orderDetailId#, #techFlowId#, #techFlowName#, #inventProcessId#,
#processCode#, #processName#, #processOrder#, #companyCode#, #companyName#, #depCode#, #depName#, #projCode#,
#projName#, #taskCode#, #productType#, #productCode#, #productName#, #planStartDate#, #planEndDate#,
#factoryCode#, #factoryName#, #groupCode#, #groupName#, #completeDate#, #quantity#, #finishQuantity#,
#unfinishQuantity#, #singleWeight#, #totalWeight#, #finishWeight#, #unfinishWeight#, #accountCode#, #createdBy#,
#createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #spec#, #length#)
#createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #spec#, #length#
)
</insert>
<delete id="delete">
......@@ -589,50 +586,45 @@
<update id="update">
UPDATE ${hggpSchema}.HGSC007
SET
mat_id = #matId#, <!-- 物料清单ID -->
order_id = #orderId#, <!-- 生产计划ID -->
order_detail_id = #orderDetailId#, <!-- 生产计划明细ID -->
tech_flow_id = #techFlowId#, <!-- 工艺流程ID -->
tech_flow_name = #techFlowName#, <!-- 工艺流程名称 -->
invent_process_id = #inventProcessId#, <!-- 存货工序ID,对应HGPZ005A.id -->
process_code = #processCode#, <!-- 工序编码 -->
process_name = #processName#, <!-- 工序名称 -->
process_order = #processOrder#, <!-- 加工顺序 -->
company_code = #companyCode#, <!-- 公司编码 -->
company_name = #companyName#, <!-- 公司名称 -->
dep_code = #depCode#, <!-- 部门编码 -->
dep_name = #depName#, <!-- 部门名称 -->
proj_code = #projCode#, <!-- 项目编码 -->
proj_name = #projName#, <!-- 项目名称 -->
task_code = #taskCode#, <!-- 任务编码 -->
product_type = #productType#, <!-- 产品类型 -->
product_code = #productCode#, <!-- 产品编号 -->
product_name = #productName#, <!-- 产品名称 -->
plan_start_date = #planStartDate#, <!-- 计划开始日期 -->
plan_end_date = #planEndDate#, <!-- 计划结束日期 -->
factory_code = #factoryCode#, <!-- 工厂编号 -->
factory_name = #factoryName#, <!-- 工厂名称 -->
group_code = #groupCode#, <!-- 工作组编号 -->
group_name = #groupName#, <!-- 工作组名称 -->
complete_date = #completeDate#, <!-- 完工日期 -->
quantity = #quantity#, <!-- 数量 -->
finish_quantity = #finishQuantity#, <!-- 完工数量 -->
unfinish_quantity = #unfinishQuantity#, <!-- 未完工数量 -->
single_weight = #singleWeight#, <!-- 单重 -->
total_weight = #totalWeight#, <!-- 总重 -->
finish_weight = #finishWeight#, <!-- 完工重量 -->
unfinish_weight = #unfinishWeight#, <!-- 未完工重量 -->
account_code = #accountCode#, <!-- 帐套 -->
created_by = #createdBy#, <!-- 创建人 -->
created_name = #createdName#, <!-- 创建人名称 -->
created_time = #createdTime#, <!-- 创建时间 -->
updated_by = #updatedBy#, <!-- 更新人 -->
updated_name = #updatedName#, <!-- 修改人名称 -->
updated_time = #updatedTime#, <!-- 更新时间 -->
spec = #spec#,
length = #length#
WHERE
id = #id#
mat_id = #matId#, <!-- 物料清单ID -->
order_id = #orderId#, <!-- 生产计划ID -->
order_detail_id = #orderDetailId#, <!-- 生产计划明细ID -->
tech_flow_id = #techFlowId#, <!-- 工艺流程ID -->
tech_flow_name = #techFlowName#, <!-- 工艺流程名称 -->
invent_process_id = #inventProcessId#, <!-- 存货工序ID,对应HGPZ005A.id -->
process_code = #processCode#, <!-- 工序编码 -->
process_name = #processName#, <!-- 工序名称 -->
process_order = #processOrder#, <!-- 加工顺序 -->
company_code = #companyCode#, <!-- 公司编码 -->
company_name = #companyName#, <!-- 公司名称 -->
dep_code = #depCode#, <!-- 部门编码 -->
dep_name = #depName#, <!-- 部门名称 -->
proj_code = #projCode#, <!-- 项目编码 -->
proj_name = #projName#, <!-- 项目名称 -->
task_code = #taskCode#, <!-- 任务编码 -->
product_type = #productType#, <!-- 产品类型 -->
product_code = #productCode#, <!-- 产品编号 -->
product_name = #productName#, <!-- 产品名称 -->
plan_start_date = #planStartDate#, <!-- 计划开始日期 -->
plan_end_date = #planEndDate#, <!-- 计划结束日期 -->
factory_code = #factoryCode#, <!-- 工厂编号 -->
factory_name = #factoryName#, <!-- 工厂名称 -->
group_code = #groupCode#, <!-- 工作组编号 -->
group_name = #groupName#, <!-- 工作组名称 -->
complete_date = #completeDate#, <!-- 完工日期 -->
quantity = #quantity#, <!-- 数量 -->
finish_quantity = #finishQuantity#, <!-- 完工数量 -->
unfinish_quantity = #unfinishQuantity#, <!-- 未完工数量 -->
single_weight = #singleWeight#, <!-- 单重 -->
total_weight = #totalWeight#, <!-- 总重 -->
finish_weight = #finishWeight#, <!-- 完工重量 -->
unfinish_weight = #unfinishWeight#, <!-- 未完工重量 -->
updated_by = #updatedBy#, <!-- 更新人 -->
updated_name = #updatedName#, <!-- 修改人名称 -->
updated_time = #updatedTime#, <!-- 更新时间 -->
spec = #spec#,
length = #length#
WHERE id = #id#
</update>
<!-- 行锁 -->
......@@ -641,10 +633,10 @@
SET CREATED_TIME = CREATED_TIME
WHERE 1=1
<isNotEmpty prepend=" AND " property="id">
id = #id#
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="ids">
id IN <iterate close=")" open="(" conjunction="," property="ids">#ids[]#</iterate>
ID IN <iterate close=")" open="(" conjunction="," property="ids">#ids[]#</iterate>
</isNotEmpty>
</update>
......
package com.baosight.hggp.hg.sc.util;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.enums.OrgTypeEnum;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.xs.domain.Org;
import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.xservices.xs.util.LoginUserDetails;
import org.apache.commons.collections.CollectionUtils;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
......@@ -31,26 +35,12 @@ public class HgScUtils {
if (LoginUserDetails.isUserAdmin(UserSessionUtils.getLoginName())) {
return;
}
// 查询自己所在组的任务 added by songx at 20240820
// 查询自己所在组的任务 added by songx at 20240820
List<String> allGroupNames = UserSessionUtils.getAllGroupName();
if (CollectionUtils.isNotEmpty(allGroupNames)) {
queryMap.put("groupNames", allGroupNames);
return;
}
// 如果没有组,则查看所在厂区的任务
List<String> factoryNames = UserSessionUtils.getFactoryName();
if (CollectionUtils.isNotEmpty(factoryNames)) {
queryMap.put("factoryNames", factoryNames);
return;
}
// 如果没有厂区,则查看所在公司的任务
List<String> companyCodes = UserSessionUtils.getCompanyCode();
if (CollectionUtils.isNotEmpty(companyCodes)) {
queryMap.put("companyCodes", companyCodes);
return;
queryMap.put("enableRoleAuth", CommonConstant.YesNo.NO_0);
}
// 当用户无组织机构时,抛出异常
throw new PlatException("当前用户未绑定组织机构,无法操作数据,请联系管理员!");
}
}
......
......@@ -6,14 +6,24 @@
<isNotEmpty prepend=" AND " property="accountCode">
ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<!-- 0:不启用角色权限,1或者空:启用-->
<isNotEqual property="enableRoleAuth" compareValue="0">
<include refid="HGXSDataAuth.roleAuthCondition"/>
</isNotEqual>
</sql>
<sql id="roleAuthCondition">
<!-- 无权限时使用 -->
<isNotEmpty prepend=" AND " property="authDepCode">
DEP_CODE = #authDepCode#
</isNotEmpty>
<!-- 仅本人和部门组合 -->
<isEqual prepend=" AND " property="authCombination" compareValue="1">
(CREATED_BY = #authOnlyPeople# OR DEP_CODE IN <iterate close=")" open="(" conjunction=","
property="authDepCodes">#authDepCodes[]#</iterate>)
<isEqual prepend=" AND " property="authCombination" compareValue="1" open="(" close=")">
CREATED_BY = #authOnlyPeople#
OR DEP_CODE IN
<iterate close=")" open="(" conjunction="," property="authDepCodes">
#authDepCodes[]#
</iterate>
</isEqual>
<!-- 仅本人或部门 -->
<isNotEqual prepend=" AND " property="authCombination" compareValue="1">
......@@ -22,7 +32,9 @@
</isNotEmpty>
<isNotEmpty property="authDepCodes">
DEP_CODE IN
<iterate close=")" open="(" conjunction="," property="authDepCodes">#authDepCodes[]#</iterate>
<iterate close=")" open="(" conjunction="," property="authDepCodes">
#authDepCodes[]#
</iterate>
</isNotEmpty>
</isNotEqual>
</sql>
......
......@@ -4,11 +4,14 @@ import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.hg.cg.constant.HgCgSqlConst;
import com.baosight.hggp.hg.cg.domain.HGCG003;
import com.baosight.hggp.hg.cg.domain.HGCG003B;
import com.baosight.hggp.hg.cg.domain.HGCG003B1;
import com.baosight.hggp.hg.cg.tools.HGCGTools;
import com.baosight.hggp.hg.cg.utils.HGCGUtils;
import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.constant.HGSqlConstant;
import com.baosight.hggp.hg.zl.domain.HGZL001;
import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.BeanUtils;
......@@ -49,7 +52,7 @@ public class ServiceHGZL001B extends ServiceEPBase {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.SUP_RECORD_BLOCK_ID));
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_RECORD_BLOCK_ID));
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.SPEC_NAME_BLOCK_ID));
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGCG003().eiMetadata);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGCG003B1().eiMetadata);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
......@@ -67,9 +70,9 @@ public class ServiceHGZL001B extends ServiceEPBase {
public EiInfo query(EiInfo inInfo) {
try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
queryMap.put(HGCG003B.FIELD_SOURCE, HGConstant.CgSource.DEFAULT);
queryMap.put(HGCG003.FIELD_SOURCE, HGConstant.CgSource.DEFAULT);
queryMap.put(HGCG003B.FIELD_STATUS, HGConstant.CgReceiveStatus.S_0);
inInfo = super.query(inInfo, HGCG003B.QUERY_BY_QUALITY_TESTING, new HGCG003B());
inInfo = super.query(inInfo, HgCgSqlConst.HgCg003A.QUERY_BY_QUALITY_TESTING, new HGCG003B1());
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
......
......@@ -75,6 +75,10 @@
sumType="page"/>
<EF:EFColumn ename="amount" cname="金额" enable="false" width="120" align="right" format="{0:C3}"
sumType="page"/>
<EF:EFColumn ename="taxAmount" cname="税额" enable="false" width="120" align="right" format="{0:C3}"
sumType="page"/>
<EF:EFColumn ename="taxIncludeAmount" cname="含税金额" enable="false" width="120" align="right" format="{0:C3}"
sumType="page"/>
<EF:EFColumn ename="createdName" cname="创建人" enable="false" width="100" align="center"/>
<EF:EFColumn ename="createdTime" cname="创建时间" enable="false" width="140" align="center"
editType="datetime" parseFormats="['yyyyMMddHHmmss']"/>
......
......@@ -56,8 +56,15 @@
<EF:EFCodeOption codeName="hggp.cg.calculationMethod"/>
</EF:EFComboColumn>
<EF:EFColumn ename="price" cname="单价" width="120" align="right" format="{0:C3}" required="true"/>
<EF:EFComboColumn ename="taxRate" cname="税率(%)" width="100" align="center" required="true" copy="true">
<EF:EFCodeOption codeName="hggp.cw.taxPoints"/>
</EF:EFComboColumn>
<EF:EFColumn ename="amount" cname="金额" enable="false" width="120" align="right" format="{0:C3}"
sumType="page"/>
<EF:EFColumn ename="taxAmount" cname="税额" enable="false" width="120" align="right" format="{0:C3}"
sumType="page"/>
<EF:EFColumn ename="taxIncludeAmount" cname="含税金额" enable="false" width="120" align="right" format="{0:C3}"
sumType="page"/>
<EF:EFComboColumn ename="status" cname="状态" enable="false" width="80" align="center">
<EF:EFCodeOption codeName="hggp.hgcg.receiveStatus"/>
</EF:EFComboColumn>
......@@ -67,7 +74,7 @@
<EF:EFColumn ename="companyCode" cname="公司编码" enable="false" width="100" align="center" hidden="true"/>
<EF:EFColumn ename="companyName" cname="公司名称" enable="false" width="130" align="center" hidden="true"/>
<EF:EFColumn ename="receiveDate" cname="收货日期" enable="false" width="100" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" hidden="true"/>
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" hidden="true"/>
<EF:EFColumn ename="receiveNo" cname="收货单号" enable="false" width="120" align="center" hidden="true"/>
<EF:EFColumn ename="primaryId" cname="主表id" enable="false" width="100" align="center" hidden="true"/>
</EF:EFGrid>
......
let whNameGlobalData = [];
$(function () {
IPLATUI.EFGrid.result = {
......@@ -7,8 +7,7 @@ $(function () {
pageSize: 20,
pageSizes: [10, 20, 30, 50, 100, 200],
},
columns: [
{
columns: [{
field: "operator",
title: "操作",
template: function (item) {
......@@ -146,27 +145,17 @@ function updateSubmitStatus(id) {
JSUtils.confirm("确定提交此生产入库单吗? ", {
ok: function () {
EiCommunicator.send('HGKC003', 'updateSubmitStatus', inEiInfo, {
onSuccess: function (ei) {
if (ei.getStatus() >= 0) {
try {
query();
} catch (e) {
}
if (ei.getStatus() == 0) {
NotificationUtil(ei, 'warning');
} else {
NotificationUtil(ei);
}
} else {
NotificationUtil(ei, "error");
}
},
onFail: function (ei) {
// 发生异常
NotificationUtil("操作失败,原因[" + ei + "]", "error");
onSuccess: function (res) {
message(res.msg);
if (res.status > -1) {
query();
}
},
onFail: function (ei) {
// 发生异常
NotificationUtil("操作失败,原因[" + ei + "]", "error");
}
);
});
}
});
......
......@@ -10,7 +10,7 @@
<div class="row">
<EF:EFInput ename="inqu_status-0-companyName" cname="公司名称" colWidth="3"/>
<EF:EFDatePicker cname="单据日期" blockId="inqu_status" ename="depositDate" row="0" colWidth="3"
role="date" format="yyyy-MM-dd" readonly="true"/>
role="date" format="yyyy-MM-dd" readonly="true"/>
<EF:EFInput ename="inqu_status-0-projName" cname="项目名称" colWidth="3"/>
<EF:EFInput ename="inqu_status-0-depositNo" cname="生产入库单号" colWidth="3"/>
</div>
......@@ -19,24 +19,26 @@
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row">
<EF:EFRegion id="result" title="明细信息" fitHeight="true">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row" height="69vh">
<EF:EFColumn ename="id" cname="内码" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" width="140" enable="false" readonly="false"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" width="80" enable="false" align="center"/>
<EF:EFColumn ename="qualityId" cname="质检单id" enable="false" width="90" align="center" hidden="true"/>
<EF:EFColumn ename="rectificationId" cname="整改通知单ID" enable="false" width="90" align="center" hidden="true"/>
<EF:EFComboColumn cname="入库类型" ename="storageType" width="90" align="center" required="false" enable="false" readonly="false" >
<EF:EFCodeOption codeName="hggp.kc.storageType" />
<EF:EFColumn ename="rectificationId" cname="整改通知单ID" enable="false" width="90" align="center"
hidden="true"/>
<EF:EFComboColumn cname="入库类型" ename="storageType" width="90" align="center" required="false" enable="false"
readonly="false">
<EF:EFCodeOption codeName="hggp.kc.storageType"/>
</EF:EFComboColumn>
<EF:EFColumn ename="companyName" cname="公司名称" enable="false" width="140" align="center"/>
<EF:EFColumn ename="companyName" cname="公司名称" enable="false" width="200" align="left"/>
<EF:EFColumn ename="projCode" cname="项目编号" enable="false" width="140" align="center"/>
<EF:EFColumn ename="projName" cname="项目名称" enable="false" width="140" align="center"/>
<EF:EFColumn ename="projName" cname="项目名称" enable="false" width="140" align="left"/>
<EF:EFColumn ename="whCode" cname="仓库名称" width="120" align="center" required="true"/>
<EF:EFColumn ename="whName" cname="仓库名称" hidden="true"/>
<EF:EFColumn ename="depositDate" cname="单据日期" enable="false" width="100" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']"/>
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']"/>
<EF:EFColumn ename="depositNo" cname="生产入库单号" enable="false" width="120" align="center"/>
<EF:EFColumn ename="depositNoOld" cname="历史生产入库单号" enable="false" width="120" align="center"/>
<EF:EFColumn ename="depositNoOld" cname="历史生产入库单号" enable="false" width="140" align="center"/>
<EF:EFComboColumn ename="prdtType" cname="存货类型" width="120" align="center" required="false"
blockName="invent_type_box_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#" readonly="false"
......
......@@ -48,9 +48,11 @@
<EF:EFColumn ename="inventName" cname="存货名称" enable="false" width="100" align="center"/>
<EF:EFColumn ename="specId" cname="规格ID" enable="false" width="100" align="center" hidden="true"/>
<EF:EFColumn ename="spec" cname="规格" enable="false" width="120" align="center"/>
<EF:EFColumn ename="invQty" cname="库存数量" enable="false" width="120" align="right" format="{0:N3}"/>
<EF:EFColumn ename="invQty" cname="库存数量" enable="false" width="120" align="right" format="{0:N3}"
sumType="page"/>
<EF:EFColumn ename="invUnitWeight" cname="单重(KG)" enable="false" width="120" align="right" format="{0:N3}"/>
<EF:EFColumn ename="invWeight" cname="库存总重(KG)" enable="false" width="120" align="right" format="{0:N3}"/>
<EF:EFColumn ename="invWeight" cname="库存总重(KG)" enable="false" width="120" align="right" format="{0:N3}"
sumType="page"/>
<EF:EFColumn ename="material" cname="材质" enable="false" width="80" align="center"/>
<EF:EFColumn ename="unit" cname="单位" enable="false" width="80" align="center"/>
<EF:EFColumn ename="createdName" cname="创建人" enable="false" width="100" align="center"/>
......
......@@ -37,37 +37,32 @@ $(window).load(function () {
query();
});
/**
* 排产
*/
function schedule() {
var planCode = $("#inqu_status-0-planCode").val();
var isSchedule = $("#inqu_status-0-isSchedule").val();
if(isSchedule&&isSchedule==='1'){
message("当前计划已排产,请手动调整计划!");
return;
}else {
var inInfo = new EiInfo();
inInfo.set("inqu_status-0-planCode", planCode);
IPLAT.confirm({
title: '提交',
message: '自动排产将覆盖原排产数据,且只能执行一次,请谨慎操作,确认对当前数据进行排产?',
okFn: function () {
var inInfo = new EiInfo();
inInfo.set("inqu_status-0-planCode", planCode);
EiCommunicator.send("HGSC005A", "schedule", inInfo, {
onSuccess: function (ei) {
if (ei.getStatus() >= 0) {
$("#inqu_status-0-isSchedule").val('1');
NotificationUtil(ei);
resultGrid.dataSource.query();
} else {
NotificationUtil(ei, "error");
}
},
onFail: function (ei) {
// 发生异常
NotificationUtil("操作失败,原因[" + ei + "]", "error");
}
});
}
});
}
var planCode = $("#inqu_status-0-planCode").val();
IPLAT.confirm({
title: '提交',
message: '自动排产将覆盖原排产数据,请谨慎操作,确认对当前数据进行排产?',
okFn: function () {
var inInfo = new EiInfo();
inInfo.set("inqu_status-0-planCode", planCode);
EiCommunicator.send("HGSC005A", "schedule", inInfo, {
onSuccess: function (ei) {
if (ei.getStatus() >= 0) {
$("#inqu_status-0-isSchedule").val('1');
NotificationUtil(ei);
resultGrid.dataSource.query();
} else {
NotificationUtil(ei, "error");
}
},
onFail: function (ei) {
// 发生异常
NotificationUtil("操作失败,原因[" + ei + "]", "error");
}
});
}
});
}
......@@ -32,24 +32,29 @@
</EF:EFRegion>
<EF:EFRegion id="result" title="记录集">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="companyName" cname="公司名称" enable="true" width="120" align="center" readOnly="true"/>
<EF:EFColumn ename="projName" cname="项目名称" width="120" enable="true" align="center" readOnly="true"/>
<EF:EFColumn ename="productCode" cname="产品编码" width="120" enable="true" align="center" readOnly="true"/>
<EF:EFColumn ename="productName" cname="产品名称" width="120" enable="true" align="center" readOnly="true"/>
<EF:EFColumn ename="processName" cname="工序" width="120" enable="true" align="center" readOnly="true"/>
<EF:EFColumn ename="finishDate" cname="交货日期" width="120" enable="true" align="center" readOnly="true"/>
<EF:EFColumn ename="planStartDate" cname="计划开工日期" width="120" enable="true" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyy-MM-dd']" required="true"/>
<EF:EFColumn ename="planEndDate" cname="计划完工日期" width="120" enable="true" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyy-MM-dd']" required="true"/>
<EF:EFColumn ename="singleWeight" cname="单重(KG)" format="{0:0.00}" editType="text" width="120" enable="true" align="center" readOnly="true"/>
<EF:EFColumn ename="totalWeight" cname="计划重量(KG)" format="{0:0.00}" editType="text" width="120" enable="true" align="center" readOnly="true"/>
<EF:EFColumn ename="finishWeight" cname="完成重量(KG)" format="{0:0.00}" editType="text" width="120" enable="true" align="center" readOnly="true"/>
<EF:EFColumn ename="unfinishWeight" cname="未完成重量(KG)" format="{0:0.00}" editType="text" width="120" enable="true" align="center" readOnly="true"/>
<EF:EFColumn ename="quantity" cname="计划数量" width="120" enable="true" align="center" readOnly="true"/>
<EF:EFColumn ename="finishQuantity" cname="完成数量" width="120" enable="true" align="center" readOnly="true"/>
<EF:EFColumn ename="unfinishQuantity" cname="未完成数量" width="120" enable="true" align="center" readOnly="true"/>
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="companyName" cname="公司名称" enable="false" width="120" align="center" readonly="true"/>
<EF:EFColumn ename="projName" cname="项目名称" enable="false" width="120" align="center" readonly="true"/>
<EF:EFColumn ename="productCode" cname="产品编码" enable="false" width="120" align="center" readonly="true"/>
<EF:EFColumn ename="productName" cname="产品名称" width="120" enable="true" align="center" readonly="true"/>
<EF:EFColumn ename="processName" cname="工序" width="120" enable="true" align="center" readonly="true"/>
<EF:EFColumn ename="finishDate" cname="交货日期" width="120" enable="true" align="center" readonly="true"/>
<EF:EFColumn ename="planStartDate" cname="计划开工日期" width="120" enable="true" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyy-MM-dd']" required="true"/>
<EF:EFColumn ename="planEndDate" cname="计划完工日期" width="120" enable="true" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyy-MM-dd']" required="true"/>
<EF:EFColumn ename="singleWeight" cname="单重(KG)" format="{0:0.00}" editType="text" width="120" enable="true"
align="center" readonly="true"/>
<EF:EFColumn ename="totalWeight" cname="计划重量(KG)" format="{0:0.00}" editType="text" width="120"
enable="true" align="center" readonly="true"/>
<EF:EFColumn ename="finishWeight" cname="完成重量(KG)" format="{0:0.00}" editType="text" width="120"
enable="true" align="center" readonly="true"/>
<EF:EFColumn ename="unfinishWeight" cname="未完成重量(KG)" format="{0:0.00}" editType="text" width="120"
enable="true" align="center" readonly="true"/>
<EF:EFColumn ename="quantity" cname="计划数量" width="120" enable="true" align="center" readonly="true"/>
<EF:EFColumn ename="finishQuantity" cname="完成数量" width="120" enable="true" align="center" readonly="true"/>
<EF:EFColumn ename="unfinishQuantity" cname="未完成数量" width="120" enable="true" align="center"
readonly="true"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
......@@ -10,11 +10,16 @@
<EF:EFInput cname="文件ID" ename="fileId" blockId="inqu_status" row="0" colWidth="3" type="hidden"/>
<EF:EFInput cname="附件ID" ename="docId" blockId="inqu_status" row="0" colWidth="3" type="hidden"/>
<div class="row">
<EF:EFInput cname="公司名称" ename="projName" blockId="inqu_status" row="0" colWidth="3" readonly="true"/>
<EF:EFInput cname="项目名称" ename="projName" blockId="inqu_status" row="0" colWidth="3" readonly="true"/>
<EF:EFInput cname="文件名称" ename="fileName" blockId="inqu_status" row="0" colWidth="3" readonly="true"/>
<EF:EFSelect cname="文件类型" ename="fileType" blockId="inqu_status" row="0" colWidth="3" optionLabel=""
defultValue="" readonly="true">
<EF:EFInput cname="公司名称" ename="companyName" blockId="inqu_status" row="0" colWidth="6" ratio="2:10"
readonly="true"/>
<EF:EFInput cname="项目名称" ename="projName" blockId="inqu_status" row="0" colWidth="6" ratio="2:10"
readonly="true"/>
</div>
<div class="row">
<EF:EFInput cname="文件名称" ename="fileName" blockId="inqu_status" row="0" colWidth="6" ratio="2:10"
readonly="true"/>
<EF:EFSelect cname="文件类型" ename="fileType" blockId="inqu_status" row="0" colWidth="6" ratio="2:10"
optionLabel="" defultValue="" readonly="true">
<EF:EFCodeOption codeName="hggp.hgwd.fileType"/>
</EF:EFSelect>
</div>
......
......@@ -10,11 +10,16 @@
<EF:EFInput cname="文件ID" ename="fileId" blockId="inqu_status" row="0" colWidth="3" type="hidden"/>
<EF:EFInput cname="附件ID" ename="docId" blockId="inqu_status" row="0" colWidth="3" type="hidden"/>
<div class="row">
<EF:EFInput cname="公司名称" ename="projName" blockId="inqu_status" row="0" colWidth="3" readonly="true"/>
<EF:EFInput cname="项目名称" ename="projName" blockId="inqu_status" row="0" colWidth="3" readonly="true"/>
<EF:EFInput cname="文件名称" ename="fileName" blockId="inqu_status" row="0" colWidth="3" readonly="true"/>
<EF:EFSelect cname="文件类型" ename="fileType" blockId="inqu_status" row="0" colWidth="3" optionLabel=""
defultValue="" readonly="true">
<EF:EFInput cname="公司名称" ename="companyName" blockId="inqu_status" row="0" colWidth="6" ratio="2:10"
readonly="true"/>
<EF:EFInput cname="项目名称" ename="projName" blockId="inqu_status" row="0" colWidth="6" ratio="2:10"
readonly="true"/>
</div>
<div class="row">
<EF:EFInput cname="文件名称" ename="fileName" blockId="inqu_status" row="0" colWidth="6" ratio="2:10"
readonly="true"/>
<EF:EFSelect cname="文件类型" ename="fileType" blockId="inqu_status" row="0" colWidth="6" ratio="2:10"
optionLabel="" defultValue="" readonly="true">
<EF:EFCodeOption codeName="hggp.hgwd.fileType"/>
</EF:EFSelect>
</div>
......
......@@ -180,14 +180,13 @@ $(function () {
}, {
field: "docVersion",
template: function (model) {
return "V" + model.docVersion;
return "v" + model.docVersion;
}
}, {
field: "docType",
title: "文件类型",
template: function (row) {
if (!isBlank(row.docType)){
return row.docType.substring(1).toUpperCase();
if (!isBlank(row.docType) && row.docType.startsWith(".")) {
return row.docType.substring(1);
}
return row.docType == null ? "" : row.docType;
}
......@@ -334,4 +333,4 @@ let showAuthButton = function () {
$("#PREVIEW").attr("disabled", true);
$("#DOWNLOAD").attr("disabled", true);
}
}
\ No newline at end of file
}
......@@ -11,8 +11,8 @@
<EF:EFRegion title="文档目录树" id="tree" fitHeight="true">
<div id="menu" style="margin-top: 12px; margin-bottom: 8px">
<EF:EFTree bindId="docTree" ename="tree_name" textField="text" valueField="label"
hasChildren="leaf" pid="parentId"
serviceName="HGWD001D" methodName="query">
hasChildren="leaf" pid="parentId" serviceName="HGWD001D" methodName="query"
expandLevel="1">
</EF:EFTree>
</div>
</EF:EFRegion>
......@@ -28,30 +28,35 @@
<EF:EFInput cname="层级" ename="leafLevel" blockId="inqu_status" row="0" type="hidden"/>
<EF:EFInput cname="文档库名称" ename="fileName" blockId="inqu_status" row="0" type="hidden"/>
<EF:EFInput cname="业务类型" ename="bizType" blockId="inqu_status" row="0" type="hidden" value="WD"/>
<EF:EFSelect blockId="inqu_status" row="0" ename="fileType" cname="文件类型" colWidth="3" filter="contains">
<EF:EFSelect blockId="inqu_status" row="0" ename="fileType" cname="文件分类" colWidth="3"
filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hggp.hgwd.fileType"/>
</EF:EFSelect>
<EF:EFInput cname="文件名称" ename="docName" blockId="inqu_status" row="0" colWidth="3" />
<EF:EFInput cname="文件名称" ename="docName" blockId="inqu_status" row="0" colWidth="3"/>
<EF:EFDatePicker blockId="inqu_status" row="0" ename="createdTime" cname="上传时间" role="date"
format="yyyy-MM-dd" parseFormats="['yyyyMMdd']" colWidth="3"/>
format="yyyy-MM-dd" parseFormats="['yyyyMMdd']" colWidth="3"/>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" queryMethod="query" sort="single">
<EF:EFGrid blockId="result" autoDraw="override" queryMethod="query" sort="setted">
<EF:EFColumn ename="id" cname="ID" hidden="true"/>
<EF:EFColumn ename="fileId" cname="ID" hidden="true"/>
<EF:EFColumn ename="docId" cname="文件ID" enable="false" width="180" sort="false"/>
<EF:EFColumn ename="docName" cname="文件名称" enable="false" width="150" sort="false"/>
<EF:EFColumn ename="docType" cname="文件类型" enable="false" width="150" align="center" sort="false"/>
<EF:EFColumn ename="docVersion" cname="版本号" enable="false" width="100" align="center" sort="true"/>
<EF:EFColumn ename="docId" cname="文件ID" enable="false" width="200" align="center" sort="false"
hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" enable="false" width="140" align="center" sort="false"/>
<EF:EFComboColumn ename="fileType" cname="文件分类" enable="false" width="90" align="center">
<EF:EFCodeOption codeName="hggp.hgwd.fileType"/>
</EF:EFComboColumn>
<EF:EFColumn ename="docName" cname="文件名称" enable="false" width="220" sort="true"/>
<EF:EFColumn ename="docType" cname="文件后缀" enable="false" width="110" align="center" sort="true"/>
<EF:EFColumn ename="docVersion" cname="版本号" enable="false" width="90" align="center" sort="true"/>
<EF:EFColumn ename="createdTime" cname="上传时间" parseFormats="['yyyyMMddHHmmss']" editType="datetime"
dateFormat="yyyy-MM-dd HH:mm:ss" align="center" width="140" readonly="true" required="false"
enable="false" sort="true"/>
dateFormat="yyyy-MM-dd HH:mm:ss" align="center" width="140" readonly="true"
required="false" enable="false" sort="true"/>
<EF:EFColumn ename="previewNum" cname="预览次数" enable="false" width="100" align="right" sort="true"/>
<EF:EFColumn ename="downloadNum" cname="下载次数" enable="false" width="100" align="right" sort="true"/>
<EF:EFColumn ename="operator" cname="操作" enable="false" width="200" align="center" sort="false"/>
</EF:EFGrid>
</EF:EFRegion>
</div>
......
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