Commit 1b2aa6eb by wuwenlong

Merge remote-tracking branch 'origin/dev' into dev

parents cf40cce3 4359b058
......@@ -341,7 +341,14 @@ public enum DdynamicEnum {
/**
*
*/
PROJECT_CODE_BOX_BLOCK_ID("projectCodeBox_block_id","projCode","projName","HGSC001.queryProjectCodeBox")
PROJECT_CODE_BOX_BLOCK_ID("projectCodeBox_block_id","projCode","projName","HGSC001.queryProjectCodeBox"),
/**
* 模块: 销售发货
* 用途: 发单号下拉框
* 编写: ly
*/
DELIVERY_CODE_BOX_BLOCK_ID("deliveryCodeBox_block_id","deliveryCode","projName","id","HGYX001.queryReturnCodeBox"),
;
......
......@@ -128,6 +128,8 @@ public class HGConstant {
public static final String PLAN_MATERIAL_CODE = "PLAN_MATERIAL_CODE";
// 销售发货单号
public static final String DELIVERY_CODE = "DELIVERY_CODE";
//销售退货单号
public static final String RETURN_CODE = "RETURN_CODE";
}
......@@ -327,6 +329,21 @@ public class HGConstant {
// 退库
public static final Integer TK = 2;
}
/**
*
* 生产入库单类型
* @author:jianghesong
* @date:2024/5/15,15:18
*/
public static class StorageType {
// 默认
public static final Integer DEFAULT = 0;
// 入库
public static final Integer RK = 1;
// 退回
public static final Integer TH = 2;
}
/**
* 文件类型*
......
......@@ -128,6 +128,7 @@ public class HGKC003 extends DaoEPBase {
public static final String DELETE = "HGKC003.delete";
public static final String UPDATE_SUBMIT_STATUS = "HGKC003.updateSubmitStatus";
public static final String MAX_ID = "HGKC003.maxId";
public static final String BATCH_DELETE = "HGKC003.batchDelete";
private Long id = new Long(0);
private Long qualityId = new Long(0); /* 质检单id*/
......@@ -156,14 +157,14 @@ public class HGKC003 extends DaoEPBase {
private String prodTaskNo = " "; /* 生产任务号*/
private String projCode = " "; /* 项目编码*/
private String projName = " "; /* 项目名称*/
private Integer prdtType; /* 产品类型*/
private String prdtType; /* 产品类型*/
private String prdtCode = " "; /* 产品编码*/
private String prdtName = " "; /* 产品名称*/
private BigDecimal prdtLength = new BigDecimal(0.000); /* 产品-长*/
private BigDecimal prdtWidth = new BigDecimal(0.000); /* 产品-宽*/
private BigDecimal prdtThick = new BigDecimal(0.000); /* 产品-厚*/
private String prdtSpec = " "; /* 产品规格*/
private Integer partType; /* 零件类型*/
private String partType; /* 零件类型*/
private String partCode = " "; /* 零件编码*/
private String partName = " "; /* 零件名称*/
private BigDecimal partLength = new BigDecimal(0.000); /* 零件-长*/
......@@ -176,7 +177,7 @@ public class HGKC003 extends DaoEPBase {
private BigDecimal partCoefficient = new BigDecimal(0.000); /* 零件-系数*/
private BigDecimal price = new BigDecimal("0"); /* 单价*/
private BigDecimal amount = new BigDecimal("0"); /* 金额*/
private Boolean storageType; /* 入库类型:0:入库 1:退回*/
private Integer storageType; /* 入库类型:0:入库 1:退回*/
/**
* initialize the metadata.
......@@ -843,7 +844,7 @@ public class HGKC003 extends DaoEPBase {
* get the prdtType - 产品类型.
* @return the prdtType
*/
public Integer getPrdtType() {
public String getPrdtType() {
return this.prdtType;
}
......@@ -852,7 +853,7 @@ public class HGKC003 extends DaoEPBase {
*
* @param prdtType - 产品类型
*/
public void setPrdtType(Integer prdtType) {
public void setPrdtType(String prdtType) {
this.prdtType = prdtType;
}
/**
......@@ -955,7 +956,7 @@ public class HGKC003 extends DaoEPBase {
* get the partType - 零件类型.
* @return the partType
*/
public Integer getPartType() {
public String getPartType() {
return this.partType;
}
......@@ -964,7 +965,7 @@ public class HGKC003 extends DaoEPBase {
*
* @param partType - 零件类型
*/
public void setPartType(Integer partType) {
public void setPartType(String partType) {
this.partType = partType;
}
/**
......@@ -1120,11 +1121,11 @@ public class HGKC003 extends DaoEPBase {
this.amount = amount;
}
public Boolean getStorageType() {
public Integer getStorageType() {
return storageType;
}
public void setStorageType(Boolean storageType) {
public void setStorageType(Integer storageType) {
this.storageType = storageType;
}
......@@ -1163,14 +1164,14 @@ public class HGKC003 extends DaoEPBase {
setProdTaskNo(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PROD_TASK_NO)), prodTaskNo));
setProjCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PROJ_CODE)), projCode));
setProjName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PROJ_NAME)), projName));
setPrdtType(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_PRDT_TYPE)), prdtType));
setPrdtType(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PRDT_TYPE)), prdtType));
setPrdtCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PRDT_CODE)), prdtCode));
setPrdtName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PRDT_NAME)), prdtName));
setPrdtLength(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_PRDT_LENGTH)), prdtLength));
setPrdtWidth(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_PRDT_WIDTH)), prdtWidth));
setPrdtThick(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_PRDT_THICK)), prdtThick));
setPrdtSpec(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PRDT_SPEC)), prdtSpec));
setPartType(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_PART_TYPE)), partType));
setPartType(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PART_TYPE)), partType));
setPartCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PART_CODE)), partCode));
setPartName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PART_NAME)), partName));
setPartLength(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_PART_LENGTH)), partLength));
......@@ -1183,7 +1184,7 @@ public class HGKC003 extends DaoEPBase {
setPartCoefficient(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_PART_COEFFICIENT)), partCoefficient));
setPrice(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_PRICE)), price));
setAmount(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_AMOUNT)), amount));
setStorageType(NumberUtils.toBoolean(StringUtils.toString(map.get(FIELD_STORAGE_TYPE)), storageType));
setStorageType(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_STORAGE_TYPE)), storageType));
}
/**
......
......@@ -6,7 +6,9 @@ import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.enums.DeleteFlagEnum;
import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.kc.domain.HGKC003;
import com.baosight.hggp.hg.kc.tools.HGKCTools;
import com.baosight.hggp.hg.kc.utils.HGKCUtils;
import com.baosight.hggp.hg.sc.tools.HGSCTools;
import com.baosight.hggp.util.*;
import com.baosight.iplat4j.core.ei.EiBlock;
import com.baosight.iplat4j.core.ei.EiConstant;
......@@ -17,8 +19,10 @@ import com.baosight.iplat4j.core.service.impl.ServiceBase;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* @author:songx
......@@ -36,9 +40,7 @@ public class ServiceHGKC003 extends ServiceBase {
@OperationLogAnnotation(operModul = "生产入库单", operType = "查询", operDesc = "初始化")
public EiInfo initLoad(EiInfo inInfo) {
try {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.WH_RECORD_BLOCK_ID));
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_RECORD_BLOCK_ID));
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.FACTORY_RECORD_BLOCK_ID));
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.WH_CODE_BLOCK_ID,DdynamicEnum.INVENT_TYPE_BOX_BLOCK_ID));
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGKC003().eiMetadata);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
......@@ -56,8 +58,7 @@ public class ServiceHGKC003 extends ServiceBase {
@OperationLogAnnotation(operModul = "生产入库单", operType = "查询", operDesc = "查询")
public EiInfo query(EiInfo inInfo) {
try {
// Map queryRow = EiInfoUtils.getFirstRow(inInfo);
// HGKCUtils.HgKc003.setCondition(queryRow);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.WH_CODE_BLOCK_ID,DdynamicEnum.INVENT_TYPE_BOX_BLOCK_ID));
inInfo = super.query(inInfo, HGKC003.QUERY, new HGKC003());
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
......@@ -66,6 +67,33 @@ public class ServiceHGKC003 extends ServiceBase {
}
/**
* 保存操作.
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "生产入库单", operType = "保存", operDesc = "保存")
public EiInfo update(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 写入数据
for (int i = 0; i < resultRows.size(); i++) {
HGKC003 hgkc003 = new HGKC003();
hgkc003.fromMap(resultRows.get(i));
// 数据校验
this.checkSubmitData(hgkc003);
DaoUtils.update(HGKC003.UPDATE, hgkc003);
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 删除操作
*
* @param inInfo
......@@ -75,14 +103,15 @@ public class ServiceHGKC003 extends ServiceBase {
public EiInfo delete(EiInfo inInfo) {
try {
List<HGKC003> fKc003s = MapUtils.toDaoEPBase(inInfo, HGKC003.class);
// 锁库存
Map<String, HGKC003> dbKc003Map = HGKCUtils.HgKc003.lockGetDataEp(fKc003s);
// 锁生产计划明细
// HPSCTools.HpSc004.lock(prodOrderNos);
// 校验数据
this.checkDeleteData(fKc003s, dbKc003Map);
// 查询数据
this.deleteData(fKc003s, dbKc003Map);
// 生产入库单ids
List<Long> ids = fKc003s.stream().map(HGKC003::getId).collect(Collectors.toList());
for(Long id : ids){
HGKC003 hgkc003 = HGKCTools.HgKc003.getId(id);
//修改计划生产任务完工数量
HGSCTools.hgkc003Delete(hgkc003.getQualityId(),hgkc003.getInvQty().negate().intValue(),hgkc003.getRectificationId());
DaoUtils.update(HGKC003.BATCH_DELETE, new HashMap<String,Object>(){{put("ids",ids);}});
}
inInfo.setMsg("删除成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "删除失败");
......@@ -91,16 +120,12 @@ public class ServiceHGKC003 extends ServiceBase {
}
/**
* @param fKc003s
* @param dbKc003Map
* @param fKc003
*/
private void checkDeleteData(List<HGKC003> fKc003s, Map<String, HGKC003> dbKc003Map) {
for (HGKC003 fKc003 : fKc003s) {
String depositNo = fKc003.getDepositNo();
HGKC003 dbKc003 = dbKc003Map.get(depositNo);
AssertUtils.isEquals(DeleteFlagEnum.REMOVE.getCode(), dbKc003.getDeleteFlag(),
String.format("入库单【%s】已删除,请勿重复操作", depositNo));
}
private void checkBackData(HGKC003 fKc003) {
AssertUtils.isEquals(DeleteFlagEnum.REMOVE.getCode(), fKc003.getDeleteFlag(),
String.format("入库单【%s】已删除,请勿重复操作", fKc003.getDepositNo()));
AssertUtils.isTrue(fKc003.getSubmitStatus().compareTo(HGConstant.ProductStatus.WTJ) == 0,"入库单"+fKc003.getDepositNo()+"未提交,请勿退回");
}
......@@ -117,7 +142,16 @@ public class ServiceHGKC003 extends ServiceBase {
for (i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
hgkc003.fromMap(map);
hgkc003 = HGKCTools.HgKc003.getId(hgkc003.getId());
// 校验数据
this.checkSubmitData(hgkc003);
DaoUtils.update(HGKC003.UPDATE_SUBMIT_STATUS, hgkc003);
// 修改库存
HGKCUtils.HgKc010.updateInv(hgkc003.getCompanyCode(), hgkc003.getWhCode(), hgkc003.getPartSpecId(),
hgkc003.getInvQty(), hgkc003.getInvWeight());
//修改计划生产任务完工数量
HGSCTools.complete(hgkc003.getQualityId(),hgkc003.getInvQty().intValue(),hgkc003.getRectificationId());
}
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsgByKey("ep.1000", new String[]{String.valueOf(i), I18nMessages.getText("label.update", "提交")});
......@@ -132,33 +166,62 @@ public class ServiceHGKC003 extends ServiceBase {
return inInfo;
}
private void checkSubmitData(HGKC003 hgkc003) {
AssertUtils.isEmpty(hgkc003.getWhCode(),"仓库编码不能为空!");
AssertUtils.isEmpty(hgkc003.getWhName(),"仓库名称不能为空!");
AssertUtils.isNull(hgkc003.getPrice(),"单价不能为空!");
}
/**
* 删除数据
* 退回操作
* @param inInfo
* @return
*/
public EiInfo sendBack(EiInfo inInfo){
int i = 0;
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());
// 校验数据
this.checkBackData(hgkc003);
// 退回数据
this.sendBackOption(hgkc003);
}
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsgByKey("ep.1000", new String[]{String.valueOf(i), I18nMessages.getText("label.update", "退回")});
} catch (PlatException e) {
e.printStackTrace();
inInfo.setStatus(EiConstant.STATUS_FAILURE);
ErrorCodeUtils.handleUpdateException(inInfo,i,e);
logError("修改失败", e.getMessage());
return inInfo;
}
return inInfo;
}
/**
* 退回数据
*
* @param fKc003s
* @param dbKc003Map
* @param fKc003
*/
private void deleteData(List<HGKC003> fKc003s, Map<String, HGKC003> dbKc003Map) {
for (HGKC003 fKc003 : fKc003s) {
fKc003.setDeleteFlag(DeleteFlagEnum.REMOVE.getCode());
DaoUtils.update(HGKC003.DELETE, fKc003);
private void sendBackOption(HGKC003 fKc003) {
// 生产一条负数量和产量的红冲记录
HGKC003 dbKc003 = dbKc003Map.get(fKc003.getDepositNo());
HGKC003 newKc003 = BeanUtils.copy(dbKc003, HGKC003.class);
newKc003.setInvQty(dbKc003.getInvQty().negate());
newKc003.setInvWeight(dbKc003.getInvWeight().negate());
newKc003.setDeleteFlag(DeleteFlagEnum.REMOVE.getCode());
HGKC003 newKc003 = BeanUtils.copy(fKc003, HGKC003.class);
newKc003.setInvQty(fKc003.getInvQty().negate());
newKc003.setInvWeight(fKc003.getInvWeight().negate());
newKc003.setDepositNoOld(fKc003.getDepositNo());
newKc003.setDepositNo(SequenceGenerator.getNextSequence(HGConstant.SequenceId.PROD_DEPOSIT_NO));
fKc003.setStorageType(HGConstant.StorageType.TH);
DaoUtils.insert(HGKC003.INSERT, newKc003);
// 同步生产计划
// HPSCTools.syncPlan(newKc003.getProdOrderNo(), newKc003.getAmount());
// 更新生产任务已完成数量
// HPSCTools.HpSc005a.updateCompleteNum(newKc003.getProdTaskNo(), newKc003.getAmount());
// 修改库存
HGKCUtils.HgKc011.updateInv(newKc003.getCompanyCode(), newKc003.getWhCode(), newKc003.getProdOrderNo(),
HGKCUtils.HgKc010.updateInv(newKc003.getCompanyCode(), newKc003.getWhCode(), newKc003.getPartSpecId(),
newKc003.getInvQty(), newKc003.getInvWeight());
}
//修改计划生产任务完工数量
HGSCTools.complete(fKc003.getQualityId(),newKc003.getInvQty().intValue(),fKc003.getRectificationId());
}
}
......@@ -200,7 +200,7 @@
AMOUNT as "amount", <!-- 金额 -->
STORAGE_TYPE as "storageType", <!-- 入库类型:0:入库 1:退回 -->
SUBMIT_STATUS as "submitStatus" <!-- 提交状态 -->
FROM ${hggpSchema}.HGKC003 WHERE 1=1
FROM ${hggpSchema}.HGKC003 WHERE 1=1 AND DELETE_FLAG = 0
<include refid="condition" />
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
......@@ -281,12 +281,11 @@
</insert>
<delete id="delete">
DELETE FROM ${hggpSchema}.HGKC003 WHERE
ID = #id#
UPDATE ${hggpSchema}.HGKC003 SET DELETE_FLAG = 1 WHERE ID = #id#
</delete>
<delete id="batchDelete">
DELETE FROM ${hggpSchema}.HGKC003 WHERE
UPDATE ${hggpSchema}.HGKC003 SET DELETE_FLAG = 1 WHERE
id IN <iterate close=")" open="(" conjunction="," property="ids">#ids[]#</iterate>
</delete>
......
......@@ -4,6 +4,7 @@ import cn.hutool.core.collection.CollectionUtil;
import com.baosight.hggp.common.CheckTypeEnum;
import com.baosight.hggp.core.dao.DaoBase;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.enums.DeleteFlagEnum;
import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.constant.HGSqlConstant;
import com.baosight.hggp.hg.kc.domain.*;
......@@ -12,6 +13,7 @@ import com.baosight.hggp.hg.pz.tools.HGPZTools;
import com.baosight.hggp.hg.zl.domain.HGZL002;
import com.baosight.hggp.hg.zl.domain.HGZL004;
import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.DateUtils;
import com.baosight.hggp.util.StringUtils;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import org.apache.commons.collections.CollectionUtils;
......@@ -133,6 +135,22 @@ public class HGKCTools {
*/
public static class HgKc003 {
/**
* 生产入库单信息
*
* @param id
* @return
*/
public static HGKC003 getId(Long id) {
AssertUtils.isEmpty(Collections.singleton(id), "生产入库单为空!");
Map<String, Object> paramMap = new HashMap();
paramMap.put("id", id);
paramMap.put("deleteFlag", 0);
List<HGKC003> list = DaoBase.getInstance().query(HGKC003.QUERY, paramMap);
AssertUtils.isEmpty(list, "生产入库单为空!");
return list.get(0);
}
public static HGKC003 save(HGKC003 hgkc003,List<HGKC003A> hgkc003aList){
checkSaveData(hgkc003,hgkc003aList);
......@@ -178,15 +196,16 @@ public class HGKCTools {
*/
public static void putInStorageData(List<HGZL002> hgzl002List) {
List<HGKC003> hgkc003List = new LinkedList<>();
setHgkc003Data(hgzl002List,hgkc003List, null);
setHgkc003Data(hgzl002List,hgkc003List, null, null);
DaoUtils.insertBatch(HGKC003.INSERT,hgkc003List);
}
/**
* 对象赋值(工序质检单)
* @param hgzl002List
* @param code
* @param hgzl004List
*/
private static void setHgkc003Data(List<HGZL002> hgzl002List, List<HGKC003> hgkc003List, Integer code) {
private static void setHgkc003Data(List<HGZL002> hgzl002List, List<HGKC003> hgkc003List, Integer code, List<HGZL004> hgzl004List) {
List<String> inventCodes = hgzl002List.stream().map(HGZL002::getProductCode).collect(Collectors.toList());
List<HGPZ005> hgpz005List = HGPZTools.HgPz005.listByInventCodes(inventCodes);
hgzl002List.forEach(o->{
......@@ -201,8 +220,10 @@ public class HGKCTools {
hgkc003.setAccountCode(o.getAccountCode());
hgkc003.setDepCode(o.getDepCode());
if(Objects.nonNull(code)){
HGZL004 hgzl004 = hgzl004List.stream().filter(h->h.getCheckId().equals(o.getId())).findAny().orElse(null);
//整改通知单
hgkc003.setInvQty(new BigDecimal(o.getUnpassQuantity()));
hgkc003.setRectificationId(hgzl004.getId());
}else{
//工序质检单
hgkc003.setInvQty(new BigDecimal(o.getPassQuantity()));
......@@ -217,13 +238,16 @@ public class HGKCTools {
hgkc003.setProjName(o.getProjName());
hgkc003.setPartCode(o.getProductCode());
hgkc003.setPartName(o.getProductName());
hgkc003.setPartType(o.getProductType());
hgkc003.setPartType(hgpz005.getInventType());
hgkc003.setPartSpecId(hgpz005.getId());
hgkc003.setPartSpec(hgpz005.getSpec());
hgkc003.setPartCoefficient(hgpz005.getCoefficient());
hgkc003.setPartLength(hgpz005.getLength());
hgkc003.setPartWidth(hgpz005.getWidth());
hgkc003.setPartThick(hgpz005.getThick());
hgkc003.setDepositDate(DateUtils.shortDate());
hgkc003.setStorageType(HGConstant.StorageType.RK);
hgkc003.setDeleteFlag(DeleteFlagEnum.UN_REMOVE.getCode());
hgkc003List.add(hgkc003);
}
});
......@@ -246,7 +270,7 @@ public class HGKCTools {
checkParamMap.put("ids", checkIds);
List<HGZL002> hgzl002List = DaoBase.getInstance().query(HGZL002.QUERY, checkParamMap);
//赋值
setHgkc003Data(hgzl002List,hgkc003List,CheckTypeEnum.PROCESS_CHECK.getCode());
setHgkc003Data(hgzl002List,hgkc003List,CheckTypeEnum.PROCESS_CHECK.getCode(),hgzl004List);
DaoUtils.insertBatch(HGKC003.INSERT,hgkc003List);
}
}
......
package com.baosight.hggp.hg.kc.utils;
import com.baosight.hggp.core.dao.DaoBase;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.enums.DeleteFlagEnum;
import com.baosight.hggp.hg.constant.HGSqlConstant;
......@@ -14,9 +15,12 @@ import com.baosight.hggp.util.DateUtils;
import com.baosight.hggp.util.MapUtils;
import com.baosight.hggp.util.ObjectUtils;
import com.baosight.hggp.util.StringUtils;
import org.apache.commons.collections.CollectionUtils;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
......@@ -165,6 +169,7 @@ public class HGKCUtils {
// db数据
return HGKCTools.HgKc003.map(depositNos);
}
}
public static class HgKc006 {
......
......@@ -2,10 +2,7 @@ package com.baosight.hggp.hg.sc.tools;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.lang.copier.SrcToDestCopier;
import com.baosight.hggp.common.AssignStatusEnum;
import com.baosight.hggp.common.CheckStatusEnum;
import com.baosight.hggp.common.ComputeTypeEnum;
import com.baosight.hggp.common.ProductTypeEnum;
import com.baosight.hggp.common.*;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoBase;
import com.baosight.hggp.core.dao.DaoUtils;
......@@ -132,8 +129,19 @@ public class HGSCTools {
}
public static void complete(Long checkId, Integer completeNum){
public static void complete(Long checkId, Integer completeNum, Long rectificationId){
HGZL002 hgzl002 = HGZLTools.THGZL002.get(checkId);
if(Objects.nonNull(rectificationId) && rectificationId.intValue() != 0){
//更新整改通知单状态,工序质检单与整改通知单是2条入库单数据
HGZL004 hgzl004 = HGZLTools.THGZL004.get(rectificationId);
hgzl004.setHandleStatus(HandleStatusEnum.UNPROCESS.getCode());
DaoUtils.update(HGZL004.UPDATE,hgzl004);
}else{
//整改通知单id为空的入库单才是工序质检单生成的入库单。
//更新工序质检单状态
hgzl002.setCheckStatus(CheckStatusEnum.CHECKING.getCode());
DaoUtils.update(HGZL002.UPDATE,hgzl002);
}
HGSC008 hgsc008 = THGSC008.getById(hgzl002.getWorkId());
HGSC007 hgsc007 = THGSC007.getById(hgsc008.getTaskId());
//更新生产任务完工数量
......@@ -160,6 +168,21 @@ public class HGSCTools {
DaoUtils.update(HGSC005A.UPDATE,hgsc005A);
}
public static void hgkc003Delete(Long checkId, Integer completeNum, Long rectificationId){
HGZL002 hgzl002 = HGZLTools.THGZL002.get(checkId);
if(Objects.nonNull(rectificationId) && rectificationId.intValue() != 0){
//更新整改通知单状态,工序质检单与整改通知单是2条入库单数据
HGZL004 hgzl004 = HGZLTools.THGZL004.get(rectificationId);
hgzl004.setHandleStatus(HandleStatusEnum.UNPROCESS.getCode());
DaoUtils.update(HGZL004.UPDATE,hgzl004);
}else{
//整改通知单id为空的入库单才是工序质检单生成的入库单。
//更新工序质检单状态
hgzl002.setCheckStatus(CheckStatusEnum.CHECKING.getCode());
DaoUtils.update(HGZL002.UPDATE,hgzl002);
}
}
public static class Hgsc001 {
public static HGSC001 queryByCode(String code) {
AssertUtils.isNull(code, "项目Code不能为空!");
......
......@@ -3,6 +3,8 @@ package com.baosight.hggp.hg.yx.domain;
import com.baosight.iplat4j.core.util.NumberUtils;
import com.baosight.iplat4j.core.ei.EiColumn;
import com.baosight.iplat4j.core.data.DaoEPBase;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.Map;
import com.baosight.iplat4j.core.util.StringUtils;
......@@ -119,8 +121,8 @@ public class HGYX001 extends DaoEPBase {
private String receUserPhone = " "; /* 收货人电话*/
private Integer tranType = 0; /* 运输方式*/
private String numPlate = " "; /* 车号*/
private String consQuantity = " "; /* 发货数量*/
private String consWeight = " "; /* 发货重量*/
private BigDecimal consQuantity = new BigDecimal("0"); /* 发货数量*/
private BigDecimal consWeight = new BigDecimal("0"); /* 发货重量*/
private Integer status = 0; /* 审批状态 0-未审核,1-已审核*/
/**
......@@ -239,10 +241,16 @@ public class HGYX001 extends DaoEPBase {
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CONS_QUANTITY);
eiColumn.setType("N");
eiColumn.setScaleLength(0);
eiColumn.setFieldLength(20);
eiColumn.setDescName("发货数量");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CONS_WEIGHT);
eiColumn.setType("N");
eiColumn.setScaleLength(3);
eiColumn.setFieldLength(17);
eiColumn.setDescName("发货重量");
eiMetadata.addMeta(eiColumn);
......@@ -696,7 +704,7 @@ public class HGYX001 extends DaoEPBase {
* get the consQuantity - 发货数量.
* @return the consQuantity
*/
public String getConsQuantity() {
public BigDecimal getConsQuantity() {
return this.consQuantity;
}
......@@ -705,14 +713,14 @@ public class HGYX001 extends DaoEPBase {
*
* @param consQuantity - 发货数量
*/
public void setConsQuantity(String consQuantity) {
public void setConsQuantity(BigDecimal consQuantity) {
this.consQuantity = consQuantity;
}
/**
* get the consWeight - 发货重量.
* @return the consWeight
*/
public String getConsWeight() {
public BigDecimal getConsWeight() {
return this.consWeight;
}
......@@ -721,7 +729,7 @@ public class HGYX001 extends DaoEPBase {
*
* @param consWeight - 发货重量
*/
public void setConsWeight(String consWeight) {
public void setConsWeight(BigDecimal consWeight) {
this.consWeight = consWeight;
}
/**
......@@ -775,8 +783,8 @@ public class HGYX001 extends DaoEPBase {
setReceUserPhone(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_RECE_USER_PHONE)), receUserPhone));
setTranType(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_TRAN_TYPE)), tranType));
setNumPlate(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_NUM_PLATE)), numPlate));
setConsQuantity(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CONS_QUANTITY)), consQuantity));
setConsWeight(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CONS_WEIGHT)), consWeight));
setConsQuantity(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_CONS_QUANTITY)), consQuantity));
setConsWeight(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_CONS_WEIGHT)), consWeight));
setStatus(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_STATUS)), status));
}
......
......@@ -136,8 +136,8 @@ public class ServiceHGYX001 extends ServiceEPBase {
* 新增操作
*/
public void add(HGYX001 hgyx001) {
//生成工序编码
hgyx001.setDeliveryCode(SequenceGenerator.getNextSequence(HGConstant.SequenceId.PLAN_CODE));
//销售发货单号
hgyx001.setDeliveryCode(SequenceGenerator.getNextSequence(HGConstant.SequenceId.DELIVERY_CODE));
DaoUtils.insert(HGYX001.INSERT, hgyx001);
}
......@@ -188,6 +188,7 @@ public class ServiceHGYX001 extends ServiceEPBase {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
//List<Long> ids = ObjectUtils.listKey(resultRows, HGSC001.FIELD_id);
for (Map resultRow:resultRows) {
//销售出库单号
String outboundCode = SequenceGenerator.getNextSequence(HGConstant.SequenceId.SALE_OUT_CODE);
HGYX001 hgyx001 = new HGYX001();
hgyx001.fromMap(resultRow);
......@@ -270,10 +271,10 @@ public class ServiceHGYX001 extends ServiceEPBase {
for (Map queryRow:queryBlock) {
HGYX001 hgyx001 = new HGYX001();
hgyx001.fromMap(queryRow);
if (hgyx001.getId() == null || hgyx001.getId() == 0) {
hgyx001.setStatus(1);
String outboundCode = SequenceGenerator.getNextSequence(HGConstant.SequenceId.SALE_OUT_CODE);
hgyx001.setOutboundCode(outboundCode);
hgyx001.setStatus(1);
if (hgyx001.getId() == null || hgyx001.getId() == 0) {
this.add(hgyx001);
HGKC004 hgkc004 = new HGKC004();
hgkc004.setParentId(hgyx001.getId());
......@@ -306,6 +307,13 @@ public class ServiceHGYX001 extends ServiceEPBase {
}
} else {
this.modify(hgyx001);
HGKC004 hgkc004 = new HGKC004();
hgkc004.setParentId(hgyx001.getId());
hgkc004.setReceiptDate(DateUtils.formatShort(DateUtils.date()));
hgkc004.setCompanyCode(hgyx001.getCompanyCode());
hgkc004.setWhCode(hgyx001.getConsWhCode());
hgkc004.setSaleOutCode(outboundCode);
DaoUtils.insert(HGKC004.INSERT, hgkc004);
for (Map resultRow : resultRows) {
HGYX001A hgyx001A = new HGYX001A();
hgyx001A.fromMap(resultRow);
......@@ -315,6 +323,20 @@ public class ServiceHGYX001 extends ServiceEPBase {
}else {
this.modifyDatail(hgyx001A);
}
HGKC004A hgkc004A = new HGKC004A();
hgkc004A.setInventType(hgyx001A.getInventType());
hgkc004A.setInventCode(hgyx001A.getInventCode());
hgkc004A.setInventName(hgyx001A.getInventName());
hgkc004A.setInventRecordId(hgyx001A.getInventRecordId());
hgkc004A.setSpec(hgyx001A.getSpec());
hgkc004A.setLength(hgyx001A.getLength());
hgkc004A.setThick(hgyx001A.getThick());
hgkc004A.setWidth(hgyx001A.getWidth());
hgkc004A.setQuantity(hgyx001A.getQuantity());
hgkc004A.setUnitWeight(hgyx001A.getUnitWeight());
hgkc004A.setWeight(hgyx001A.getWeight());
hgkc004A.setParentId(hgkc004.getId());
DaoUtils.insert(HGKC004A.INSERT, hgkc004A);
}
}
}
......
......@@ -36,6 +36,7 @@ public class ServiceHGYX001A extends ServiceEPBase {
@Override
public EiInfo initLoad(EiInfo inInfo) {
String id = inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGYX001A.FIELD_PARENT_ID);
String type = inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, "type");
EiInfo outInfo = super.initLoad(inInfo, new HGYX001A());
outInfo.getBlock(EiConstant.resultBlock).getRows().clear();
if (id != null) {
......@@ -45,6 +46,7 @@ public class ServiceHGYX001A extends ServiceEPBase {
outInfo.getBlock(EiConstant.queryBlock).setRows(Collections.singletonList(hgYx001));
}
outInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, "type", type);
UserVO userVO = HGCWTools.HgCw002.getUserCompany();
outInfo.getBlock(EiConstant.resultBlock).setBlockMeta(new HGYX001().eiMetadata);
CommonMethod.initBlock(outInfo,
......
package com.baosight.hggp.hg.yx.service;
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.cw.tools.HGCWTools;
import com.baosight.hggp.hg.cw.vo.UserVO;
import com.baosight.hggp.hg.kc.domain.HGKC013;
import com.baosight.hggp.hg.kc.domain.HGKC013A;
import com.baosight.hggp.hg.yx.domain.HGYX002;
import com.baosight.hggp.hg.yx.domain.HGYX002A;
import com.baosight.hggp.hg.yx.tools.HGYXTools;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.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.resource.I18nMessages;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
/**
* @author LiuYang
* @version 1.0 2024/6/7
*/
public class ServiceHGYX002A extends ServiceEPBase {
@Override
public EiInfo initLoad(EiInfo inInfo) {
String id = inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGYX002A.FIELD_PARENT_ID);
String type = inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, "type");
EiInfo outInfo = super.initLoad(inInfo, new HGYX002A());
outInfo.getBlock(EiConstant.resultBlock).getRows().clear();
if (id != null) {
HGYX002 hgyx002 = HGYXTools.Hgyx002.getId(Long.valueOf(id));
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGYX002.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
outInfo = super.query(inInfo, HGYX002A.QUERY, new HGYX002A());
outInfo.getBlock(EiConstant.queryBlock).setRows(Collections.singletonList(hgyx002));
}
outInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, "type", type);
UserVO userVO = HGCWTools.HgCw002.getUserCompany();
outInfo.getBlock(EiConstant.resultBlock).setBlockMeta(new HGYX002A().eiMetadata);
CommonMethod.initBlock(outInfo,
Arrays.asList(
DdynamicEnum.COMPANY_BOX_BLOCK_ID,
DdynamicEnum.WH_RECORD_BOX_BLOCK_ID,
DdynamicEnum.CUSTOMER_RECORD_ALL_BLOCK_ID));
CommonMethod.initBlock(outInfo,
Arrays.asList(
DdynamicEnum.PROJ_RECORD_BLOCK_ID,
DdynamicEnum.INVENT_TYPE_BOX_BLOCK_ID,
DdynamicEnum.INVENT_CODE_BOX_BLOCK_ID,
DdynamicEnum.SPEC_BOX_BLOCK_ID),
new HashMap<String,Object>(){{
put(HGKC013.FIELD_COMPANY_CODE,userVO.getUsercode());
put(HGKC013A.FIELD_DELETE_FLAG,CommonConstant.YesNo.NO_0);
}}, false);
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.DELIVERY_CODE_BOX_BLOCK_ID),
new HashMap<String,Object>(){{
put(HGKC013.FIELD_COMPANY_CODE,userVO.getUsercode());
put(HGKC013A.FIELD_DELETE_FLAG,CommonConstant.YesNo.NO_0);
}
},false);
outInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0,HGYX002.FIELD_COMPANY_CODE, userVO.getUsercode());
outInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0,HGYX002.FIELD_COMPANY_NAME, userVO.getUsername());
//outInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0,HGYX002.FIELD_CONS_CODE, userVO.getUsercode());
//outInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0,HGYX002.FIELD_CONS_NAME, userVO.getUsername());
return outInfo;
}
@Override
public EiInfo query(EiInfo inInfo) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGYX002.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
return super.query(inInfo,HGYX002A.QUERY,new HGYX002A());
}
@OperationLogAnnotation(operModul = "销售退货详情",operType = "删除",operDesc = "删除操作")
@Override
public EiInfo delete(EiInfo inInfo) {
int i = 0;
try {
String status = inInfo.getCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGYX002.FIELD_STATUS).toString();
if ("1".equals(status)) {
String str = "已审核,无法删除!";
throw new PlatException(str);
}
HGYX002A hgyx002A = new HGYX002A();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
for (i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
hgyx002A.fromMap(map);
hgyx002A.setDeleteFlag(CommonConstant.YesNo.YES_1);
DaoUtils.update(HGYX002A.DELETE_FLAG, hgyx002A);
}
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsgByKey("ep.1000", new String[]{String.valueOf(i), I18nMessages.getText("label.delete", "删除")});
} catch (PlatException e) {
LogUtils.setMsg(inInfo, e,"删除失败");
}
return inInfo;
}
}
package com.baosight.hggp.hg.yx.service;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.hg.cw.tools.HGCWTools;
import com.baosight.hggp.hg.cw.vo.UserVO;
import com.baosight.hggp.hg.kc.domain.HGKC013;
import com.baosight.hggp.hg.kc.domain.HGKC013A;
import com.baosight.hggp.hg.yx.domain.HGYX002;
import com.baosight.hggp.hg.yx.domain.HGYX002A;
import com.baosight.hggp.hg.yx.tools.HGYXTools;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.StringUtils;
import com.baosight.hggp.util.contants.ACConstants;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
/**
* @author LiuYang
* @version 1.0 2024/6/7
*/
public class ServiceHGYX002B extends ServiceEPBase {
@Override
public EiInfo initLoad(EiInfo inInfo) {
String id = inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGYX002A.FIELD_PARENT_ID);
EiInfo outInfo = super.initLoad(inInfo, new HGYX002A());
outInfo.getBlock(EiConstant.resultBlock).getRows().clear();
if (id != null) {
HGYX002 hgyx002 = HGYXTools.Hgyx002.getId(Long.valueOf(id));
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGYX002.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
outInfo = super.query(inInfo, HGYX002A.QUERY, new HGYX002A());
outInfo.getBlock(EiConstant.queryBlock).setRows(Collections.singletonList(hgyx002));
}
UserVO userVO = HGCWTools.HgCw002.getUserCompany();
outInfo.getBlock(EiConstant.resultBlock).setBlockMeta(new HGYX002A().eiMetadata);
CommonMethod.initBlock(outInfo,
Arrays.asList(
DdynamicEnum.COMPANY_BOX_BLOCK_ID,
DdynamicEnum.WH_RECORD_BOX_BLOCK_ID,
DdynamicEnum.CUSTOMER_RECORD_ALL_BLOCK_ID));
CommonMethod.initBlock(outInfo,
Arrays.asList(
DdynamicEnum.PROJ_RECORD_BLOCK_ID,
DdynamicEnum.INVENT_TYPE_BOX_BLOCK_ID,
DdynamicEnum.INVENT_CODE_BOX_BLOCK_ID,
DdynamicEnum.SPEC_BOX_BLOCK_ID),
new HashMap<String,Object>(){{
put(HGKC013.FIELD_COMPANY_CODE,userVO.getUsercode());
put(HGKC013A.FIELD_DELETE_FLAG,CommonConstant.YesNo.NO_0);
}}, false);
outInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0,HGYX002.FIELD_COMPANY_CODE, userVO.getUsercode());
outInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0,HGYX002.FIELD_COMPANY_NAME, userVO.getUsername());
outInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0,HGYX002.FIELD_CONS_CODE, userVO.getUsercode());
outInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0,HGYX002.FIELD_CONS_NAME, userVO.getUsername());
return outInfo;
}
@Override
public EiInfo query(EiInfo inInfo) {
String id = inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGYX002A.FIELD_ID);
inInfo.getBlock(EiConstant.queryBlock).getRows().clear();
if (StringUtils.isNotEmpty(id)) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGYX002A.FIELD_PARENT_ID, id);
}
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGYX002.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
return super.query(inInfo,HGYX002A.QUERY,new HGYX002A());
}
}
package com.baosight.hggp.hg.yx.service;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.hg.yx.domain.HGYX001;
import com.baosight.hggp.hg.yx.domain.HGYX001A;
import com.baosight.hggp.hg.yx.domain.HGYX001C;
import com.baosight.hggp.hg.yx.tools.HGYXTools;
import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.MapUtils;
import com.baosight.hggp.util.StringUtils;
import com.baosight.hggp.util.contants.ACConstants;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @author LiuYang
* @version 1.0 2024/6/7
*/
public class ServiceHGYX002C extends ServiceEPBase {
@Override
public EiInfo initLoad(EiInfo inInfo) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGYX001C.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
String ids = inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, "ids");
String parentId = inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGYX001A.FIELD_PARENT_ID);
if (StringUtils.isNotEmpty(ids)) {
String[] idArray = ids.split(",");
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, "ids", idArray);
}
if (StringUtils.isEmpty(parentId)){
Map params = new HashMap<>();
params.put(HGYX001.FIELD_DELIVERY_CODE, inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGYX001.FIELD_DELIVERY_CODE));
params.put(HGYX001.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
List<HGYX001> hgYx001s = HGYXTools.Hgyx001.list(params);
AssertUtils.isEmpty(hgYx001s, "未找到对应发货单号");
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGYX001.FIELD_DELIVERY_CODE, hgYx001s.get(0).getDeliveryCode());
}
inInfo = super.query(inInfo, HGYX001A.QUERY, new HGYX001A());
CommonMethod.initBlock(inInfo,
Arrays.asList(
DdynamicEnum.INVENT_TYPE_BLOCK_ID,
DdynamicEnum.INVENT_RECORD_BLOCK_ID,
DdynamicEnum.SPEC_NAME_BLOCK_ID));
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGYX001A().eiMetadata);
return inInfo;
}
@Override
public EiInfo query(EiInfo inInfo) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGYX001.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
return super.query(inInfo, HGYX001C.QUERY,new HGYX001C());
}
}
......@@ -379,4 +379,15 @@
ID = #id#
</update>
<select id="queryReturnCodeBox" parameterClass="java.util.HashMap" resultClass="java.util.HashMap">
SELECT DISTINCT
ID as "id",
PROJ_NAME as "projName", <!-- 项目名称 -->
DELIVERY_CODE as "deliveryCode" <!-- 发货单号 -->
FROM
${hggpSchema}.HGYX001
WHERE DELETE_FLAG = 0 AND STATUS = 1
<include refid="condition" />
</select>
</sqlMap>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://www.ibatis.com/dtd/sql-map-2.dtd">
<sqlMap namespace="HGYX002A">
<typeAlias alias="HGYX002A" type="com.baosight.hggp.hg.yx.domain.HGYX002A"/>
<sql id="column">
ID as "id", <!-- ID -->
ACCOUNT_CODE as "accountCode", <!-- 企业编码 -->
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-已删除 -->
INVENT_RECORD_ID as "inventRecordId", <!-- 存货档案id -->
INVENT_TYPE as "inventType", <!-- 存货类型 -->
INVENT_CODE as "inventCode", <!-- 存货编码 -->
INVENT_NAME as "inventName", <!-- 存货名称 -->
SPEC as "spec", <!-- 规格 -->
LENGTH as "length", <!-- 长 -->
WIDTH as "width", <!-- 宽 -->
THICK as "thick", <!-- 厚 -->
QUANTITY as "quantity", <!-- 发货数量 -->
UNIT_WEIGHT as "unitWeight", <!-- 单重 -->
WEIGHT as "weight", <!-- 发货重量 -->
'0' as "returnQuantity", <!-- 退货数量 -->
'0' as "returnWeight", <!-- 退货重量 -->
PARENT_ID as "parentId" <!-- 销售退货ID -->
</sql>
<sql id="condition">
<include refid="HGXSDataAuth.authCondition"/>
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="accountCode">
ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
CREATED_BY = #createdBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdName">
CREATED_NAME = #createdName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
CREATED_TIME = #createdTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy">
UPDATED_BY = #updatedBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedName">
UPDATED_NAME = #updatedName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime">
UPDATED_TIME = #updatedTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deleteFlag">
DELETE_FLAG = #deleteFlag#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventRecordId">
INVENT_RECORD_ID = #inventRecordId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventType">
INVENT_TYPE = #inventType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventCode">
INVENT_CODE = #inventCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventName">
INVENT_NAME = #inventName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="spec">
SPEC = #spec#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="length">
LENGTH = #length#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="width">
WIDTH = #width#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="thick">
THICK = #thick#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="quantity">
QUANTITY = #quantity#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="weight">
WEIGHT = #weight#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="parentId">
PARENT_ID = #parentId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventRecordIds">
INVENT_RECORD_ID NOT IN <iterate close=")" open="(" conjunction="," property="inventRecordIds">#inventRecordIds[]#</iterate>
</isNotEmpty>
<isNotEmpty prepend=" AND " property="ids">
ID IN <iterate close=")" open="(" conjunction="," property="ids">#ids[]#</iterate>
</isNotEmpty>
</sql>
<select id="query" parameterClass="java.util.HashMap" resultClass="HGYX001A">
SELECT
<include refid="column" />
FROM ${hggpSchema}.HGYX001A WHERE 1=1
<include refid="condition" />
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
CREATED_TIME desc, ID asc
</isEmpty>
</dynamic>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hggpSchema}.HGYX001A WHERE 1=1
<include refid="condition" />
</select>
</sqlMap>
\ No newline at end of file
......@@ -4,6 +4,8 @@ import com.baosight.hggp.core.dao.DaoBase;
import com.baosight.hggp.hg.sj.domain.HGSJ001;
import com.baosight.hggp.hg.yx.domain.HGYX001;
import com.baosight.hggp.hg.yx.domain.HGYX001A;
import com.baosight.hggp.hg.yx.domain.HGYX002;
import com.baosight.hggp.hg.yx.domain.HGYX002A;
import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.MapUtils;
import org.apache.commons.collections.CollectionUtils;
......@@ -56,4 +58,41 @@ public class HGYXTools {
return hgyx001As;
}
}
public static class Hgyx002 {
public static HGYX002 getId(Long id){
HGYX002 hgyx002 = new HGYX002();
AssertUtils.isNull(id, "销售退货ID不能为空!");
Object object = DaoBase.getInstance().get(HGYX002.QUERY,HGYX002.FIELD_ID, id);
AssertUtils.isNull(object, "销售退货不存在!");
hgyx002.fromMap(MapUtils.toMap(object));
return hgyx002;
}
public static List<HGYX002> list(Map params){
List<HGYX002> hgyx002s = DaoBase.getInstance().query(HGYX002.QUERY, params);
AssertUtils.isNull(hgyx002s, "销售退货不存在!");
return hgyx002s;
}
public static List<HGYX001> list(List<Long> ids){
AssertUtils.isNull(ids, "销售退货ID不能为空!");
Map params = new HashMap<>();
params.put("ids", ids);
List<HGYX001> hgyx001s = DaoBase.getInstance().query(HGYX001.QUERY, params);
AssertUtils.isEmpty(hgyx001s, "销售退货不存在!");
return hgyx001s;
}
public static List<HGYX002A> getParentId(Long parentId){
AssertUtils.isNull(parentId, "销售退货ID不能为空!");
Map params = new HashMap<>();
params.put("parentId", parentId);
List<HGYX002A> hgyx002As = DaoBase.getInstance().query(HGYX002A.QUERY, params);
AssertUtils.isEmpty(hgyx002As, "销售退货明细不存在!");
return hgyx002As;
}
}
}
......@@ -70,7 +70,6 @@ public class ServiceHGZL002 extends ServiceBase {
HGZLTools.THGZL004.addByHGZL002(o);
});
HGKCTools.HgKc003.putInStorageData(hgzl002List);
// putInStorage();
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + hgzl002List.size() + "]条数据保存成功!");
......
......@@ -75,5 +75,7 @@
<sqlMap resource="com/baosight/hggp/hg/yx/sql/HGYX001.xml"/>
<sqlMap resource="com/baosight/hggp/hg/yx/sql/HGYX001A.xml"/>
<sqlMap resource="com/baosight/hggp/hg/yx/sql/HGYX001C.xml"/>
<sqlMap resource="com/baosight/hggp/hg/yx/sql/HGYX002.xml"/>
<sqlMap resource="com/baosight/hggp/hg/yx/sql/HGYX002A.xml"/>
</sqlMapConfig>
let whNameGlobalData = [];
$(function () {
IPLATUI.EFGrid.result = {
......@@ -13,21 +15,66 @@ $(function () {
let status = item.submitStatus;
let template = '';
if (item.id){
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="showDetail(' + item.id +')" >详情</a>';
if (status == 0) {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="updateSubmitStatus(' + item.id + ',1)" >提交</a>';
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="sendBack(' + item.id + ')" >退回</a>';
}
}
return template;
}
},
{
field: "whCode",
filter: function (options) {
return _.filter(whNameGlobalData, function (item) {
return item["param1Field"]=="true";
})
},
template: function (dataItem) {
for (let i = 0; i < whNameGlobalData.length; i++) {
if (whNameGlobalData[i]['valueField'] === dataItem['whCode']) {
dataItem['whName'] = whNameGlobalData[i]['textField'];
return whNameGlobalData[i]['textField'];
}
}
return "";
},
editor: function (container, options) {
let inInfo = new EiInfo();
inInfo.set("inqu_status-0-whType", options.model["inventType"]);
inInfo.set("inqu_status-0-isSplicingSymbol", false);
inInfo.set("serviceName", "HGPZ007");
inInfo.set("methodName", "queryWhCodeBox");
inInfo.set("blockId", "wh_code_block_id");
inInfo.set("field", options.field);
refreshSelect(container, inInfo);
}
}
],
loadComplete: function (grid) {
// 此grid对象
grid.dataSource.bind("change", function(e) {
var item = e.items[0];
//仓库下拉框
if (e.field == "whCode") {
loadChange(grid,e,"price");
}
//金额计算
if (e.field == "price") {
if(item.price && item.invQty){
let totalAmount = item.price * item.invQty;
resultGrid.setCellValue(item, 'amount', totalAmount)
}
}
});
},
onSuccess: function (e) {
if(e.eiInfo.extAttr.methodName == 'delete' ){
if(e.eiInfo.extAttr.methodName == 'save'
||e.eiInfo.extAttr.methodName == 'delete' ){
query();
}
}
......@@ -36,9 +83,6 @@ $(function () {
// 查询
$("#QUERY").on("click", query);
// 选择生产任务
$("#SELECT_TASK").on("click", selectTask);
});
/**
......@@ -46,6 +90,8 @@ $(function () {
*/
$(window).load(function () {
query();
// 仓库名称
initWh();
});
/**
......@@ -56,28 +102,20 @@ let query = function () {
}
/**
* 选择生产任务
* 初始化仓库
*/
let selectTask = function () {
JSColorbox.open({
href: "HGKC003A?methodName=initLoad",
title: "<div style='text-align: center;'>生产任务查询</div>",
width: "80%",
height: "80%",
callbackName: selectTaskCallback
});
let initWh = function () {
let inInfo = new EiInfo();
EiCommunicator.send("HGPZ007", "queryWhCodeBox", inInfo, {
onSuccess: function (ei) {
whNameGlobalData = ei.getBlock("wh_code_block_id").getMappedRows();
},
onFail: function (ei) {
}
}, {async: false});
}
/**
* 挑选库存回调
*/
let selectTaskCallback = function () {
// 刷新页面
query();
// 关闭弹窗
JSColorbox.close();
}
/**
* 显示详情
*/
function showDetail(id) {
......@@ -111,3 +149,64 @@ function updateSubmitStatus(id,status) {
}
);
}
/**
* 保存
*/
let save = function () {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
let flag = true;
$.each(rows, function(index, item) {
let whCode= item.get("whCode");
let whName= item.get("whName");
let price= item.get("price");
if(isBlank(whCode)){
message("选中的第" + (index + 1) + "行\"仓库编码\",不能为空!");
flag = false;
return false;
}
if(isBlank(whName)){
message("选中的第" + (index + 1) + "行\"仓库名称\",不能为空!");
flag = false;
return false;
}
if(isBlank(price)){
message("选中的第" + (index + 1) + "行\"单价\",不能为空!");
flag = false;
return false;
}
});
if(flag) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGKC003", "save", true);
}
});
}
}
/**
* 提交
* @param id
* @param status
*/
function sendBack(id) {
let inEiInfo = new EiInfo();
inEiInfo.set("result-0-id", id);
EiCommunicator.send('HGKC003', 'sendBack', inEiInfo, {
onSuccess(response) {
NotificationUtil(response.msg);
query();
},
onFail(errorMessage, status, e) {
NotificationUtil("执行失败!", "error");
}
}, {
async: false
}
);
}
......@@ -20,16 +20,52 @@
</EF:EFRegion>
<EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row" readonly="true">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row">
<EF:EFColumn ename="id" cname="内码" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" width="140" enable="false" readonly="false"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" width="140" enable="false" readonly="false"/>
<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:EFColumn ename="partSpecId" cname="零件规格ID" enable="false" width="90" align="center" hidden="true"/>
<EF:EFColumn ename="companyName" cname="公司名称" enable="false" width="140" align="center"/>
<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="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']" required="true"/>
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']"/>
<EF:EFColumn ename="depositNo" cname="生产入库单号" enable="false" width="120" align="center"/>
<EF:EFColumn ename="whName" cname="仓库名称" enable="false" width="120" align="center"/>
<EF:EFColumn ename="depositNoOld" cname="历史生产入库单号" enable="false" width="120" align="center"/>
<EF:EFComboColumn ename="partType" cname="存货类型" width="120" align="center" required="false"
blockName="invent_type_box_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#" readonly="false"
filter="contains" enable="false">
</EF:EFComboColumn>
<EF:EFColumn ename="partCode" cname="零件编码" enable="false" width="120" align="center"/>
<EF:EFColumn ename="partName" cname="零件名称" enable="false" width="120" align="center"/>
<EF:EFColumn ename="partSpec" cname="零件规格" enable="false" width="150" align="center"/>
<EF:EFColumn ename="partLength" cname="长(MM)" enable="false" width="80" align="right" format="{0:N3}"/>
<EF:EFColumn ename="partWidth" cname="宽(MM)" enable="false" width="80" align="right" format="{0:N3}"/>
<EF:EFColumn ename="partThick" cname="厚(MM)" enable="false" width="80" align="right" format="{0:N3}"/>
<EF:EFColumn ename="partCoefficient" cname="系数" enable="false" width="80" align="right" format="{0:N3}"/>
<EF:EFColumn ename="invQty" cname="数量" width="120" align="right" format="{0:N0}"
defaultValue="0"
data-regex="/^-?[0-9]{1,17}([.][0-9]{1,3})?$/"
data-errorprompt="请输入数字,该值最大可设置17位整数和3位小数!"
required="false"
enable="false"/>
<EF:EFColumn ename="invUnitWeight" cname="单重" width="120" align="right" format="{0:N3}"
defaultValue="0"
data-regex="/^-?[0-9]{1,17}([.][0-9]{1,3})?$/"
data-errorprompt="请输入数字,该值最大可设置17位整数和3位小数!"
enable="false"/>
<EF:EFColumn ename="invWeight" cname="总重" width="120" align="right" enable="false" format="{0:N3}"/>
<EF:EFColumn ename="price" cname="单价" width="120" align="right" format="{0:N3}"
defaultValue="0"
data-regex="/^-?[0-9]{1,17}([.][0-9]{1,3})?$/"
data-errorprompt="请输入数字,该值最大可设置17位整数和3位小数!"
required="true"/>
<EF:EFColumn ename="amount" cname="金额" width="120" align="right" enable="false" format="{0:N3}"/>
<EF:EFComboColumn cname="提交状态" ename="submitStatus" width="90" align="center" required="false">
<EF:EFCodeOption codeName="hggp.sc.productStatus" />
</EF:EFComboColumn>
......
......@@ -7,6 +7,7 @@ $(function () {
template: function (dataItem) {
for (let i = 0; i < whNameGlobalData.length; i++) {
if (whNameGlobalData[i]['valueField'] === dataItem['whCode']) {
dataItem['whName'] = WhNameGlobalData[i]['textField'];
return whNameGlobalData[i]['textField'];
}
}
......@@ -14,11 +15,9 @@ $(function () {
},
editor: function (container, options) {
let inInfo = new EiInfo();
// 1.原料,2.耗材
inInfo.set("inqu_status-0-inventTypes", [3]);
inInfo.set("inqu_status-0-whType", options.model["inventType"]);
inInfo.set("inqu_status-0-isSplicingSymbol", false);
inInfo.set("serviceName", "HPPZ007");
inInfo.set("serviceName", "HGPZ007");
inInfo.set("methodName", "queryComboBox");
inInfo.set("blockId", "wh_record_block_id");
inInfo.set("field", options.field);
......@@ -55,12 +54,9 @@ $(window).load(function () {
*/
let initWh = function () {
let inInfo = new EiInfo();
// 1.原料,2.耗材
inInfo.set("inqu_status-0-inventTypes", [3]);
inInfo.set("inqu_status-0-isSplicingSymbol", false);
EiCommunicator.send("HPPZ007", "queryComboBox", inInfo, {
EiCommunicator.send("HGPZ007", "queryWhCodeBox", inInfo, {
onSuccess: function (ei) {
whNameGlobalData = ei.getBlock("wh_record_block_id").getMappedRows();
WhNameGlobalData = ei.getBlock("wh_code_block_id").getMappedRows();
},
onFail: function (ei) {
}
......
let WhNameGlobalData = [];
$(function () {
var companyCodes = __eiInfo.getBlock("companyBox_block_id").getMappedRows();
IPLATUI.EFGrid.result = {
......
......@@ -245,7 +245,7 @@ function update() {
}
let id = rows[0].id;
JSColorbox.open({
href: "HGYX001A??methodName=initLoad&inqu_status-0-parentId=" + id + "&efParentFormEname=HGYX001",
href: "HGYX001A??methodName=initLoad&inqu_status-0-parentId=" + id + "&inqu_status-0-type=update&efParentFormEname=HGYX001",
title: "<div style='text-align: center;'>修改销售发货</div>",
width: "80%",
height: "80%",
......@@ -262,7 +262,7 @@ function remove() {
let flag = true;
$.each(rows, function(index, item) {
if(item.status > 0){
message2("审核","销售出库已审核不可删除!");
message2("审核","销售发货已审核不可删除!");
flag = false;
return false;
}
......
......@@ -53,8 +53,8 @@
filter="contains" readonly="true" required="true">
<EF:EFOptions blockId="proj_record_block_id" valueField="valueField" textField="textField"/>
</EF:EFComboColumn>
<EF:EFColumn ename="deliveryCode" cname="发货单号" enable="false" width="120" align="center"/>
<EF:EFColumn ename="outboundCode" cname="出库单号" enable="false" width="120" align="center"/>
<EF:EFColumn ename="deliveryCode" cname="发货单号" enable="false" width="130" align="center"/>
<EF:EFColumn ename="outboundCode" cname="出库单号" enable="false" width="130" align="center"/>
<EF:EFComboColumn ename="consCode" enable="true" cname="发货方" width="110" align="center"
filter="contains" readonly="true" required="true">
<EF:EFOptions blockId="companyBox_block_id" valueField="valueField" textField="textField"/>
......@@ -76,7 +76,7 @@
<EF:EFColumn ename="consAddr" cname="发货地址" hidden="true" width="120" align="center"/>
<EF:EFColumn ename="consQuantity" cname="发货数量" width="120" align="center" format="{0:N0}" data-rules="number"/>
<EF:EFColumn ename="consWeight" cname="发货重量" width="120" align="center" format="{0:N3}" data-rules="number"/>
<EF:EFComboColumn ename="status" cname="审状态" width="80" align="center" enable="false" defaultValue="0" required="true">
<EF:EFComboColumn ename="status" cname="审状态" width="80" align="center" enable="false" defaultValue="0" required="true">
<EF:EFCodeOption codeName="hggp.hgsb.approveStatus" condition="ITEM_CODE IN ('0','1')"/>
</EF:EFComboColumn>
</EF:EFGrid>
......
......@@ -118,6 +118,10 @@ $(function() {
}
$("#inqu_status-0-projCode").change(function () {
if ($("#inqu_status-0-type").val()=="update"){
NotificationUtil("无法修改项目名称!", "error");
parent.JSColorbox.close();
}
let projCode = $("#inqu_status-0-projCode");
let textField = IPLAT.EFSelect.text(projCode);
let valueField = IPLAT.EFSelect.value(projCode);
......@@ -136,6 +140,10 @@ $(function() {
IPLAT.EFSelect.setDataSource($("#inqu_status-0-consCode"),company);
})
$("#inqu_status-0-consCode").change(function () {
if ($("#inqu_status-0-type").val()=="update"){
NotificationUtil("无法修改发货方!", "error");
parent.JSColorbox.close();
}
let consCode = $("#inqu_status-0-consCode")
let textField = IPLAT.EFSelect.text(consCode);
let valueField = IPLAT.EFSelect.value(consCode);
......@@ -147,6 +155,10 @@ $(function() {
});
$("#inqu_status-0-consWhCode").change(function () {
if ($("#inqu_status-0-type").val()=="update"){
NotificationUtil("无法修改发货仓库!", "error");
parent.JSColorbox.close();
}
let textField = IPLAT.EFSelect.text($("#inqu_status-0-consWhCode"));
$("#inqu_status-0-consWhName").val(textField);
});
......
......@@ -30,7 +30,7 @@
</EF:EFSelect>
</div>
<div class="row">
<EF:EFSelect blockId="inqu_status" row="0" ename="consCode" cname="发货方" required="true" colWidth="3" filter="contains">
<EF:EFSelect blockId="inqu_status" row="0" ename="consCode" cname="发货方" required="true" disabled="true" colWidth="3" filter="contains">
<EF:EFOption label="请选择" value=""/>
<EF:EFOptions blockId="companyBox_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
......@@ -65,8 +65,8 @@
required="true" colWidth="3" disabled="true"
data-regex="/^-?[0-9]{1,15}([.][0-9]{1,3})?$/"
data-errorprompt="请输入数字,该值最大可设置15位整数和3位小数!"/>
<EF:EFInput blockId="inqu_status" row="0" ename="type" cname="type" type="hidden" colWidth="3"/>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="明细信息">
......
......@@ -18,7 +18,7 @@
<EF:EFInput blockId="inqu_status" row="0" ename="id" cname="ID" type="hidden" colWidth="3"/>
<EF:EFInput blockId="inqu_status" row="0" ename="companyCode" cname="公司编码" type="hidden" colWidth="3"/>
<EF:EFInput blockId="inqu_status" row="0" ename="companyName" cname="公司名称" type="hidden" required="true" disabled="true" colWidth="3"/>
<EF:EFSelect blockId="inqu_status" row="0" ename="projCode" cname="项目名称" required="true" colWidth="3" filter="contains">
<EF:EFSelect blockId="inqu_status" row="0" ename="projCode" cname="项目名称" required="true" disabled="true" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="proj_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
......@@ -30,31 +30,31 @@
</EF:EFSelect>
</div>
<div class="row">
<EF:EFSelect blockId="inqu_status" row="0" ename="consCode" cname="发货方" required="true" colWidth="3" filter="contains">
<EF:EFSelect blockId="inqu_status" row="0" ename="consCode" cname="发货方" disabled="true" required="true" colWidth="3" filter="contains">
<EF:EFOption label="请选择" value=""/>
<EF:EFOptions blockId="companyBox_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFInput blockId="inqu_status" row="0" ename="consName" type="hidden" cname="发货方名称" colWidth="3"/>
<EF:EFSelect blockId="inqu_status" row="0" ename="consWhCode" cname="发货仓库" required="true" colWidth="3" filter="contains">
<EF:EFSelect blockId="inqu_status" row="0" ename="consWhCode" cname="发货仓库" disabled="true" required="true" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="wh_record_box_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFInput blockId="inqu_status" row="0" ename="consWhName" type="hidden" cname="发货仓库名称" colWidth="3"/>
<EF:EFInput blockId="inqu_status" row="0" ename="consAddr" cname="发货地址" placeholder="请输入发货地址" required="true" colWidth="3"/>
<EF:EFSelect blockId="inqu_status" row="0" ename="receCode" cname="收货方" required="true" colWidth="3" filter="contains">
<EF:EFInput blockId="inqu_status" row="0" ename="consAddr" cname="发货地址" disabled="true" placeholder="请输入发货地址" required="true" colWidth="3"/>
<EF:EFSelect blockId="inqu_status" row="0" ename="receCode" cname="收货方" disabled="true" required="true" colWidth="3" filter="contains">
<EF:EFOption label="请选择" value=""/>
<EF:EFOptions blockId="customer_record_all_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFInput blockId="inqu_status" row="0" ename="receName" type="hidden" cname="收货方名称" colWidth="3"/>
</div>
<div class="row">
<EF:EFInput blockId="inqu_status" row="0" ename="receAddr" cname="收货地址" placeholder="请输入收货地址" required="true" colWidth="3"/>
<EF:EFInput blockId="inqu_status" row="0" ename="receUserPhone" cname="收货人电话" required="true" data-rules="mobile_phone" placeholder="请输入电话号码" colWidth="3"/>
<EF:EFSelect blockId="inqu_status" row="0" ename="tranType" cname="运输方式" required="true" placeholder="请选择运输方式" colWidth="3" filter="contains">
<EF:EFInput blockId="inqu_status" row="0" ename="receAddr" cname="收货地址" disabled="true" placeholder="请输入收货地址" required="true" colWidth="3"/>
<EF:EFInput blockId="inqu_status" row="0" ename="receUserPhone" cname="收货人电话" disabled="true" required="true" data-rules="mobile_phone" placeholder="请输入电话号码" colWidth="3"/>
<EF:EFSelect blockId="inqu_status" row="0" ename="tranType" cname="运输方式" disabled="true" required="true" placeholder="请选择运输方式" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hggp.hgyx.tranType"/>
</EF:EFSelect>
<EF:EFInput blockId="inqu_status" row="0" ename="numPlate" cname="车牌号" placeholder="请输入车牌号" colWidth="3"/>
<EF:EFInput blockId="inqu_status" row="0" ename="numPlate" cname="车牌号" disabled="true" placeholder="请输入车牌号" colWidth="3"/>
</div>
<div class="row">
<EF:EFInput blockId="inqu_status" row="0" ename="consQuantity" cname="发货数量" format="{0:N0}"
......
$(function () {
$(".row").children().attr("class", "col-md-3");
var companyCode = __eiInfo.get("companyCode");
var companyCodeBox = __eiInfo.getBlock("companyBox_block_id").getMappedRows();
var whCodeBox = __eiInfo.getBlock("wh_record_box_block_id").getMappedRows();
IPLATUI.EFGrid = {
"result": {
columns: [{
field: "operator",
title: "操作",
template: function (item) {
let auditStatus = item.status;
let template = '';
if (!isBlank(item.id)){
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="showDetail(' + item.id + ')" >退货详情</a>';
/*if (auditStatus == 0) {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' +
'onclick="updateStatus(' + item.id + ',1)" >审核</a>';
} else if (auditStatus == -1) {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' +
'onclick="updateStatus(' + item.id + ',0)" >撤回</a>';
}*/
}
return template;
}
}],
loadComplete: function (grid) {
// 此 grid 对象
// 新增
$("#add").on("click",add);
//修改
$("#BNT_MODIFY").on("click", update);
//删除
$("#BNT_REMOVE").on("click", remove);
//提交
$("#BNT_COMMIT").on("click", commit);
},
onAdd: function(e) {
e.preventDefault();
},
onSave: function (e) {
// 阻止后台保存请求,使用自定义保存
e.preventDefault();
save();
},
onSuccess: function (e) {
if(e.eiInfo.extAttr.methodName == 'delete' ||e.eiInfo.extAttr.methodName == 'save'){
query();
}
}
},
}
// 查询
$("#QUERY").on("click", query);
downKeyUp();
// 导出打印
//$("#PRINT").on("click", exportPrint);
});
/**
* 页面加载时执行
*/
$(window).load(function () {
// 查询
query();
});
/**
* 查询
*/
let query = function () {
resultGrid.dataSource.page(1);
}
/**
* 显示详情
*/
function showDetail(id) {
JSColorbox.open({
href: "HGYX002B?methodName=initLoad&inqu_status-0-parentId=" + id+"&inqu_status-0-type=insert",
title: "<div style='text-align: center;'>退货详情</div>",
width: "80%",
height: "80%",
callbackName: windowCallback
});
}
function add() {
JSColorbox.open({
href: "HGYX002A?methodName=initLoad",
title: "<div style='text-align: center;'>新增销售退货</div>",
width: "80%",
height: "80%",
callbackName: windowCallback
});
}
function update() {
let rows = resultGrid.getCheckedRows()
if (rows.length < 1||rows.length > 1) {
message2("修改","请选择一条需要修改的数据");
return;
}
if(rows[0].status>0){
message2("修改","销售发货已审核不可修改!");
return;
}
let id = rows[0].id;
JSColorbox.open({
href: "HGYX002A??methodName=initLoad&inqu_status-0-parentId=" + id + "&inqu_status-0-type=update&efParentFormEname=HGYX002",
title: "<div style='text-align: center;'>修改销售退货</div>",
width: "80%",
height: "80%",
callbackName: windowCallback
});
}
function remove() {
let rows = resultGrid.getCheckedRows()
if (rows.length < 1) {
message2("删除","没有选中的行");
return;
}
let flag = true;
$.each(rows, function(index, item) {
if(item.status > 0){
message2("审核","销售退货已审核不可删除!");
flag = false;
return false;
}
});
if(flag) {
IPLAT.confirm({ title: '删除', message: '确认删除此数据么?',
okFn: function () {
var post = new EiInfo();
post.addBlock(resultGrid.getCheckedBlockData());
EiCommunicator.send("HGYX002", "delete", post, {
onSuccess: function (ei) {
if (ei.getStatus() >= 0) {
NotificationUtil(ei);
resultGrid.dataSource.query();
} else {
NotificationUtil(ei, "error");
}
},
onFail: function (ei) {
// 发生异常
NotificationUtil("操作失败,原因[" + ei + "]", "error");
}
});
}
});
}
}
function commit() {
let rows = resultGrid.getCheckedRows()
if (rows.length < 1) {
message2("提交","没有选中的行");
return;
}
let flag = true;
$.each(rows, function(index, item) {
//let companyCode= item.get("companyCode");
let status= item.get("status");
if(status > 0){
message2("提交","销售退货已审核不可重复提交!");
flag = false;
return false;
}
});
if (flag){
IPLAT.confirm({
title:'提交',
message:'确认提交此数据么?',
okFn:function () {
var post = new EiInfo();
post.addBlock(resultGrid.getCheckedBlockData());
post.set("recursion", true);
EiCommunicator.send("HGYX002","commit",post,{
onSuccess: function (ei) {
if (ei.getStatus() >= 0) {
NotificationUtil(ei);
resultGrid.dataSource.query();
} else {
NotificationUtil(ei, "error");
}
},
onFail: function (ei) {
// 发生异常
NotificationUtil("操作失败,原因[" + ei + "]", "error");
}
});
}
})
}
}
function windowCallback(ei) {
if (ei.getStatus() >= 0) {
// 刷新列表
resultGrid.dataSource.page(1);
// 关闭弹窗
JSColorbox.close();
}
}
\ No newline at end of file
<%--
Created by IntelliJ IDEA.
User: 1
Date: 2024/6/7
Time: 15:28
To change this template use File | Settings | File Templates.
--%>
<!DOCTYPE html>
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<EF:EFPage title="销售退货">
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<EF:EFInput blockId="inqu_status" row="0" ename="projName" cname="项目名称" placeholder="模糊查询" colWidth="3"/>
<EF:EFInput blockId="inqu_status" row="0" ename="returnCode" cname="退货单号" placeholder="模糊查询" colWidth="3"/>
<EF:EFInput blockId="inqu_status" row="0" ename="deliveryCode" cname="发货单号" placeholder="模糊查询" colWidth="3"/>
<EF:EFInput blockId="inqu_status" row="0" ename="consName" cname="发货方" placeholder="模糊查询" colWidth="3"/>
<EF:EFInput blockId="inqu_status" row="0" ename="receName" cname="收货方" placeholder="模糊查询" colWidth="3"/>
<EF:EFSelect blockId="inqu_status" row="0" ename="status" cname="审核状态" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hggp.hgsb.approveStatus" condition="ITEM_CODE IN ('0','1')"/>
</EF:EFSelect>
<EF:EFInput blockId="inqu_status" row="0" ename="companyCode" cname="所属公司" placeholder="模糊查询" type="hidden" colWidth="3"/>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row" copyToAdd="false">
<EF:EFColumn ename="id" cname="内码" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="120" align="center"/>
<EF:EFComboColumn ename="projCode" enable="true" cname="项目名称" width="110" align="center"
filter="contains" readonly="true" required="true">
<EF:EFOptions blockId="proj_record_block_id" valueField="valueField" textField="textField"/>
</EF:EFComboColumn>
<EF:EFColumn ename="returnCode" cname="退货单号" enable="false" width="120" align="center" required="true"/>
<EF:EFColumn ename="deliveryCode" cname="发货单号" enable="false" width="120" align="center" required="true"/>
<EF:EFComboColumn ename="consCode" enable="true" cname="发货方" width="110" align="center"
filter="contains" readonly="true" required="true">
<EF:EFOptions blockId="companyBox_block_id" valueField="valueField" textField="textField"/>
</EF:EFComboColumn>
<EF:EFComboColumn ename="receCode" enable="true" cname="收货方" width="110" align="center"
filter="contains" readonly="true" required="true">
<EF:EFOptions blockId="customer_record_all_block_id" valueField="valueField" textField="textField"/>
</EF:EFComboColumn>
<EF:EFColumn ename="receUserPhone" cname="收货人电话" width="120" align="center" readonly="true" data-rules="mobile_phone"/>
<EF:EFComboColumn ename="companyCode" enable="true" cname="所属公司" width="110" align="center"
filter="contains" readonly="true" required="true">
<EF:EFOptions blockId="companyBox_block_id" valueField="valueField" textField="textField"/>
</EF:EFComboColumn>
<EF:EFColumn ename="returnQuantity" cname="退货数量" width="120" readonly="true" align="center" format="{0:N0}" data-rules="number"/>
<EF:EFColumn ename="returnWeight" cname="退货重量" width="120" readonly="true" align="center" format="{0:N3}" data-rules="number"/>
<EF:EFComboColumn ename="status" cname="审批状态" width="80" align="center" enable="false" defaultValue="0" required="true">
<EF:EFCodeOption codeName="hggp.hgsb.approveStatus" condition="ITEM_CODE IN ('0','1')"/>
</EF:EFComboColumn>
<EF:EFColumn ename="companyCode" cname="公司编码" hidden="true"/>
<EF:EFColumn ename="companyName" cname="公司名称" hidden="true"/>
<EF:EFColumn ename="consWhCode" cname="仓库编码" hidden="true"/>
<EF:EFColumn ename="consWhName" cname="仓库名称" hidden="true"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
<%--
Created by IntelliJ IDEA.
User: 1
Date: 2024/6/7
Time: 15:28
To change this template use File | Settings | File Templates.
--%>
<!DOCTYPE html>
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<EF:EFPage title="销售退货">
<EF:EFRegion id="inqu" title="发货信息">
<div class="row">
<EF:EFInput blockId="inqu_status" row="0" ename="id" cname="ID" type="hidden" colWidth="3"/>
<EF:EFInput blockId="inqu_status" row="0" ename="companyCode" cname="公司编码" type="hidden" colWidth="3"/>
<EF:EFInput blockId="inqu_status" row="0" ename="companyName" cname="公司名称" type="hidden" colWidth="3"/>
<EF:EFInput blockId="inqu_status" row="0" ename="returnCode" cname="退货单号" disabled="true" colWidth="3"/>
<EF:EFSelect blockId="inqu_status" row="0" ename="deliveryCode" cname="发货单号"
valueTemplate="#=valueField#-#=textField#"
template="#=valueField#-#=textField#"
textField="#=valueField#-#=textField#"
valueField="valueField"
required="true" colWidth="3" filter="contains">
<EF:EFOption label="请选择" value=""/>
<EF:EFOptions blockId="deliveryCodeBox_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFInput blockId="inqu_status" row="0" ename="outboundCode" cname="出库单号" type="hidden" disabled="true" colWidth="3"/>
<EF:EFSelect blockId="inqu_status" row="0" ename="projCode" cname="项目名称" required="true" disabled="true" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="proj_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFInput blockId="inqu_status" row="0" ename="projName" cname="项目名称" type="hidden" colWidth="3"/>
<EF:EFSelect blockId="inqu_status" row="0" ename="consCode" cname="发货方" required="true" disabled="true" colWidth="3" filter="contains">
<EF:EFOption label="请选择" value=""/>
<EF:EFOptions blockId="companyBox_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFInput blockId="inqu_status" row="0" ename="consName" type="hidden" cname="发货方编码" colWidth="3"/>
<EF:EFInput blockId="inqu_status" row="0" ename="consWhCode" type="hidden" cname="发货仓库名称" colWidth="3"/>
<EF:EFInput blockId="inqu_status" row="0" ename="consWhName" type="hidden" cname="发货仓库名称" colWidth="3"/>
<EF:EFSelect blockId="inqu_status" row="0" ename="receCode" cname="收货方" required="true" disabled="true" colWidth="3" filter="contains">
<EF:EFOption label="请选择" value=""/>
<EF:EFOptions blockId="customer_record_all_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFInput blockId="inqu_status" row="0" ename="receName" type="hidden" cname="收货方名称" colWidth="3"/>
<EF:EFInput blockId="inqu_status" row="0" ename="receUserPhone" cname="收货人电话" required="true" data-rules="mobile_phone" placeholder="请输入电话号码" colWidth="3"/>
<EF:EFSelect blockId="inqu_status" row="0" ename="status" cname="审核状态" colWidth="3" disabled="true" filter="contains" value="0">
<EF:EFCodeOption codeName="hggp.hgsb.approveStatus" condition="ITEM_CODE IN ('0','1')"/>
</EF:EFSelect>
</div>
<div class="row">
<EF:EFInput blockId="inqu_status" row="0" ename="returnQuantity" cname="退货数量" format="{0:N0}"
required="true" colWidth="3" disabled="true"
data-regex="/^-?[0-9]{1,15}?$/"
data-errorprompt="请输入数字,该值最大可设置15位整数"/>
<EF:EFInput blockId="inqu_status" row="0" ename="returnWeight" cname="退货重量" format="{0:N3}"
required="true" colWidth="3" disabled="true"
data-regex="/^-?[0-9]{1,15}([.][0-9]{1,3})?$/"
data-errorprompt="请输入数字,该值最大可设置15位整数和3位小数!"/>
<EF:EFInput blockId="inqu_status" row="0" ename="remarks" cname="退货原因" type="textarea" colWidth="8" ratio="2:8"/>
<EF:EFInput blockId="inqu_status" row="0" ename="consId" cname="发货方ID" type="hidden" colWidth="3"/>
<EF:EFInput blockId="inqu_status" row="0" ename="type" cname="type" type="hidden" colWidth="3"/>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFComboColumn ename="inventType" cname="存货类型" enable="false" width="120" align="center" required="true"
blockName="invent_type_box_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#" readonly="false"
filter="contains">
</EF:EFComboColumn>
<EF:EFComboColumn ename="inventCode" cname="存货名称" enable="false" width="120" align="center" required="true"
blockName="invent_code_box_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#" readonly="false"
filter="contains">
</EF:EFComboColumn>
<EF:EFComboColumn ename="spec" cname="规格" enable="false" width="120" align="center" required="true"
blockName="spec_box_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#" readonly="false"
filter="contains">
</EF:EFComboColumn>
<EF:EFColumn ename="inventRecordId" cname="规格ID" width="120" enable="true" readonly="true" align="center" hidden="true" maxLength="50"/>
<EF:EFColumn ename="length" cname="长度(MM)" enable="false" readonly="true" width="100" align="right" format="{0:N3}" maxLength="10"/>
<EF:EFColumn ename="width" cname="宽度(MM)" enable="false" readonly="true" width="100" align="right" format="{0:N3}" maxLength="10"/>
<EF:EFColumn ename="thick" cname="厚度(MM)" enable="false" readonly="true" width="100" align="right" format="{0:N3}" maxLength="10"/>
<EF:EFColumn ename="quantity" cname="发货数量" width="120" enable="false" format="{0:N0}" editType="text"
displayType="0.000" sort="true" align="right"
data-regex="/^-?[0-9]{1,15}$/" maxLength="20" required="true"
data-errorprompt="请输入数字,该值最大可设置15位整数和3位小数!"/>
<EF:EFColumn ename="unitWeight" cname="单重" width="120" enable="false" format="{0:N3}" hidden="true" editType="text"
displayType="0.000" sort="true" align="right"
data-regex="/^-?[0-9]{1,15}([.][0-9]{1,3})?$/" maxLength="15" required="true"
data-errorprompt="请输入数字,该值最大可设置15位整数和3位小数!"/>
<EF:EFColumn ename="weight" cname="发货重量" width="120" enable="false" format="{0:N3}" editType="text"
displayType="0.000" sort="true" align="right"
data-regex="/^-?[0-9]{1,15}([.][0-9]{1,3})?$/" maxLength="15" required="true"
data-errorprompt="请输入数字,该值最大可设置15位整数和3位小数!"/>
<EF:EFColumn ename="returnQuantity" cname="退货数量" width="120" enable="true" format="{0:N0}" editType="number"
displayType="0.000" sort="true" align="right" defaultValue="0"
data-regex="/^-?[0-9]{1,15}$/" maxLength="20" required="true"
data-errorprompt="请输入数字,该值最大可设置15位整数和3位小数!"/>
<EF:EFColumn ename="returnWeight" cname="退货重量" width="120" defaultValue="0" enable="false" readonly="true" format="{0:N3}" editType="number" required="true"/>
</EF:EFGrid>
</EF:EFRegion>
<div class="row" style="display:flex;justify-content:center;">
<EF:EFButton ename="btn_save" cname="保存" type="button" class="btn-center"/>
<EF:EFButton ename="btn_save_status" cname="保存&提交审核" type="button" class="btn-center"/>
<EF:EFButton ename="cancel" cname="取消" type="button" class="btn-center"/>
</div>
</EF:EFPage>
$(function () {
//$(".row").children().attr("class", "col-md-3");
var inventTypeBox = __eiInfo.getBlock("invent_type_box_block_id").getMappedRows();
var inventCodedBox = __eiInfo.getBlock("invent_code_box_block_id").getMappedRows();
var specIdBox = __eiInfo.getBlock("spec_box_block_id").getMappedRows();
// 查询
$("#QUERY").on("click", query);
IPLATUI.EFGrid.result = {
pageable: {
pageSize: 10,
pageSizes: [10, 20, 30, 50, 100, 200]
},
columns: [],
loadComplete: function(grid) {
// 此 grid 对象
// 处理父子级联动,通过监听 change 事件,判断父级节点是否发生变化
grid.dataSource.bind("change", function(e) {
// 判断父级节点是否发生变化
if (e.field === "spec"){
for (let i = 0; i < specIdBox.length; i++) {
if (specIdBox[i]['param7Field'] === e.items[0]["inventRecordId"]){
e.items[0]["length"] = specIdBox[i]['param1Field'];
e.items[0]["width"] = specIdBox[i]['param2Field'];
e.items[0]["thick"] = specIdBox[i]['param3Field'];
e.items[0]["quantity"] = specIdBox[i]['param4Field'];
resultGrid.setCellValue(e.items[0],"unitWeight",specIdBox[i]['param5Field']);
resultGrid.setCellValue(e.items[0],"weight",specIdBox[i]['param6Field']);
//e.items[0]["unitWeight"] = specIdBox[i]['param5Field'];
//e.items[0]["weight"] = specIdBox[i]['param6Field'];
}
}
loadChange(grid,e,"length");
loadChange(grid,e,"width");
loadChange(grid,e,"thick");
//loadChange(grid,e,"unitWeight");
//loadChange(grid,e,"weight");
loadChange(grid,e,"quantity");
}else if (e.field === "quantity"){
if (e.items[0].quantity != 0 && e.items[0].unitWeight > 0){
e.items[0].weight = e.items[0].unitWeight*e.items[0].quantity;
resultGrid.setCellValue(e.items[0],"weight",e.items[0].unitWeight*e.items[0].quantity);
}
}else if (e.field === "inventCode"){
loadChange(grid,e,"spec");
}
});
},
onSuccess: function (e) {
if(e.eiInfo.extAttr.methodName == 'save'
||e.eiInfo.extAttr.methodName == 'delete' ){
query();
}
},
onSave: function (e) {
// 阻止后台保存请求,使用自定义保存
e.preventDefault();
save();
},
onDelete: function (e) {
// 阻止后台删除请求,使用自定义删除
//e.preventDefault();
//deleteFunc();
}
}
})
let query = function () {
resultGrid.dataSource.page(1);
}
\ No newline at end of file
<%--
Created by IntelliJ IDEA.
User: 1
Date: 2024/6/7
Time: 15:29
To change this template use File | Settings | File Templates.
--%>
<!DOCTYPE html>
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<EF:EFPage title="销售退货">
<EF:EFRegion id="inqu" title="发货信息">
<div class="row">
<EF:EFInput blockId="inqu_status" row="0" ename="id" cname="ID" type="hidden" colWidth="3"/>
<EF:EFInput blockId="inqu_status" row="0" ename="companyCode" cname="公司编码" type="hidden" colWidth="3"/>
<EF:EFInput blockId="inqu_status" row="0" ename="companyName" cname="公司名称" type="hidden" required="true" disabled="true" colWidth="3"/>
<EF:EFInput blockId="inqu_status" row="0" ename="returnCode" cname="退货单号" disabled="true" colWidth="3"/>
<EF:EFInput blockId="inqu_status" row="0" ename="deliveryCode" cname="发货单号" disabled="true" colWidth="3"/>
<EF:EFInput blockId="inqu_status" row="0" ename="outboundCode" cname="出库单号" type="hidden" disabled="true" colWidth="3"/>
<EF:EFSelect blockId="inqu_status" row="0" ename="projCode" cname="项目名称" required="true" disabled="true" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="proj_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFInput blockId="inqu_status" row="0" ename="projName" cname="项目名称" type="hidden" colWidth="3"/>
<EF:EFSelect blockId="inqu_status" row="0" ename="consCode" cname="发货方" disabled="true" required="true" colWidth="3" filter="contains">
<EF:EFOption label="请选择" value=""/>
<EF:EFOptions blockId="companyBox_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFInput blockId="inqu_status" row="0" ename="consCode" type="hidden" cname="发货方编码" colWidth="3"/>
<EF:EFInput blockId="inqu_status" row="0" ename="consWhName" type="hidden" cname="发货仓库名称" colWidth="3"/>
<EF:EFInput blockId="inqu_status" row="0" ename="consWhName" type="hidden" cname="发货仓库名称" colWidth="3"/>
<EF:EFSelect blockId="inqu_status" row="0" ename="receCode" cname="收货方" disabled="true" required="true" colWidth="3" filter="contains">
<EF:EFOption label="请选择" value=""/>
<EF:EFOptions blockId="customer_record_all_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFInput blockId="inqu_status" row="0" ename="receName" type="hidden" cname="收货方名称" colWidth="3"/>
<EF:EFSelect blockId="inqu_status" row="0" ename="status" cname="审核状态" colWidth="3" disabled="true" filter="contains" value="0">
<EF:EFCodeOption codeName="hggp.hgsb.approveStatus" condition="ITEM_CODE IN ('0','1')"/>
</EF:EFSelect>
</div>
<div class="row">
<EF:EFInput blockId="inqu_status" row="0" ename="returnQuantity" cname="退货数量" format="{0:N0}"
required="true" colWidth="3" disabled="true"
data-regex="/^-?[0-9]{1,15}?$/"
data-errorprompt="请输入数字,该值最大可设置15位整数"/>
<EF:EFInput blockId="inqu_status" row="0" ename="returnWeight" cname="退货重量" format="{0:N3}"
required="true" colWidth="3" disabled="true"
data-regex="/^-?[0-9]{1,15}([.][0-9]{1,3})?$/"
data-errorprompt="请输入数字,该值最大可设置15位整数和3位小数!"/>
</div>
<div class="row">
<EF:EFInput blockId="inqu_status" row="0" ename="remarks" cname="退货原因" type="textarea" colWidth="8" ratio="2:8"/>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFComboColumn ename="inventType" cname="存货类型" enable="true" width="120" align="center" required="true"
blockName="invent_type_box_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#" readonly="false"
filter="contains">
</EF:EFComboColumn>
<EF:EFComboColumn ename="inventCode" cname="存货名称" enable="true" width="120" align="center" required="true"
blockName="invent_code_box_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#" readonly="false"
filter="contains">
</EF:EFComboColumn>
<EF:EFComboColumn ename="spec" cname="规格" enable="true" width="120" align="center" required="true"
blockName="spec_box_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#" readonly="false"
filter="contains">
</EF:EFComboColumn>
<EF:EFColumn ename="inventRecordId" cname="规格ID" width="120" enable="true" readonly="true" align="center" hidden="true" maxLength="50"/>
<EF:EFColumn ename="length" cname="长度(MM)" enable="true" readonly="false" width="100" align="right" format="{0:N3}" maxLength="10"/>
<EF:EFColumn ename="width" cname="宽度(MM)" enable="true" readonly="false" width="100" align="right" format="{0:N3}" maxLength="10"/>
<EF:EFColumn ename="thick" cname="厚度(MM)" enable="true" readonly="false" width="100" align="right" format="{0:N3}" maxLength="10"/>
<EF:EFColumn ename="quantity" cname="数量" width="120" enable="true" format="{0:N0}" editType="text"
displayType="0.000" sort="true" align="right"
data-regex="/^-?[0-9]{1,15}$/" maxLength="20" required="true"
data-errorprompt="请输入数字,该值最大可设置15位整数和3位小数!"/>
<EF:EFColumn ename="unitWeight" cname="单重" width="120" enable="false" format="{0:N3}" editType="text"
displayType="0.000" sort="true" align="right"
data-regex="/^-?[0-9]{1,15}([.][0-9]{1,3})?$/" maxLength="15" required="true"
data-errorprompt="请输入数字,该值最大可设置15位整数和3位小数!"/>
<EF:EFColumn ename="weight" cname="重量" width="120" enable="false" format="{0:N3}" editType="text"
displayType="0.000" sort="true" align="right"
data-regex="/^-?[0-9]{1,15}([.][0-9]{1,3})?$/" maxLength="15" required="true"
data-errorprompt="请输入数字,该值最大可设置15位整数和3位小数!"/>
<EF:EFColumn ename="returnQuantity" cname="退货数量" width="120" enable="true" format="{0:N0}" editType="text"
displayType="0.000" sort="true" align="right"
data-regex="/^-?[0-9]{1,15}$/" maxLength="20" required="true"
data-errorprompt="请输入数字,该值最大可设置15位整数和3位小数!"/>
<EF:EFColumn ename="returnWeight" cname="退货重量" width="120" enable="false" format="{0:N3}" editType="text"
displayType="0.000" sort="true" align="right"
data-regex="/^-?[0-9]{1,15}([.][0-9]{1,3})?$/" maxLength="15" required="true"
data-errorprompt="请输入数字,该值最大可设置15位整数和3位小数!"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
$(function () {
// 查询
$("#QUERY").on("click", query);
$("#BNT_CHOICE").on("click", choice)
})
/**
* 查询
*/
let query = function () {
resultGrid.dataSource.page(1);
}
let choice = function () {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
parent.JSColorbox.setValueCallback(rows);
parent.JSColorbox.close();
}
\ No newline at end of file
<%--
Created by IntelliJ IDEA.
User: 1
Date: 2024/6/7
Time: 15:29
To change this template use File | Settings | File Templates.
--%>
<!DOCTYPE html>
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<script>
var ctx = "${ctx}";
</script>
<EF:EFPage title="退货明细">
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<EF:EFInput blockId="inqu_status" row="0" ename="inventName" cname="物料名称" placeholder="模糊查询" colWidth="3"/>
<EF:EFInput blockId="inqu_status" row="0" ename="spec" cname="规格" placeholder="模糊查询" colWidth="3"/>
<EF:EFInput blockId="inqu_status" row="0" ename="companyCode" cname="公司名称" type="hidden" required="true" colWidth="3"/>
<EF:EFInput blockId="inqu_status" row="0" ename="whCode" cname="仓库名称" type="hidden" required="true" colWidth="3"/>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="记录集">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFComboColumn ename="inventType" cname="存货类型" enable="true" width="120" align="center" required="true"
blockName="invent_type_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#" readonly="false"
filter="contains">
</EF:EFComboColumn>
<EF:EFComboColumn ename="inventCode" cname="存货名称" enable="true" width="120" align="center" required="true"
blockName="invent_record_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#" readonly="false"
filter="contains">
</EF:EFComboColumn>
<EF:EFComboColumn ename="spec" cname="规格" enable="true" width="120" align="center" required="true"
blockName="spec_name_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#" readonly="false"
filter="contains">
</EF:EFComboColumn>
<EF:EFColumn ename="inventRecordId" cname="规格ID" width="120" enable="true" readonly="true" align="center" hidden="true" maxLength="50"/>
<EF:EFColumn ename="length" cname="长度(MM)" enable="true" readonly="false" width="100" align="right" format="{0:N3}" maxLength="10"/>
<EF:EFColumn ename="width" cname="宽度(MM)" enable="true" readonly="false" width="100" align="right" format="{0:N3}" maxLength="10"/>
<EF:EFColumn ename="thick" cname="厚度(MM)" enable="true" readonly="false" width="100" align="right" format="{0:N3}" maxLength="10"/>
<EF:EFColumn ename="quantity" cname="数量" width="120" enable="true" format="{0:N0}" editType="text"
displayType="0.000" sort="true" align="right"
data-regex="/^-?[0-9]{1,20}([.][0-9]{1,3})?$/" maxLength="20" required="true"
data-errorprompt="请输入数字,该值最大可设置15位整数和3位小数!"/>
<EF:EFColumn ename="unitWeight" cname="单重" width="120" enable="true" format="{0:N0}" editType="text"
displayType="0.000" sort="true" align="right"
data-regex="/^-?[0-9]{1,20}([.][0-9]{1,3})?$/" maxLength="20" required="true"
data-errorprompt="请输入数字,该值最大可设置15位整数和3位小数!"/>
<EF:EFColumn ename="weight" cname="重量" width="120" enable="false" format="{0:N3}" editType="text"
displayType="0.000" sort="true" align="right"
data-regex="/^-?[0-9]{1,15}([.][0-9]{1,3})?$/" maxLength="15" required="true"
data-errorprompt="请输入数字,该值最大可设置15位整数和3位小数!"/>
<EF:EFColumn ename="returnQuantity" cname="退货数量" width="120" enable="true" hidden="true" format="{0:N0}" editType="number"
displayType="0.000" sort="true" align="right"
data-regex="/^-?[0-9]{1,15}$/" maxLength="20" required="true"
data-errorprompt="请输入数字,该值最大可设置15位整数和3位小数!"/>
<EF:EFColumn ename="returnWeight" cname="退货重量" width="120" enable="true" hidden="true" format="{0:N3}" editType="number" required="true"/>
</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