Commit 64609263 by liuyang

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

parents 019e567d 74b543f5
package com.baosight.hpjx.common;
/**
* @author:songx
* @date:2024/2/5,11:33
*/
public enum ReturnStatusEnum {
RETURNING(0, "退货中"),
RETURNED(1, "退货完成(已收货)");
private Integer code;
private String value;
ReturnStatusEnum(Integer code, String value) {
this.code = code;
this.value = value;
}
public Integer getCode() {
return code;
}
public void setCode(Integer code) {
this.code = code;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
}
......@@ -36,9 +36,11 @@ public class ServiceHPBI003 extends ServiceBase {
public EiInfo querySbStatus(EiInfo inInfo) {
String companyCode = UserSessionUtils.getCompanyCode();
String factoryCode = (String) inInfo.get("factoryCode");
String deviceCode = (String) inInfo.get("deviceCode");
Map sqlMap = new HashMap();
sqlMap.put("companyCode", companyCode);
sqlMap.put("factoryCode", factoryCode);
sqlMap.put("deviceCode", deviceCode);
List<Map> result = this.dao.query("HPBI003.querySbStatus", sqlMap);
inInfo.set("result",result);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
......
......@@ -9,17 +9,29 @@
<select id="querySbStatus" parameterClass="java.util.HashMap"
resultClass="java.util.HashMap">
select
DEVICE_CODE,DEVICE_STATUS,ORG_CNAME,DEVICE_NAME,DEVICE_MODEL,
case when DEVICE_STATUS = 0 then '停机' else '开机' end as STATUS_DESC
a.DEVICE_CODE,b.ORG_CNAME,a.DEVICE_NAME,a.DEVICE_MODEL,
case when c.LOG_VALUE = 2 then 1 else 0 end as DEVICE_STATUS,
case when c.LOG_VALUE = 2 then '运行状态'
when c.LOG_VALUE = 1 then '默认状态'
when c.LOG_VALUE = 3 then '暂停状态'
when c.LOG_VALUE = 4 then '复位状态'
when c.LOG_VALUE = 5 then '一级报警状态'
when c.LOG_VALUE = 6 then '二级报警状态'
else '异常状态' end as STATUS_DESC
from hpjx.t_hpsb003 a
join iplat.TXSOG01 b on a.GROUP_CODE = b.ORG_ID and b.IS_DELETED = 0
where DELETE_FLAG = 0
join hpjx.t_hpsb002 c on a.DEVICE_CODE=c.EQUIPMENT_CODE
where a.DELETE_FLAG = 0 and DEVICE_STATUS = 1 and c.EQUIPMENT_TYPE = 'STARUS_TYPE'
<isNotEmpty prepend=" AND " property="companyCode">
A.COMPANY_CODE = #companyCode#
a.COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryCode">
A.FACTORY_CODE = #factoryCode#
a.FACTORY_CODE = #factoryCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deviceCode">
a.DEVICE_CODE = #deviceCode#
</isNotEmpty>
order by c.CREATED_TIME desc
limit 1
</select>
</sqlMap>
\ No newline at end of file
......@@ -64,6 +64,8 @@ public class HPConstant {
public static final String HPPZ017_SALES_CODE = "HPPZ017_SALES_CODE";
//销售计划单号
public static final String PLAN_SALES_CODE = "PLAN_SALES_CODE";
// 退货单号
public static final String HPKC013_RETURN_NO = "HPKC013_RETURN_NO";
}
/**
......
......@@ -236,14 +236,11 @@ public class HPSqlConstant {
/**
* HPKC013 SQL 定义
*
* @author:songx
* @date:2024/1/20,16:45
*/
public class HPKC013 {
// 锁
public static final String UPDATE_STATUS = "HPKC013.updateStatus";
public static final String LOCK = "HPKC013.lock";
}
/**
......
......@@ -46,6 +46,7 @@ public class HPKC004 extends DaoEPBase {
public static final String FIELD_KC_ID = "kcId"; /* 库存ID*/
public static final String FIELD_OLD_SALE_NO = "oldSaleNo"; /* 原销售单号*/
public static final String FIELD_IS_PRINT = "isPrint"; /* 是否打印:0.否1.是*/
public static final String FIELD_IS_RETURN = "isReturn"; /* 是否申请退货 0.否1.是*/
public static final String FIELD_CREATED_BY = "createdBy"; /* 创建人*/
public static final String FIELD_CREATED_NAME = "createdName"; /* 创建人名称*/
public static final String FIELD_CREATED_TIME = "createdTime"; /* 创建时间*/
......@@ -82,6 +83,7 @@ public class HPKC004 extends DaoEPBase {
public static final String COL_KC_ID = "KC_ID"; /* 库存ID*/
public static final String COL_OLD_SALE_NO = "OLD_SALE_NO"; /* 原销售单号*/
public static final String COL_IS_PRINT = "IS_PRINT"; /* 是否打印:0.否1.是*/
public static final String COL_IS_RETURN = "IS_RETURN"; /* 是否申请退货 0.否1.是*/
public static final String COL_CREATED_BY = "CREATED_BY"; /* 创建人*/
public static final String COL_CREATED_NAME = "CREATED_NAME"; /* 创建人名称*/
public static final String COL_CREATED_TIME = "CREATED_TIME"; /* 创建时间*/
......@@ -123,6 +125,7 @@ public class HPKC004 extends DaoEPBase {
private Long kcId; /* 库存ID*/
private String oldSaleNo = " "; /* 原销售单号*/
private Integer isPrint; /* 是否打印:0.否1.是*/
private Integer isReturn; /* 是否申请退货 0.否1.是*/
private String createdBy = " "; /* 创建人*/
private String createdName = " "; /* 创建人名称*/
private String createdTime = " "; /* 创建时间*/
......@@ -255,6 +258,10 @@ public class HPKC004 extends DaoEPBase {
eiColumn.setDescName("是否打印:0.否1.是");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_IS_RETURN);
eiColumn.setDescName("是否申请退货 0.否1.是");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CREATED_BY);
eiColumn.setDescName("创建人");
eiMetadata.addMeta(eiColumn);
......@@ -687,6 +694,15 @@ public class HPKC004 extends DaoEPBase {
public void setIsPrint(Integer isPrint) {
this.isPrint = isPrint;
}
public Integer getIsReturn() {
return isReturn;
}
public void setIsReturn(Integer isReturn) {
this.isReturn = isReturn;
}
/**
* get the createdBy - 创建人.
* @return the createdBy
......@@ -879,6 +895,7 @@ public class HPKC004 extends DaoEPBase {
setKcId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_KC_ID)), kcId));
setOldSaleNo(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_OLD_SALE_NO)), oldSaleNo));
setIsPrint(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_IS_PRINT)), isPrint));
setIsReturn(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_IS_RETURN)), isReturn));
setCreatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_BY)), createdBy));
setCreatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_NAME)), createdName));
setCreatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_TIME)), createdTime));
......@@ -922,6 +939,7 @@ public class HPKC004 extends DaoEPBase {
map.put(FIELD_KC_ID, StringUtils.toString(kcId, eiMetadata.getMeta(FIELD_KC_ID)));
map.put(FIELD_OLD_SALE_NO, StringUtils.toString(oldSaleNo, eiMetadata.getMeta(FIELD_OLD_SALE_NO)));
map.put(FIELD_IS_PRINT, StringUtils.toString(isPrint, eiMetadata.getMeta(FIELD_IS_PRINT)));
map.put(FIELD_IS_RETURN, StringUtils.toString(isReturn, eiMetadata.getMeta(FIELD_IS_RETURN)));
map.put(FIELD_CREATED_BY, StringUtils.toString(createdBy, eiMetadata.getMeta(FIELD_CREATED_BY)));
map.put(FIELD_CREATED_NAME, StringUtils.toString(createdName, eiMetadata.getMeta(FIELD_CREATED_NAME)));
map.put(FIELD_CREATED_TIME, StringUtils.toString(createdTime, eiMetadata.getMeta(FIELD_CREATED_TIME)));
......
package com.baosight.hpjx.hp.kc.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:THpkc013.java <br>
* Description: <br>
*
* Copyrigth:Baosight Software LTD.co Copyright (c) 2019. <br>
*
* @version 1.0
* @history 2024-01-31 17:22:56 create
*/
public class HPKC013 extends DaoEPBase {
private static final long serialVersionUID = 1L;
public static final String FIELD_ID = "id"; /* ID*/
public static final String FIELD_COMPANY_CODE = "companyCode"; /* 企业编码 预留*/
public static final String FIELD_DEP_CODE = "depCode"; /* 部门编码 预留*/
public static final String FIELD_RECEIPT_DATE = "receiptDate"; /* 票据日期*/
public static final String FIELD_RETURN_NO = "returnNo"; /* 退货单号*/
public static final String FIELD_SALE_NO = "saleNo"; /* 销售单号*/
public static final String FIELD_WH_CODE = "whCode"; /* 仓库编码*/
public static final String FIELD_WH_NAME = "whName"; /* 仓库名称*/
public static final String FIELD_PROD_NO = "prodNo"; /* 生产订单号*/
public static final String FIELD_PROJ_CODE = "projCode"; /* 项目号*/
public static final String FIELD_PROJ_NAME = "projName"; /* 项目名称*/
public static final String FIELD_INVENT_CODE = "inventCode"; /* 部件编码*/
public static final String FIELD_INVENT_NAME = "inventName"; /* 部件名称*/
public static final String FIELD_SUB_INVENT_CODE = "subInventCode"; /* 零件编码*/
public static final String FIELD_SUB_INVENT_NAME = "subInventName"; /* 零件名称*/
public static final String FIELD_LENGTH = "length"; /* 长*/
public static final String FIELD_WIDTH = "width"; /* 宽*/
public static final String FIELD_THICK = "thick"; /* 厚*/
public static final String FIELD_AMOUNT = "amount"; /* 数量*/
public static final String FIELD_UNIT_WEIGHT = "unitWeight"; /* 单重*/
public static final String FIELD_WEIGHT = "weight"; /* 重量*/
public static final String FIELD_REMARK = "remark"; /* 备注*/
public static final String FIELD_KC_ID = "kcId"; /* 库存ID*/
public static final String FIELD_OLD_RETURN_NO = "oldReturnNo"; /* 原退货单号*/
public static final String FIELD_RETURN_STATUS = "returnStatus"; /* 退货状态 0,退货中,1,退货完成(已收货)*/
public static final String FIELD_CREATED_BY = "createdBy"; /* 创建人*/
public static final String FIELD_CREATED_NAME = "createdName"; /* 创建人名称*/
public static final String FIELD_CREATED_TIME = "createdTime"; /* 创建时间*/
public static final String FIELD_UPDATED_BY = "updatedBy"; /* 修改人*/
public static final String FIELD_UPDATED_NAME = "updatedName"; /* 修改人名称*/
public static final String FIELD_UPDATED_TIME = "updatedTime"; /* 修改时间*/
public static final String FIELD_DELETE_FLAG = "deleteFlag"; /* 是否删除*/
public static final String FIELD_INVENT_RECORD_ID = "inventRecordId"; /* 存货档案ID*/
public static final String FIELD_FACTORY_CODE = "factoryCode"; /* 厂区编码*/
public static final String FIELD_FACTORY_NAME = "factoryName"; /* 工厂*/
public static final String COL_ID = "ID"; /* ID*/
public static final String COL_COMPANY_CODE = "COMPANY_CODE"; /* 企业编码 预留*/
public static final String COL_DEP_CODE = "DEP_CODE"; /* 部门编码 预留*/
public static final String COL_RECEIPT_DATE = "RECEIPT_DATE"; /* 票据日期*/
public static final String COL_RETURN_NO = "RETURN_NO"; /* 退货单号*/
public static final String COL_SALE_NO = "SALE_NO"; /* 销售单号*/
public static final String COL_WH_CODE = "WH_CODE"; /* 仓库编码*/
public static final String COL_WH_NAME = "WH_NAME"; /* 仓库名称*/
public static final String COL_PROD_NO = "PROD_NO"; /* 生产订单号*/
public static final String COL_PROJ_CODE = "PROJ_CODE"; /* 项目号*/
public static final String COL_PROJ_NAME = "PROJ_NAME"; /* 项目名称*/
public static final String COL_INVENT_CODE = "INVENT_CODE"; /* 部件编码*/
public static final String COL_INVENT_NAME = "INVENT_NAME"; /* 部件名称*/
public static final String COL_SUB_INVENT_CODE = "SUB_INVENT_CODE"; /* 零件编码*/
public static final String COL_SUB_INVENT_NAME = "SUB_INVENT_NAME"; /* 零件名称*/
public static final String COL_LENGTH = "LENGTH"; /* 长*/
public static final String COL_WIDTH = "WIDTH"; /* 宽*/
public static final String COL_THICK = "THICK"; /* 厚*/
public static final String COL_AMOUNT = "AMOUNT"; /* 数量*/
public static final String COL_UNIT_WEIGHT = "UNIT_WEIGHT"; /* 单重*/
public static final String COL_WEIGHT = "WEIGHT"; /* 重量*/
public static final String COL_REMARK = "REMARK"; /* 备注*/
public static final String COL_KC_ID = "KC_ID"; /* 库存ID*/
public static final String COL_OLD_RETURN_NO = "OLD_RETURN_NO"; /* 原退货单号*/
public static final String COL_RETURN_STATUS = "RETURN_STATUS"; /* 退货状态 0,退货中,1,退货完成(已收货)*/
public static final String COL_CREATED_BY = "CREATED_BY"; /* 创建人*/
public static final String COL_CREATED_NAME = "CREATED_NAME"; /* 创建人名称*/
public static final String COL_CREATED_TIME = "CREATED_TIME"; /* 创建时间*/
public static final String COL_UPDATED_BY = "UPDATED_BY"; /* 修改人*/
public static final String COL_UPDATED_NAME = "UPDATED_NAME"; /* 修改人名称*/
public static final String COL_UPDATED_TIME = "UPDATED_TIME"; /* 修改时间*/
public static final String COL_DELETE_FLAG = "DELETE_FLAG"; /* 是否删除*/
public static final String COL_INVENT_RECORD_ID = "INVENT_RECORD_ID"; /* 存货档案ID*/
public static final String COL_FACTORY_CODE = "FACTORY_CODE"; /* 厂区编码*/
public static final String COL_FACTORY_NAME = "FACTORY_NAME"; /* 工厂*/
public static final String QUERY = "HPKC0013.query";
public static final String COUNT = "HPKC0013.count";
public static final String INSERT = "HPKC0013.insert";
public static final String UPDATE = "HPKC0013.update";
public static final String DELETE = "HPKC0013.delete";
private Long id; /* ID*/
private String companyCode = " "; /* 企业编码 预留*/
private String depCode = " "; /* 部门编码 预留*/
private String receiptDate = " "; /* 票据日期*/
private String returnNo = " "; /* 退货单号*/
private String saleNo = " "; /* 销售单号*/
private String whCode = " "; /* 仓库编码*/
private String whName = " "; /* 仓库名称*/
private String prodNo = " "; /* 生产订单号*/
private String projCode = " "; /* 项目号*/
private String projName = " "; /* 项目名称*/
private String inventCode = " "; /* 部件编码*/
private String inventName = " "; /* 部件名称*/
private String subInventCode = " "; /* 零件编码*/
private String subInventName = " "; /* 零件名称*/
private BigDecimal length = new BigDecimal("0"); /* 长*/
private BigDecimal width = new BigDecimal("0"); /* 宽*/
private BigDecimal thick = new BigDecimal("0"); /* 厚*/
private BigDecimal amount = new BigDecimal(0.000); /* 数量*/
private BigDecimal unitWeight = new BigDecimal(0.000); /* 单重*/
private BigDecimal weight = new BigDecimal(0.000); /* 重量*/
private String remark = " "; /* 备注*/
private Long kcId; /* 库存ID*/
private String oldReturnNo = " "; /* 原退货单号*/
private Integer returnStatus; /* 退货状态 0,退货中,1,退货完成(已收货)*/
private String createdBy = " "; /* 创建人*/
private String createdName = " "; /* 创建人名称*/
private String createdTime = " "; /* 创建时间*/
private String updatedBy = " "; /* 修改人*/
private String updatedName = " "; /* 修改人名称*/
private String updatedTime = " "; /* 修改时间*/
private Integer deleteFlag; /* 是否删除*/
private Long inventRecordId = new Long(0); /* 存货档案ID*/
private String factoryCode = " "; /* 厂区编码*/
private String factoryName = " "; /* 工厂*/
/**
* initialize the metadata.
*/
public void initMetaData() {
EiColumn eiColumn;
eiColumn = new EiColumn(FIELD_ID);
eiColumn.setPrimaryKey(true);
eiColumn.setDescName("ID");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_COMPANY_CODE);
eiColumn.setDescName("企业编码 预留");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DEP_CODE);
eiColumn.setDescName("部门编码 预留");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_RECEIPT_DATE);
eiColumn.setDescName("票据日期");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_RETURN_NO);
eiColumn.setDescName("退货单号");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_SALE_NO);
eiColumn.setDescName("销售单号");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_WH_CODE);
eiColumn.setDescName("仓库编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_WH_NAME);
eiColumn.setDescName("仓库名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_PROD_NO);
eiColumn.setDescName("生产订单号");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_PROJ_CODE);
eiColumn.setDescName("项目号");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_PROJ_NAME);
eiColumn.setDescName("项目名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_INVENT_CODE);
eiColumn.setDescName("部件编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_INVENT_NAME);
eiColumn.setDescName("部件名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_SUB_INVENT_CODE);
eiColumn.setDescName("零件编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_SUB_INVENT_NAME);
eiColumn.setDescName("零件名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_LENGTH);
eiColumn.setType("N");
eiColumn.setScaleLength(3);
eiColumn.setFieldLength(12);
eiColumn.setDescName("长");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_WIDTH);
eiColumn.setType("N");
eiColumn.setScaleLength(3);
eiColumn.setFieldLength(12);
eiColumn.setDescName("宽");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_THICK);
eiColumn.setType("N");
eiColumn.setScaleLength(3);
eiColumn.setFieldLength(12);
eiColumn.setDescName("厚");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_AMOUNT);
eiColumn.setType("N");
eiColumn.setScaleLength(3);
eiColumn.setFieldLength(15);
eiColumn.setDescName("数量");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_UNIT_WEIGHT);
eiColumn.setType("N");
eiColumn.setScaleLength(3);
eiColumn.setFieldLength(15);
eiColumn.setDescName("单重");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_WEIGHT);
eiColumn.setType("N");
eiColumn.setScaleLength(3);
eiColumn.setFieldLength(15);
eiColumn.setDescName("重量");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_REMARK);
eiColumn.setDescName("备注");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_KC_ID);
eiColumn.setDescName("库存ID");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_OLD_RETURN_NO);
eiColumn.setDescName("原退货单号");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_RETURN_STATUS);
eiColumn.setDescName("退货状态:0.退货中1.退货完成(已收货)");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CREATED_BY);
eiColumn.setDescName("创建人");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CREATED_NAME);
eiColumn.setDescName("创建人名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CREATED_TIME);
eiColumn.setDescName("创建时间");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_UPDATED_BY);
eiColumn.setDescName("修改人");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_UPDATED_NAME);
eiColumn.setDescName("修改人名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_UPDATED_TIME);
eiColumn.setDescName("修改时间");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DELETE_FLAG);
eiColumn.setDescName("是否删除");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_INVENT_RECORD_ID);
eiColumn.setDescName("存货档案ID");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_FACTORY_CODE);
eiColumn.setDescName("厂区编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_FACTORY_NAME);
eiColumn.setDescName("工厂");
eiMetadata.addMeta(eiColumn);
}
/**
* the constructor.
*/
public HPKC013() {
initMetaData();
}
/**
* get the id - ID.
* @return the id
*/
public Long getId() {
return this.id;
}
/**
* set the id - ID.
*
* @param id - ID
*/
public void setId(Long id) {
this.id = id;
}
/**
* get the companyCode - 企业编码 预留.
* @return the companyCode
*/
public String getCompanyCode() {
return this.companyCode;
}
/**
* set the companyCode - 企业编码 预留.
*
* @param companyCode - 企业编码 预留
*/
public void setCompanyCode(String companyCode) {
this.companyCode = companyCode;
}
/**
* get the depCode - 部门编码 预留.
* @return the depCode
*/
public String getDepCode() {
return this.depCode;
}
/**
* set the depCode - 部门编码 预留.
*
* @param depCode - 部门编码 预留
*/
public void setDepCode(String depCode) {
this.depCode = depCode;
}
/**
* get the receiptDate - 票据日期.
* @return the receiptDate
*/
public String getReceiptDate() {
return this.receiptDate;
}
/**
* set the receiptDate - 票据日期.
*
* @param receiptDate - 票据日期
*/
public void setReceiptDate(String receiptDate) {
this.receiptDate = receiptDate;
}
public String getReturnNo() {
return returnNo;
}
public void setReturnNo(String returnNo) {
this.returnNo = returnNo;
}
/**
* get the saleNo - 销售单号.
* @return the saleNo
*/
public String getSaleNo() {
return this.saleNo;
}
/**
* set the saleNo - 销售单号.
*
* @param saleNo - 销售单号
*/
public void setSaleNo(String saleNo) {
this.saleNo = saleNo;
}
/**
* get the whCode - 仓库编码.
* @return the whCode
*/
public String getWhCode() {
return this.whCode;
}
/**
* set the whCode - 仓库编码.
*
* @param whCode - 仓库编码
*/
public void setWhCode(String whCode) {
this.whCode = whCode;
}
/**
* get the whName - 仓库名称.
* @return the whName
*/
public String getWhName() {
return this.whName;
}
/**
* set the whName - 仓库名称.
*
* @param whName - 仓库名称
*/
public void setWhName(String whName) {
this.whName = whName;
}
/**
* get the prodNo - 生产订单号.
* @return the prodNo
*/
public String getProdNo() {
return this.prodNo;
}
/**
* set the prodNo - 生产订单号.
*
* @param prodNo - 生产订单号
*/
public void setProdNo(String prodNo) {
this.prodNo = prodNo;
}
/**
* get the projCode - 项目号.
* @return the projCode
*/
public String getProjCode() {
return this.projCode;
}
/**
* set the projCode - 项目号.
*
* @param projCode - 项目号
*/
public void setProjCode(String projCode) {
this.projCode = projCode;
}
/**
* get the projName - 项目名称.
* @return the projName
*/
public String getProjName() {
return this.projName;
}
/**
* set the projName - 项目名称.
*
* @param projName - 项目名称
*/
public void setProjName(String projName) {
this.projName = projName;
}
/**
* get the inventCode - 部件编码.
* @return the inventCode
*/
public String getInventCode() {
return this.inventCode;
}
/**
* set the inventCode - 部件编码.
*
* @param inventCode - 部件编码
*/
public void setInventCode(String inventCode) {
this.inventCode = inventCode;
}
/**
* get the inventName - 部件名称.
* @return the inventName
*/
public String getInventName() {
return this.inventName;
}
/**
* set the inventName - 部件名称.
*
* @param inventName - 部件名称
*/
public void setInventName(String inventName) {
this.inventName = inventName;
}
/**
* get the subInventCode - 零件编码.
* @return the subInventCode
*/
public String getSubInventCode() {
return this.subInventCode;
}
/**
* set the subInventCode - 零件编码.
*
* @param subInventCode - 零件编码
*/
public void setSubInventCode(String subInventCode) {
this.subInventCode = subInventCode;
}
/**
* get the subInventName - 零件名称.
* @return the subInventName
*/
public String getSubInventName() {
return this.subInventName;
}
/**
* set the subInventName - 零件名称.
*
* @param subInventName - 零件名称
*/
public void setSubInventName(String subInventName) {
this.subInventName = subInventName;
}
/**
* get the length - 长.
* @return the length
*/
public BigDecimal getLength() {
return this.length;
}
/**
* set the length - 长.
*
* @param length - 长
*/
public void setLength(BigDecimal length) {
this.length = length;
}
/**
* get the width - 宽.
* @return the width
*/
public BigDecimal getWidth() {
return this.width;
}
/**
* set the width - 宽.
*
* @param width - 宽
*/
public void setWidth(BigDecimal width) {
this.width = width;
}
/**
* get the thick - 厚.
* @return the thick
*/
public BigDecimal getThick() {
return this.thick;
}
/**
* set the thick - 厚.
*
* @param thick - 厚
*/
public void setThick(BigDecimal thick) {
this.thick = thick;
}
/**
* get the amount - 数量.
* @return the amount
*/
public BigDecimal getAmount() {
return this.amount;
}
/**
* set the amount - 数量.
*
* @param amount - 数量
*/
public void setAmount(BigDecimal amount) {
this.amount = amount;
}
/**
* get the unitWeight - 单重.
* @return the unitWeight
*/
public BigDecimal getUnitWeight() {
return this.unitWeight;
}
/**
* set the unitWeight - 单重.
*
* @param unitWeight - 单重
*/
public void setUnitWeight(BigDecimal unitWeight) {
this.unitWeight = unitWeight;
}
/**
* get the weight - 重量.
* @return the weight
*/
public BigDecimal getWeight() {
return this.weight;
}
/**
* set the weight - 重量.
*
* @param weight - 重量
*/
public void setWeight(BigDecimal weight) {
this.weight = weight;
}
/**
* get the remark - 备注.
* @return the remark
*/
public String getRemark() {
return this.remark;
}
/**
* set the remark - 备注.
*
* @param remark - 备注
*/
public void setRemark(String remark) {
this.remark = remark;
}
/**
* get the kcId - 库存ID.
* @return the kcId
*/
public Long getKcId() {
return this.kcId;
}
/**
* set the kcId - 库存ID.
*
* @param kcId - 库存ID
*/
public void setKcId(Long kcId) {
this.kcId = kcId;
}
/**
* get the oldReturnNo - 原退货单号.
* @return the oldReturnNo
*/
public String getOldReturnNo() {
return this.oldReturnNo;
}
/**
* set the oldReturnNo - 原退货单号.
*
* @param oldReturnNo - 原退货单号
*/
public void setOldReturnNo(String oldReturnNo) {
this.oldReturnNo = oldReturnNo;
}
/**
* get the createdBy - 创建人.
* @return the createdBy
*/
public String getCreatedBy() {
return this.createdBy;
}
/**
* set the createdBy - 创建人.
*
* @param createdBy - 创建人
*/
public void setCreatedBy(String createdBy) {
this.createdBy = createdBy;
}
/**
* get the createdName - 创建人名称.
* @return the createdName
*/
public String getCreatedName() {
return this.createdName;
}
/**
* set the createdName - 创建人名称.
*
* @param createdName - 创建人名称
*/
public void setCreatedName(String createdName) {
this.createdName = createdName;
}
/**
* get the createdTime - 创建时间.
* @return the createdTime
*/
public String getCreatedTime() {
return this.createdTime;
}
/**
* set the createdTime - 创建时间.
*
* @param createdTime - 创建时间
*/
public void setCreatedTime(String createdTime) {
this.createdTime = createdTime;
}
/**
* get the updatedBy - 修改人.
* @return the updatedBy
*/
public String getUpdatedBy() {
return this.updatedBy;
}
/**
* set the updatedBy - 修改人.
*
* @param updatedBy - 修改人
*/
public void setUpdatedBy(String updatedBy) {
this.updatedBy = updatedBy;
}
/**
* get the updatedName - 修改人名称.
* @return the updatedName
*/
public String getUpdatedName() {
return this.updatedName;
}
/**
* set the updatedName - 修改人名称.
*
* @param updatedName - 修改人名称
*/
public void setUpdatedName(String updatedName) {
this.updatedName = updatedName;
}
/**
* get the updatedTime - 修改时间.
* @return the updatedTime
*/
public String getUpdatedTime() {
return this.updatedTime;
}
/**
* set the updatedTime - 修改时间.
*
* @param updatedTime - 修改时间
*/
public void setUpdatedTime(String updatedTime) {
this.updatedTime = updatedTime;
}
/**
* get the deleteFlag - 是否删除.
* @return the deleteFlag
*/
public Integer getDeleteFlag() {
return this.deleteFlag;
}
/**
* set the deleteFlag - 是否删除.
*
* @param deleteFlag - 是否删除
*/
public void setDeleteFlag(Integer deleteFlag) {
this.deleteFlag = deleteFlag;
}
/**
* get the inventRecordId - 存货档案ID.
* @return the inventRecordId
*/
public Long getInventRecordId() {
return this.inventRecordId;
}
/**
* set the inventRecordId - 存货档案ID.
*
* @param inventRecordId - 存货档案ID
*/
public void setInventRecordId(Long inventRecordId) {
this.inventRecordId = inventRecordId;
}
/**
* get the factoryCode - 厂区编码.
* @return the factoryCode
*/
public String getFactoryCode() {
return this.factoryCode;
}
/**
* set the factoryCode - 厂区编码.
*
* @param factoryCode - 厂区编码
*/
public void setFactoryCode(String factoryCode) {
this.factoryCode = factoryCode;
}
/**
* get the factoryName - 工厂.
* @return the factoryName
*/
public String getFactoryName() {
return this.factoryName;
}
/**
* set the factoryName - 工厂.
*
* @param factoryName - 工厂
*/
public void setFactoryName(String factoryName) {
this.factoryName = factoryName;
}
public Integer getReturnStatus() {
return returnStatus;
}
public void setReturnStatus(Integer returnStatus) {
this.returnStatus = returnStatus;
}
/**
* get the value from Map.
*
* @param map - source data map
*/
@Override
public void fromMap(Map map) {
setId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_ID)), id));
setCompanyCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_COMPANY_CODE)), companyCode));
setDepCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DEP_CODE)), depCode));
setReceiptDate(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_RECEIPT_DATE)), receiptDate));
setReturnNo(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_RETURN_NO)), returnNo));
setSaleNo(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_SALE_NO)), saleNo));
setWhCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_WH_CODE)), whCode));
setWhName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_WH_NAME)), whName));
setProdNo(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PROD_NO)), prodNo));
setProjCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PROJ_CODE)), projCode));
setProjName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PROJ_NAME)), projName));
setInventCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_INVENT_CODE)), inventCode));
setInventName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_INVENT_NAME)), inventName));
setSubInventCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_SUB_INVENT_CODE)), subInventCode));
setSubInventName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_SUB_INVENT_NAME)), subInventName));
setLength(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_LENGTH)), length));
setWidth(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_WIDTH)), width));
setThick(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_THICK)), thick));
setAmount(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_AMOUNT)), amount));
setUnitWeight(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_UNIT_WEIGHT)), unitWeight));
setWeight(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_WEIGHT)), weight));
setRemark(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_REMARK)), remark));
setKcId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_KC_ID)), kcId));
setOldReturnNo(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_OLD_RETURN_NO)), oldReturnNo));
setReturnStatus(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_RETURN_STATUS)), returnStatus));
setCreatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_BY)), createdBy));
setCreatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_NAME)), createdName));
setCreatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_TIME)), createdTime));
setUpdatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_BY)), updatedBy));
setUpdatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_NAME)), updatedName));
setUpdatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_TIME)), updatedTime));
setDeleteFlag(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_DELETE_FLAG)), deleteFlag));
setInventRecordId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_INVENT_RECORD_ID)), inventRecordId));
setFactoryCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_FACTORY_CODE)), factoryCode));
setFactoryName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_FACTORY_NAME)), factoryName));
}
/**
* set the value to Map.
*/
@Override
public Map toMap() {
Map map = new HashMap();
map.put(FIELD_ID, StringUtils.toString(id, eiMetadata.getMeta(FIELD_ID)));
map.put(FIELD_COMPANY_CODE, StringUtils.toString(companyCode, eiMetadata.getMeta(FIELD_COMPANY_CODE)));
map.put(FIELD_DEP_CODE, StringUtils.toString(depCode, eiMetadata.getMeta(FIELD_DEP_CODE)));
map.put(FIELD_RECEIPT_DATE, StringUtils.toString(receiptDate, eiMetadata.getMeta(FIELD_RECEIPT_DATE)));
map.put(FIELD_RETURN_NO, StringUtils.toString(returnNo, eiMetadata.getMeta(FIELD_RETURN_NO)));
map.put(FIELD_SALE_NO, StringUtils.toString(saleNo, eiMetadata.getMeta(FIELD_SALE_NO)));
map.put(FIELD_WH_CODE, StringUtils.toString(whCode, eiMetadata.getMeta(FIELD_WH_CODE)));
map.put(FIELD_WH_NAME, StringUtils.toString(whName, eiMetadata.getMeta(FIELD_WH_NAME)));
map.put(FIELD_PROD_NO, StringUtils.toString(prodNo, eiMetadata.getMeta(FIELD_PROD_NO)));
map.put(FIELD_PROJ_CODE, StringUtils.toString(projCode, eiMetadata.getMeta(FIELD_PROJ_CODE)));
map.put(FIELD_PROJ_NAME, StringUtils.toString(projName, eiMetadata.getMeta(FIELD_PROJ_NAME)));
map.put(FIELD_INVENT_CODE, StringUtils.toString(inventCode, eiMetadata.getMeta(FIELD_INVENT_CODE)));
map.put(FIELD_INVENT_NAME, StringUtils.toString(inventName, eiMetadata.getMeta(FIELD_INVENT_NAME)));
map.put(FIELD_SUB_INVENT_CODE, StringUtils.toString(subInventCode, eiMetadata.getMeta(FIELD_SUB_INVENT_CODE)));
map.put(FIELD_SUB_INVENT_NAME, StringUtils.toString(subInventName, eiMetadata.getMeta(FIELD_SUB_INVENT_NAME)));
map.put(FIELD_LENGTH, StringUtils.toString(length, eiMetadata.getMeta(FIELD_LENGTH)));
map.put(FIELD_WIDTH, StringUtils.toString(width, eiMetadata.getMeta(FIELD_WIDTH)));
map.put(FIELD_THICK, StringUtils.toString(thick, eiMetadata.getMeta(FIELD_THICK)));
map.put(FIELD_AMOUNT, StringUtils.toString(amount, eiMetadata.getMeta(FIELD_AMOUNT)));
map.put(FIELD_UNIT_WEIGHT, StringUtils.toString(unitWeight, eiMetadata.getMeta(FIELD_UNIT_WEIGHT)));
map.put(FIELD_WEIGHT, StringUtils.toString(weight, eiMetadata.getMeta(FIELD_WEIGHT)));
map.put(FIELD_REMARK, StringUtils.toString(remark, eiMetadata.getMeta(FIELD_REMARK)));
map.put(FIELD_KC_ID, StringUtils.toString(kcId, eiMetadata.getMeta(FIELD_KC_ID)));
map.put(FIELD_OLD_RETURN_NO, StringUtils.toString(oldReturnNo, eiMetadata.getMeta(FIELD_OLD_RETURN_NO)));
map.put(FIELD_RETURN_STATUS, StringUtils.toString(returnStatus, eiMetadata.getMeta(FIELD_RETURN_STATUS)));
map.put(FIELD_CREATED_BY, StringUtils.toString(createdBy, eiMetadata.getMeta(FIELD_CREATED_BY)));
map.put(FIELD_CREATED_NAME, StringUtils.toString(createdName, eiMetadata.getMeta(FIELD_CREATED_NAME)));
map.put(FIELD_CREATED_TIME, StringUtils.toString(createdTime, eiMetadata.getMeta(FIELD_CREATED_TIME)));
map.put(FIELD_UPDATED_BY, StringUtils.toString(updatedBy, eiMetadata.getMeta(FIELD_UPDATED_BY)));
map.put(FIELD_UPDATED_NAME, StringUtils.toString(updatedName, eiMetadata.getMeta(FIELD_UPDATED_NAME)));
map.put(FIELD_UPDATED_TIME, StringUtils.toString(updatedTime, eiMetadata.getMeta(FIELD_UPDATED_TIME)));
map.put(FIELD_DELETE_FLAG, StringUtils.toString(deleteFlag, eiMetadata.getMeta(FIELD_DELETE_FLAG)));
map.put(FIELD_INVENT_RECORD_ID, StringUtils.toString(inventRecordId, eiMetadata.getMeta(FIELD_INVENT_RECORD_ID)));
map.put(FIELD_FACTORY_CODE, StringUtils.toString(factoryCode, eiMetadata.getMeta(FIELD_FACTORY_CODE)));
map.put(FIELD_FACTORY_NAME, StringUtils.toString(factoryName, eiMetadata.getMeta(FIELD_FACTORY_NAME)));
return map;
}
}
......@@ -3,12 +3,14 @@ package com.baosight.hpjx.hp.kc.service;
import com.baosight.hpjx.aspect.annotation.OperationLogAnnotation;
import com.baosight.hpjx.common.DdynamicEnum;
import com.baosight.hpjx.common.InventTypeEnum;
import com.baosight.hpjx.common.ReturnStatusEnum;
import com.baosight.hpjx.core.constant.CommonConstant;
import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.hp.constant.HPConstant;
import com.baosight.hpjx.hp.kc.domain.HPKC004;
import com.baosight.hpjx.hp.kc.domain.HPKC010;
import com.baosight.hpjx.hp.kc.domain.HPKC011;
import com.baosight.hpjx.hp.kc.domain.HPKC013;
import com.baosight.hpjx.hp.kc.tools.HPKCTools;
import com.baosight.hpjx.util.BeanUtils;
import com.baosight.hpjx.util.CommonMethod;
......@@ -138,4 +140,39 @@ public class ServiceHPKC004 extends ServiceBase {
}
return inInfo;
}
/**
* 删除操作
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "销售出库单",operType = "修改",operDesc = "申请退货")
public EiInfo returnApply(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 销售单号
List<String> saleNos = ObjectUtils.listKey(resultRows, "saleNo");
// 锁记录
HPKCTools.HpKc004.lock(saleNos);
for (int i = 0; i < resultRows.size(); i++) {
HPKC004 fKc004 = new HPKC004();
fKc004.fromMap(resultRows.get(i));
DaoUtils.update("HPKC004.returnApply", fKc004);
HPKC013 hpkc013 = new HPKC013();
BeanUtils.copyProperties(fKc004,hpkc013);
hpkc013.setReturnNo(SequenceGenerator.getNextSequence(HPConstant.SequenceId.HPKC013_RETURN_NO));
hpkc013.setReturnStatus(ReturnStatusEnum.RETURNING.getCode());
DaoUtils.update(HPKC013.INSERT, hpkc013);
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据删除成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "删除失败");
}
return inInfo;
}
}
package com.baosight.hpjx.hp.kc.service;
import com.baosight.hpjx.aspect.annotation.OperationLogAnnotation;
import com.baosight.hpjx.common.DdynamicEnum;
import com.baosight.hpjx.common.InventTypeEnum;
import com.baosight.hpjx.common.ReturnStatusEnum;
import com.baosight.hpjx.core.constant.CommonConstant;
import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.hp.constant.HPConstant;
import com.baosight.hpjx.hp.kc.domain.HPKC004;
import com.baosight.hpjx.hp.kc.domain.HPKC013;
import com.baosight.hpjx.hp.kc.domain.HPKC010;
import com.baosight.hpjx.hp.kc.domain.HPKC011;
import com.baosight.hpjx.hp.kc.tools.HPKCTools;
import com.baosight.hpjx.util.*;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.service.impl.ServiceBase;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import org.apache.commons.collections.MapUtils;
import java.math.BigDecimal;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class ServiceHPKC013 extends ServiceBase {
// 指定存货类型
private static final Integer[] DEFAULT_INVENT_CODE = {InventTypeEnum.RAW.getCode(),
InventTypeEnum.CONSUMABLE.getCode(), InventTypeEnum.SEMI_FINISHED_PRODUCT.getCode(),
InventTypeEnum.FINISHED_PRODUCT.getCode()};
/**
* 画面初始化
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "退货单",operType = "查询",operDesc = "初始化")
public EiInfo initLoad(EiInfo inInfo) {
try {
Map queryMap = new HashMap();
queryMap.put("inventTypes", DEFAULT_INVENT_CODE);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.WH_RECORD_BLOCK_ID), queryMap);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_NAME_BLOCK_ID), queryMap);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_SPEC_BLOCK_ID), queryMap, false);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.SPEC_NAME_BLOCK_ID), queryMap, false);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.FACTORY_RECORD_BLOCK_ID), null, false);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HPKC013().eiMetadata);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询操作
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "退货单",operType = "查询",operDesc = "查询")
@Override
public EiInfo query(EiInfo inInfo) {
try {
Map queryRow = EiInfoUtils.getFirstRow(inInfo);
String receiptDate = MapUtils.getString(queryRow, "receiptDate");
queryRow.put("receiptDate", StringUtil.removeSpecifiedCharacter(receiptDate,
StringUtil.DEFAULT_CHARACTER_TO_BE_REMOVED));
queryRow.put("inventTypes", DEFAULT_INVENT_CODE);
inInfo = super.query(inInfo, HPKC013.QUERY, new HPKC013());
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
@OperationLogAnnotation(operModul = "确认收货",operType = "修改",operDesc = "退货确认收货")
public EiInfo comfirmReturn(EiInfo inInfo){
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 退货单号
List<String> returnNos = ObjectUtils.listKey(resultRows, "returnNo");
// 锁记录
HPKCTools.HpKc013.lock(returnNos);
// 查询数据库记录
Map<String, HPKC013> mapKc013 = HPKCTools.HpKc013.map(returnNos);
for (int i = 0; i < resultRows.size(); i++) {
HPKC011 hpkc011 = null;
HPKC010 hpkc010 = null;
HPKC013 fKc013 = new HPKC013();
fKc013.fromMap(resultRows.get(i));
if (!fKc013.getSubInventCode().equals(" ")) {
hpkc011 = HPKCTools.HpKc011.listById(fKc013.getKcId());
}else {
hpkc010 = HPKCTools.HpKc010.listById(fKc013.getKcId());
}
HPKC013 dbKc013 = mapKc013.get(fKc013.getReturnNo());
if(dbKc013.getReturnStatus().compareTo(ReturnStatusEnum.RETURNING.getCode())==0) {
dbKc013.setReturnStatus(ReturnStatusEnum.RETURNED.getCode());
DaoUtils.update(HPKC013.UPDATE, dbKc013);
// 修改库存
if (hpkc010 != null) {
HPKCTools.updateStock(dbKc013.getWhCode(), hpkc010.getInventRecordId(),
dbKc013.getAmount(), dbKc013.getWeight().multiply(new BigDecimal(1000)), hpkc010.getFactoryCode());
} else {
HPKCTools.updateProdStock(dbKc013.getWhCode(), dbKc013.getProdNo(),
dbKc013.getAmount(), dbKc013.getWeight(), hpkc011.getFactoryCode());
}
}
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据确认收货成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "确认收货失败");
}
return inInfo;
}
/**
* 删除操作
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "退货单",operType = "删除",operDesc = "删除")
public EiInfo delete(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 退货单号
List<String> returnNos = ObjectUtils.listKey(resultRows, "returnNo");
// 锁记录
HPKCTools.HpKc013.lock(returnNos);
// 查询数据库记录
Map<String, HPKC013> mapKc013 = HPKCTools.HpKc013.map(returnNos);
for (int i = 0; i < resultRows.size(); i++) {
HPKC011 hpkc011 = null;
HPKC010 hpkc010 = null;
HPKC013 fKc013 = new HPKC013();
fKc013.fromMap(resultRows.get(i));
if (!fKc013.getSubInventCode().equals(" ")) {
hpkc011 = HPKCTools.HpKc011.listById(fKc013.getKcId());
}else {
hpkc010 = HPKCTools.HpKc010.listById(fKc013.getKcId());
}
DaoUtils.update(HPKC013.DELETE, fKc013);
DaoUtils.update("HPKC004.returnCollback", new HPKC004(){{setSaleNo(fKc013.getSaleNo());}});
// 生成红冲记录
HPKC013 dbKc013 = mapKc013.get(fKc013.getReturnNo());
//已收货的退货单才红冲
if(dbKc013.getReturnStatus().compareTo(ReturnStatusEnum.RETURNED.getCode())==0) {
HPKC013 newKc013 = BeanUtils.copy(dbKc013, HPKC013.class);
newKc013.setReturnNo(SequenceGenerator.getNextSequence(HPConstant.SequenceId.HPKC013_RETURN_NO));
newKc013.setAmount(dbKc013.getAmount().negate());
newKc013.setWeight(dbKc013.getWeight().negate());
newKc013.setOldReturnNo(dbKc013.getSaleNo());
newKc013.setProjCode(dbKc013.getProjCode());
newKc013.setProjName(dbKc013.getProjName());
newKc013.setDeleteFlag(CommonConstant.YesNo.YES_1);
DaoUtils.insert(HPKC013.INSERT, newKc013);
// 修改库存
if (hpkc010 != null) {
HPKCTools.updateStock(dbKc013.getWhCode(), hpkc010.getInventRecordId(),
newKc013.getAmount(), newKc013.getWeight().multiply(new BigDecimal(1000)), hpkc010.getFactoryCode());
} else {
HPKCTools.updateProdStock(dbKc013.getWhCode(), dbKc013.getProdNo(),
newKc013.getAmount(), newKc013.getWeight(), hpkc011.getFactoryCode());
}
}
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据删除成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "删除失败");
}
return inInfo;
}
}
......@@ -100,6 +100,7 @@
<isNotEmpty prepend=" AND " property="isPrint">
IS_PRINT = #isPrint#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deleteFlag">
DELETE_FLAG = #deleteFlag#
</isNotEmpty>
......@@ -184,6 +185,7 @@
KC_ID, <!-- 库存ID -->
OLD_SALE_NO, <!-- 原销售单号 -->
IS_PRINT, <!-- 是否打印:0.否1.是 -->
IS_RENTURN,
CREATED_BY, <!-- 创建人 -->
CREATED_NAME, <!-- 创建人名称 -->
CREATED_TIME, <!-- 创建时间 -->
......@@ -194,7 +196,7 @@
#companyCode#, #depCode#, #receiptDate#, #saleNo#, #whCode#, #whName#, #prodNo#,
#projCode#, #projName#, #inventCode#, #inventName#, #subInventCode#, #subInventName#,
#length#, #width#, #thick#, #amount#, #unitWeight#, #weight#, #remark#, #kcId#,
#oldSaleNo#, #isPrint#, #createdBy#, #createdName#, #createdTime#, #deleteFlag#,#factoryCode#, #factoryName#
#oldSaleNo#, #isPrint#, #isReturn#, #createdBy#, #createdName#, #createdTime#, #deleteFlag#,#factoryCode#, #factoryName#
)
</insert>
......@@ -203,6 +205,16 @@
UPDATE ${hpjxSchema}.T_HPKC004 SET DELETE_FLAG = 1 WHERE ID = #id#
</delete>
<!-- 退货申请 -->
<delete id="returnApply">
UPDATE ${hpjxSchema}.T_HPKC004 SET IS_RENTURN = 1 WHERE ID = #id#
</delete>
<!-- 退货申请回滚 -->
<delete id="returnCollback">
UPDATE ${hpjxSchema}.T_HPKC004 SET IS_RENTURN = 0 WHERE SALE_NO = #saleNo#
</delete>
<update id="update">
UPDATE ${hpjxSchema}.T_HPKC004
SET
......
<?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="HPKC013">
<sql id="column">
ID as "id", <!-- ID -->
COMPANY_CODE as "companyCode", <!-- 企业编码 预留 -->
DEP_CODE as "depCode", <!-- 部门编码 预留 -->
RECEIPT_DATE as "receiptDate", <!-- 票据日期 -->
RETURN_NO as "returnNo",
SALE_NO as "saleNo", <!-- 销售单号 -->
WH_CODE as "whCode", <!-- 仓库编码 -->
WH_NAME as "whName", <!-- 仓库名称 -->
PROD_NO as "prodNo", <!-- 生产订单号 -->
PROJ_CODE as "projCode", <!-- 项目号 -->
PROJ_NAME as "projName", <!-- 项目名称 -->
INVENT_CODE as "inventCode", <!-- 部件编码 -->
INVENT_NAME as "inventName", <!-- 部件名称 -->
SUB_INVENT_CODE as "subInventCode", <!-- 零件编码 -->
SUB_INVENT_NAME as "subInventName", <!-- 零件名称 -->
LENGTH as "length", <!-- 长 -->
WIDTH as "width", <!-- 宽 -->
THICK as "thick", <!-- 厚 -->
AMOUNT as "amount", <!-- 数量 -->
UNIT_WEIGHT as "unitWeight", <!-- 单重 -->
WEIGHT as "weight", <!-- 重量 -->
REMARK as "remark", <!-- 备注 -->
KC_ID as "kcId", <!-- 库存ID -->
OLD_RETURN_NO as "oldReturnNo", <!-- 原销售单号 -->
RETURN_STATUS as "returnStatus", <!-- 退货状态:0.退货中1.退货完成(已收货) -->
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", <!-- 是否删除 -->
FACTORY_CODE as "factoryCode", <!-- 厂区编码 -->
FACTORY_NAME as "factoryName" <!-- 工厂 -->
</sql>
<sql id="authCondition">
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCodes">
DEP_CODE IN <iterate close=")" open="(" conjunction="," property="depCodes">#depCodes[]#</iterate>
</isNotEmpty>
</sql>
<sql id="condition">
<include refid="authCondition"/>
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="receiptDate">
RECEIPT_DATE = #receiptDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="saleNo">
SALE_NO = #saleNo#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="returnNo">
RETURN_NO = #returnNo#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="whCode">
WH_CODE = #whCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="whName">
WH_NAME = #whName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="prodNo">
PROD_NO = #prodNo#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projCode">
PROJ_CODE = #projCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projName">
PROJ_NAME LIKE CONCAT('%', #projName#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventCode">
INVENT_CODE = #inventCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventName">
INVENT_NAME LIKE CONCAT('%', #inventName#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="subInventCode">
SUB_INVENT_CODE = #subInventCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="subInventName">
SUB_INVENT_NAME LIKE CONCAT('%', #subInventName#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="remark">
REMARK = #remark#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="kcId">
KC_ID = #kcId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="oldReturnNo">
OLD_RETURN_NO = #oldReturnNo#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="returnStatus">
RETURN_STATUS = #returnStatus#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deleteFlag">
DELETE_FLAG = #deleteFlag#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryCode">
FACTORY_CODE = #factoryCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryName">
FACTORY_NAME = #factoryName#
</isNotEmpty>
</sql>
<sql id="customCondition">
<isNotEmpty prepend=" AND " property="ids">
ID IN <iterate close=")" open="(" conjunction="," property="ids">#ids[]#</iterate>
</isNotEmpty>
<isNotEmpty prepend=" AND " property="saleNos">
SALE_NO IN <iterate close=")" open="(" conjunction="," property="saleNos">#saleNos[]#</iterate>
</isNotEmpty>
<isNotEmpty prepend=" AND " property="returnNos">
RETURN_NO IN <iterate close=")" open="(" conjunction="," property="returnNos">#returnNos[]#</iterate>
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdDateFrom">
CREATED_TIME &gt;= CONCAT(REPLACE(#createdDateFrom#, '-', ''), '000000')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdDateTo">
CREATED_TIME &lt;= CONCAT(REPLACE(#createdDateTo#, '-', ''), '235959')
</isNotEmpty>
</sql>
<!-- 公共修改字段 -->
<sql id="updateRevise">
UPDATED_BY = #updatedBy#, <!-- 修改人 -->
UPDATED_NAME = #updatedName#, <!-- 修改人名称 -->
UPDATED_TIME = #updatedTime# <!-- 修改时间 -->
</sql>
<sql id="order">
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
ID DESC
</isEmpty>
</dynamic>
</sql>
<select id="query" resultClass="com.baosight.hpjx.hp.kc.domain.HPKC013">
SELECT
<include refid="column"/>
FROM hpjx.T_HPKC013 WHERE 1=1
<include refid="condition"/>
<include refid="customCondition"/>
<include refid="order"/>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM hpjx.T_HPKC013 WHERE 1=1
<include refid="condition"/>
<include refid="customCondition"/>
</select>
<insert id="insert">
INSERT INTO ${hpjxSchema}.T_HPKC013 (
COMPANY_CODE, <!-- 企业编码 预留 -->
DEP_CODE, <!-- 部门编码 预留 -->
RECEIPT_DATE, <!-- 票据日期 -->
RETURN_NO,
SALE_NO, <!-- 销售单号 -->
WH_CODE, <!-- 仓库编码 -->
WH_NAME, <!-- 仓库名称 -->
PROD_NO, <!-- 生产订单号 -->
PROJ_CODE, <!-- 项目号 -->
PROJ_NAME, <!-- 项目名称 -->
INVENT_CODE, <!-- 部件编码 -->
INVENT_NAME, <!-- 部件名称 -->
SUB_INVENT_CODE, <!-- 零件编码 -->
SUB_INVENT_NAME, <!-- 零件名称 -->
LENGTH, <!-- 长 -->
WIDTH, <!-- 宽 -->
THICK, <!-- 厚 -->
AMOUNT, <!-- 数量 -->
UNIT_WEIGHT, <!-- 单重 -->
WEIGHT, <!-- 重量 -->
REMARK, <!-- 备注 -->
KC_ID, <!-- 库存ID -->
OLD_RETURN_NO, <!-- 原销售单号 -->
RETURN_STATUS, <!-- 退货状态:0.退货中1.退货完成(已收货) -->
CREATED_BY, <!-- 创建人 -->
CREATED_NAME, <!-- 创建人名称 -->
CREATED_TIME, <!-- 创建时间 -->
DELETE_FLAG, <!-- 是否删除 -->
FACTORY_CODE, <!-- 厂区编码 -->
FACTORY_NAME <!-- 工厂 -->
) VALUES (
#companyCode#, #depCode#, #receiptDate#, #returnNo#, #saleNo#, #whCode#, #whName#, #prodNo#,
#projCode#, #projName#, #inventCode#, #inventName#, #subInventCode#, #subInventName#,
#length#, #width#, #thick#, #amount#, #unitWeight#, #weight#, #remark#, #kcId#,
#oldReturnNo#, #returnStatus#, #createdBy#, #createdName#, #createdTime#, #deleteFlag#,#factoryCode#, #factoryName#
)
</insert>
<!-- 逻辑删除 -->
<delete id="delete">
UPDATE ${hpjxSchema}.T_HPKC013 SET DELETE_FLAG = 1 WHERE ID = #id#
</delete>
<update id="update">
UPDATE ${hpjxSchema}.T_HPKC013
SET
RECEIPT_DATE = #receiptDate#, <!-- 票据日期 -->
WH_CODE = #whCode#, <!-- 仓库编码 -->
WH_NAME = #whName#, <!-- 仓库名称 -->
PROD_NO = #prodNo#, <!-- 生产订单号 -->
PROJ_CODE = #projCode#, <!-- 项目号 -->
PROJ_NAME = #projName#, <!-- 项目名称 -->
INVENT_CODE = #inventCode#, <!-- 部件编码 -->
INVENT_NAME = #inventName#, <!-- 部件名称 -->
SUB_INVENT_CODE = #subInventCode#, <!-- 零件编码 -->
SUB_INVENT_NAME = #subInventName#, <!-- 零件名称 -->
LENGTH = #length#, <!-- 长 -->
WIDTH = #width#, <!-- 宽 -->
THICK = #thick#, <!-- 厚 -->
AMOUNT = #amount#, <!-- 数量 -->
UNIT_WEIGHT = #unitWeight#, <!-- 单重 -->
WEIGHT = #weight#, <!-- 重量 -->
REMARK = #remark#, <!-- 备注 -->
KC_ID = #kcId#, <!-- 库存ID -->
OLD_RETURN_NO = #oldReturnNo#, <!-- 原销售单号 -->
RETURN_STATUS = #returnStatus#,
UPDATED_BY = #updatedBy#, <!-- 修改人 -->
UPDATED_NAME = #updatedName#, <!-- 修改人名称 -->
UPDATED_TIME = #updatedTime#, <!-- 修改时间 -->
DELETE_FLAG = #deleteFlag#, <!-- 是否删除 -->
FACTORY_CODE = #factoryCode#,
FACTORY_NAME = #factoryName#
WHERE ID = #id#
</update>
<!-- 行锁 -->
<update id="lock">
UPDATE ${hpjxSchema}.T_HPKC013
SET CREATED_TIME = CREATED_TIME
WHERE 1=1
<isNotEmpty prepend=" AND " property="saleNo">
SALE_NO = #saleNo#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="returnNo">
RETURN_NO = #returnNo#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="saleNos">
SALE_NO IN <iterate close=")" open="(" conjunction="," property="saleNos">#saleNos[]#</iterate>
</isNotEmpty>
<isNotEmpty prepend=" AND " property="returnNos">
RETURN_NO IN <iterate close=")" open="(" conjunction="," property="returnNos">#returnNos[]#</iterate>
</isNotEmpty>
</update>
<!-- 修改状态 -->
<update id="updateReturnStatus">
UPDATE ${hpjxSchema}.T_HPKC013
SET RETURN_STATUS = 1,
<include refid="updateRevise"/>
WHERE ID IN <iterate close=")" open="(" conjunction="," property="ids">#ids[]#</iterate>
</update>
<!-- 统计库存 -->
<select id="statDate" resultClass="com.baosight.hpjx.hp.kc.domain.HPKC013">
SELECT
COMPANY_CODE AS "companyCode",
FACTORY_CODE as "factoryCode",
FACTORY_NAME as "factoryName",
DEP_CODE AS "depCode",
WH_CODE AS "whCode",
PROJ_CODE AS "projCode",
INVENT_CODE AS "inventCode",
SUB_INVENT_CODE AS "subInventCode",
COALESCE(SUM(AMOUNT), 0) AS "amount",
COALESCE(SUM(WEIGHT), 0) AS "weight"
FROM ${hpjxSchema}.T_HPKC013
WHERE 1=1
<isNotEmpty prepend=" AND " property="createdTimeFrom">
CREATED_TIME BETWEEN #createdTimeFrom# AND #createdTimeTo#
</isNotEmpty>
GROUP BY COMPANY_CODE, DEP_CODE, WH_CODE, PROJ_CODE, INVENT_CODE, SUB_INVENT_CODE,FACTORY_CODE,FACTORY_NAME
</select>
</sqlMap>
......@@ -3,15 +3,7 @@ package com.baosight.hpjx.hp.kc.tools;
import com.baosight.hpjx.core.dao.DaoBase;
import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.hp.constant.HPSqlConstant;
import com.baosight.hpjx.hp.kc.domain.HPKC001;
import com.baosight.hpjx.hp.kc.domain.HPKC002;
import com.baosight.hpjx.hp.kc.domain.HPKC003;
import com.baosight.hpjx.hp.kc.domain.HPKC004;
import com.baosight.hpjx.hp.kc.domain.HPKC005;
import com.baosight.hpjx.hp.kc.domain.HPKC006;
import com.baosight.hpjx.hp.kc.domain.HPKC007;
import com.baosight.hpjx.hp.kc.domain.HPKC010;
import com.baosight.hpjx.hp.kc.domain.HPKC011;
import com.baosight.hpjx.hp.kc.domain.*;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException;
......@@ -627,6 +619,74 @@ public class HPKCTools {
}
}
/**
* HPKC013 公共方法定义
*
*/
public static class HpKc013 {
/**
* 锁
*
* @param returnNos
* @return
*/
public static void lock(List<String> returnNos) {
if (CollectionUtils.isEmpty(returnNos)) {
return;
}
Map queryMap = new HashMap();
queryMap.put("returnNos", returnNos);
DaoBase.getInstance().update(HPSqlConstant.HPKC013.LOCK, queryMap);
}
/**
* 查询销售出库信息
*
* @param ids
* @return
*/
public static List<HPKC013> listById(List<Long> ids) {
if (CollectionUtils.isEmpty(ids)) {
return null;
}
Map queryMap = new HashMap();
queryMap.put("ids", ids);
return DaoBase.getInstance().query(HPKC013.QUERY, queryMap);
}
/**
* 查询销售出库信息
*
* @param returnNos
* @return
*/
public static List<HPKC013> list(List<String> returnNos) {
if (CollectionUtils.isEmpty(returnNos)) {
return null;
}
Map queryMap = new HashMap();
queryMap.put("returnNos", returnNos);
return DaoBase.getInstance().query(HPKC013.QUERY, queryMap);
}
/**
* 查询销售出库信息
*
* @param returnNos
* @return
*/
public static Map<String, HPKC013> map(List<String> returnNos) {
List<HPKC013> results = list(returnNos);
if (CollectionUtils.isEmpty(results)) {
return null;
}
return results.stream().collect(Collectors.toMap(HPKC013::getReturnNo, item -> item));
}
}
/**
......
package com.baosight.hpjx.hp.mt.service;
import cn.hutool.core.util.PageUtil;
import cn.hutool.core.util.StrUtil;
import com.baosight.hpjx.common.DdynamicEnum;
import com.baosight.hpjx.core.constant.CommonConstant;
import com.baosight.hpjx.core.dao.DaoBase;
import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.core.security.UserSessionUtils;
import com.baosight.hpjx.hp.constant.HPConstant;
import com.baosight.hpjx.hp.constant.HPSqlConstant;
import com.baosight.hpjx.hp.mt.untils.Base64ToMultipartFile;
import com.baosight.hpjx.hp.mt.untils.Base64Utils;
import com.baosight.hpjx.hp.mt.untils.UploadUtils;
import com.baosight.hpjx.hp.mt.untils.UploadUtils2;
import com.baosight.hpjx.hp.sc.domain.HPSC002A;
import com.baosight.hpjx.hp.sc.domain.HPSC005;
import com.baosight.hpjx.hp.xs.domain.User;
import com.baosight.hpjx.hp.zl.domain.HPZL001;
import com.baosight.hpjx.hp.zl.domain.HPZL001A;
......@@ -23,7 +15,6 @@ import com.baosight.hpjx.util.*;
import com.baosight.iplat4j.common.ed.domain.TEDCM01;
import com.baosight.iplat4j.core.ProjectInfo;
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.service.impl.ServiceBase;
......
......@@ -3,18 +3,14 @@ package com.baosight.hpjx.hp.sc.service;
import com.baosight.hpjx.aspect.annotation.OperationLogAnnotation;
import com.baosight.hpjx.common.DdynamicEnum;
import com.baosight.hpjx.core.constant.CommonConstant;
import com.baosight.hpjx.core.dao.DaoBase;
import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.core.security.UserSessionUtils;
import com.baosight.hpjx.hp.constant.HPConstant;
import com.baosight.hpjx.hp.ds.domain.HPDS002;
import com.baosight.hpjx.hp.kc.tools.HPKCTools;
import com.baosight.hpjx.hp.pz.domain.HPPZ015;
import com.baosight.hpjx.hp.pz.tools.HPPZTools;
import com.baosight.hpjx.hp.sc.domain.*;
import com.baosight.hpjx.hp.sc.tools.HPSCTools;
import com.baosight.hpjx.util.*;
import com.baosight.hpjx.util.contants.ACConstants;
import com.baosight.iplat4j.core.ProjectInfo;
import com.baosight.iplat4j.core.ei.EiBlock;
import com.baosight.iplat4j.core.ei.EiConstant;
......@@ -29,7 +25,6 @@ import org.apache.commons.lang.StringUtils;
import java.math.BigDecimal;
import java.text.DecimalFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
......@@ -37,7 +32,6 @@ import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import cn.hutool.core.bean.BeanUtil;
/**
*
......
......@@ -12,6 +12,8 @@ import com.baosight.hpjx.hp.sc.domain.HPSC004;
import com.baosight.hpjx.hp.sc.domain.HPSC005;
import com.baosight.hpjx.hp.sc.domain.HPSC005B;
import com.baosight.hpjx.hp.sc.tools.HPSCTools;
import com.baosight.hpjx.hp.xs.domain.Org;
import com.baosight.hpjx.hp.xs.tools.HPXSTools;
import com.baosight.hpjx.util.AssertUtils;
import com.baosight.hpjx.util.BeanUtils;
import com.baosight.hpjx.util.CommonMethod;
......@@ -27,7 +29,6 @@ import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.service.impl.ServiceBase;
import com.baosight.iplat4j.core.service.soa.XLocalManager;
import com.baosight.iplat4j.core.web.threadlocal.UserSession;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import org.apache.commons.collections.CollectionUtils;
......@@ -297,15 +298,18 @@ public class ServiceHPSC003 extends ServiceBase {
*/
public EiInfo qrcodePlanDetail(EiInfo inInfo) {
try {
// EiInfo callInfo = new EiInfo();
// callInfo.set(EiConstant.serviceName, "");
// callInfo.set(EiConstant.methodName, "");
// XLocalManager.call(callInfo);
String planInfoNo = inInfo.getString(HPSC003.FIELD_PLAN_INFO_NO);
AssertUtils.isNull(planInfoNo, "计划号不能为空");
// 查询计划主信息
HPSC003 dbSc003 = HPSCTools.HpSc003.getByNo(planInfoNo);
Map dbSc003Map = dbSc003.toMap();
// 设置厂区名称
if (StringUtils.isNotBlank(dbSc003.getFactoryCode())) {
Org org = HPXSTools.XsOrg.get(dbSc003.getFactoryCode());
dbSc003Map.put("factoryName", org.getOrgCname());
} else {
dbSc003Map.put("factoryName", "");
}
// 查询计划明细信息
this.buildPlanDetail(dbSc003Map);
inInfo.set("planInfo", dbSc003Map);
......
package com.baosight.hpjx.hp.tc.service;
import com.baosight.hpjx.common.HPConstants;
import com.baosight.hpjx.equipment.hp.domain.CutterbarStatus;
import com.baosight.hpjx.equipment.hp.domain.CutterbarTime;
import com.baosight.hpjx.equipment.hp.domain.CutterbarWarning;
import com.baosight.hpjx.equipment.hp.domain.CutterbarWarningBase;
import com.baosight.hpjx.hp.sb.domain.HPSB001;
import com.baosight.hpjx.hp.sb.domain.HPSB002;
import com.baosight.hpjx.hp.sb.domain.HPSB00A;
import com.baosight.hpjx.util.DateUtils;
import com.baosight.hpjx.util.StringUtils;
import com.baosight.hpjx.xml.XmlUtils;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.service.impl.ServiceBase;
import org.apache.commons.collections.CollectionUtils;
import java.util.ArrayList;
import java.util.List;
public class ServiceHPTCP001 extends ServiceBase {
public EiInfo logAnalysis(EiInfo inInfo) {
HPSB002 hpsb002 = new HPSB002();
HPSB001 hpsb001 = new HPSB001();
EiInfo outInfo = new EiInfo();
//TODO 根据TYPE来判断内容属于哪一种,然后再进行解析
//TODO TYPE = STARUS_TYPE --- 设备状态
//TODO TYPE = TIME_TYPE --- 开机时间
//TODO TYPE = WARNING_TYPE --- 报警内容
String equipmentType = inInfo.getString("equipmentType");
String dataContent = inInfo.getString("dataContent");
String equipmentCode = inInfo.getString("equipmentCode");
HPSB00A hpsb00A = new HPSB00A();
hpsb00A.setDataContent(dataContent);
hpsb00A.setEquipmentType(equipmentType);
hpsb00A.setEquipmentCode(equipmentCode);
if (StringUtils.isNotEmpty(equipmentType)) {
if (equipmentType.equals(HPConstants.STARUS_TYPE)) {
//解析设备状态
List<CutterbarStatus> cutterbarStatusList = XmlUtils.readXml(hpsb00A.getDataContent(), CutterbarStatus.class);
hpsb002.setId(StringUtils.uuid());
hpsb002.setEquipmentCode(hpsb00A.getEquipmentCode());
hpsb002.setEquipmentType(hpsb00A.getEquipmentType());
hpsb002.setLogValue(cutterbarStatusList.get(0).getStatus().toString());
hpsb002.setCreatedBy("自动化中转程序");
hpsb002.setCreatedTime(DateUtils.shortDateTime());
this.dao.insert("HPSB002.insert",hpsb002);
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsg(outInfo.getMsg());
return inInfo;
}
if (equipmentType.equals(HPConstants.TIME_TYPE)) {
//解析开机时间
List<CutterbarTime> cutterbarTimeList = XmlUtils.readXml(hpsb00A.getDataContent(), CutterbarTime.class);
hpsb002.setId(StringUtils.uuid());
hpsb002.setEquipmentCode(hpsb00A.getEquipmentCode());
hpsb002.setEquipmentType(hpsb00A.getEquipmentType());
hpsb002.setLogValue(cutterbarTimeList.get(0).getTime());
hpsb002.setCreatedBy("自动化中转程序");
hpsb002.setCreatedTime(DateUtils.shortDateTime());
this.dao.insert("HPSB002.insert",hpsb002);
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsg(outInfo.getMsg());
return inInfo;
}
if (equipmentType.equals(HPConstants.WARNING_TYPE)) {
//解析报警内容
List<CutterbarWarningBase> cutterbarWarningBaseList = XmlUtils.readXml(hpsb00A.getDataContent(), CutterbarWarningBase.class);
CutterbarWarning cutterbarWarning = new CutterbarWarning();
if (CollectionUtils.isNotEmpty(cutterbarWarningBaseList)) {
cutterbarWarning = CutterbarWarning.convertBase(cutterbarWarningBaseList.get(0));
}
hpsb001.setId(StringUtils.uuid());
hpsb001.setErrorCode(cutterbarWarning.getErrorCode());
hpsb001.setPrio(cutterbarWarning.getPrio());
hpsb001.setProgramNo(cutterbarWarning.getProgramNo());
hpsb001.setRowno(cutterbarWarning.getRowNo());
hpsb001.setGotoRowNone(cutterbarWarning.getGotoRowNone());
hpsb001.setFileName(cutterbarWarning.getFileName());
hpsb001.setEquipmentCode(hpsb00A.getEquipmentCode());
hpsb001.setEquipmentType(hpsb00A.getEquipmentType());
hpsb001.setCreatedBy("自动化中转程序");
hpsb001.setCreatedTime(DateUtils.shortDateTime());
this.dao.insert("HPSB001.insert",hpsb002);
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsg(outInfo.getMsg());
return inInfo;
}
}
inInfo.setStatus(500);
inInfo.setMsg("未解析到数据类型");
return inInfo;
}
}
......@@ -75,7 +75,7 @@
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
CREATED_TIME asc
CREATED_TIME desc
</isEmpty>
</dynamic>
......
......@@ -73,7 +73,7 @@
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
ID asc
CREATED_TIME desc
</isEmpty>
</dynamic>
......
......@@ -4,7 +4,9 @@
<sql id="condition">
AND IS_DELETED = '0'
AND COMPANY_CODE = #companyCode#
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="orgEname">
ORG_ENAME = #orgEname#
</isNotEmpty>
......
......@@ -187,7 +187,7 @@ public class SqlMapDaoLogProxy extends SqlMapDao {
*/
private void setCompanyCode(String name, Object parameters) {
// 需要过滤部分sql name,否则会形成死循环
String[] serviceFilter = {"HPXSUser"};
String[] serviceFilter = {"HPXSUser", "HPPZ009.query"};
if (StringUtils.startsWithAny(name, serviceFilter)) {
return;
}
......
......@@ -29,6 +29,9 @@ $(function () {
// 导出打印
$("#PRINT").on("click", exportPrint);
// 退货
$("#RETURN_APPLY").on("click", returnApply);
});
......@@ -111,3 +114,35 @@ let exportPrint = function () {
window.location = IPLATUI.CONTEXT_PATH + "/HP/KC/HPKC90.jsp?route=1&parameter="
+ encodeURI(encodeURI(JSON.stringify(parameter)));
}
function returnApply(){
//重置全局变量
ids = [];
let rows = resultGrid.getCheckedRows()
if (rows.length < 1) {
message("请至少选择一条需要退货的数据");
return;
}
let factoryCodes = null;
let flag = true;
$.each(rows, function(index, item) {
let isReturn= item.get("isReturn");
if(isReturn == 1){
IPLAT.alert({
message : "选中的出库单已申请退货!",
okFn : function(e) {
},
title : '错误'
});
flag = false;
return false;
}
});
if(flag) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"退货\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HPKC004", "returnApply", true);
}
});
}
}
\ No newline at end of file
......@@ -64,6 +64,9 @@
<EF:EFComboColumn ename="isPrint" cname="是否制单" width="80" align="center">
<EF:EFCodeOption codeName="hpjx.hpjx.isPrint"/>
</EF:EFComboColumn>
<EF:EFComboColumn ename="isReturn" cname="是否退货" width="80" align="center" hidden="true">
<EF:EFCodeOption codeName="hpjx.hpjx.isReturn"/>
</EF:EFComboColumn>
<EF:EFColumn ename="remark" cname="备注" enable="false" width="100" align="center" />
<EF:EFColumn ename="projCode" cname="项目号" enable="false" width="140" align="center" hidden="true"/>
<EF:EFColumn ename="prodNo" cname="生产订单号" enable="false" width="140" align="center" hidden="true"/>
......
$(function () {
IPLATUI.EFGrid = {
"result": {
columns: [{
field: "operator",
template: function (item) {
let returnStatus = item.returnStatus;
let template = '';
if (returnStatus) {
if (returnStatus == 0) {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;" ' +
'onclick="check(' + item.returnNo + ',1)" >确认收货</a>';
}
}
return template;
}
},{
field: "createdName",
template: function (options) {
return showUserName(options.createdBy, options.createdName);
}
}],
loadComplete: function (grid) {
}
},
onSuccess: function (e) {
if(e.eiInfo.extAttr.methodName == 'delete' ){
query();
}
}
}
// 查询
$("#QUERY").on("click", query);
});
/**
* 页面加载时执行
*/
$(window).load(function () {
// 查询
query();
});
/**
* 查询
*/
let query = function () {
resultGrid.dataSource.page(1);
}
function check(returnNo, auditStatus) {
const inEiInfo = new EiInfo();
inEiInfo.set("result-0-returnNo", returnNo);
inEiInfo.set("result-0-returnStatus", returnStatus);
EiCommunicator.send('HPKC013', 'comfirmReturn', inEiInfo, {
onSuccess(response) {
message("提交成功,已生确认收货");
resultGrid.dataSource.page(1);
},
onFail(errorMessage, status, e) {
NotificationUtil("执行失败!", "error");
}
},
{
async: false
}
);
}
\ No newline at end of file
<!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:EFDatePicker cname="单据日期" ename="receiptDate" blockId="inqu_status" row="0" colWidth="3"
format="yyyy-MM-dd" readonly="true"/>
<EF:EFInput cname="退货单号" ename="returnNo" blockId="inqu_status" row="0" colWidth="3"/>
<EF:EFInput cname="项目号" ename="projCode" blockId="inqu_status" row="0" colWidth="3"/>
<EF:EFInput cname="项目名称" ename="projName" blockId="inqu_status" row="0" colWidth="3"/>
</div>
<div class="row">
<EF:EFInput cname="部件名称" ename="inventName" blockId="inqu_status" row="0" colWidth="3"/>
<EF:EFInput cname="零件名称" ename="subInventName" blockId="inqu_status" row="0" colWidth="3"/>
<EF:EFSelect cname="状态" ename="returnStatus" blockId="inqu_status" row="0" colWidth="3" defaultValue="0">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hpjx.hpjx.returnStatus"/>
</EF:EFSelect>
<EF:EFSelect cname="是否删除" ename="deleteFlag" blockId="inqu_status" row="0" colWidth="3" defaultValue="0">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hpjx.hpjx.deleteFlag"/>
</EF:EFSelect>
</div>
<div class="row">
<EF:EFDateSpan startCname="创建日期(从)" endCname="至" startName="createdDateFrom" endName="createdDateTo"
blockId="inqu_status" row="0" role="date" format="yyyy-MM-dd" ratio="3:3" satrtRatio="4:8"
endRatio="4:8" readonly="true">
</EF:EFDateSpan>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row">
<EF:EFColumn ename="id" cname="内码" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="100" align="center"/>
<EF:EFColumn ename="returnNo" cname="退货单号" enable="false" width="140" align="center"/>
<EF:EFColumn ename="receiptDate" cname="单据日期" enable="false" width="90" align="center"
editType="date" dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']"/>
<EF:EFColumn ename="projName" cname="项目名称" enable="false" width="140" align="center"/>
<EF:EFComboColumn ename="factoryCode" enable="false" cname="厂区" width="110" align="center" defaultValue=""
filter="contains" readonly="true">
<EF:EFOptions blockId="factory_record_block_id" valueField="valueField" textField="textField"/>
</EF:EFComboColumn>
<EF:EFComboColumn ename="whCode" cname="仓库名称" enable="false" width="120" align="center"
blockName="wh_record_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#">
</EF:EFComboColumn>
<EF:EFColumn ename="inventName" cname="部件名称/存货名称" enable="false" width="150" align="center"/>
<EF:EFColumn ename="subInventName" cname="零件名称" enable="false" width="120" align="center"/>
<EF:EFComboColumn ename="inventRecordId" cname="规格" enable="false" width="120" align="center" hidden="true"
blockName="invent_spec_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#">
</EF:EFComboColumn>
<EF:EFColumn ename="length" cname="长(MM)" enable="false" width="100" align="right" format="{0:N3}" hidden="true"/>
<EF:EFColumn ename="width" cname="宽(MM)" enable="false" width="100" align="right" format="{0:N3}" hidden="true"/>
<EF:EFColumn ename="thick" cname="厚(MM)" enable="false" width="100" align="right" format="{0:N3}" hidden="true"/>
<EF:EFColumn ename="amount" cname="数量" enable="false" width="100" align="right" format="{0:N0}"/>
<EF:EFColumn ename="unitWeight" cname="单重(KG)" enable="false" width="100" align="right" format="{0:N3}"/>
<EF:EFColumn ename="weight" cname="总重(T)" enable="false" width="100" align="right" format="{0:N3}"/>
<EF:EFComboColumn ename="returnStatus" cname="状态" width="80" align="center">
<EF:EFCodeOption codeName="hpjx.hpjx.returnStatus"/>
</EF:EFComboColumn
<EF:EFColumn ename="remark" cname="备注" enable="false" width="100" align="center" />
<EF:EFColumn ename="projCode" cname="项目号" enable="false" width="140" align="center" hidden="true"/>
<EF:EFColumn ename="prodNo" cname="生产订单号" enable="false" width="140" align="center" hidden="true"/>
<EF:EFColumn ename="oldSaleNo" cname="原销售单号" enable="false" width="140" align="center" hidden="true"/>
<EF:EFColumn ename="inventCode" cname="部件编码" enable="false" width="120" align="center" hidden="true"/>
<EF:EFColumn ename="subInventCode" cname="零件编码" enable="false" width="120" align="center" hidden="true"/>
<EF:EFColumn ename="createdName" cname="创建人" enable="false" width="120" align="center"/>
<EF:EFColumn ename="createdTime" cname="创建时间" enable="false" width="140" align="center"
editType="datetime" parseFormats="['yyyyMMddHHmmss','yyyy-MM-dd HH:mm:ss']"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
......@@ -39,6 +39,16 @@ $(function () {
}
return template;
}
}, {
field: "qrcodeDocId",
template: function (item) {
if (isBlank(item.qrcodeDocId)) {
return "";
} else {
return '<img src="' + downloadHref(item.qrcodeDocId) + '" width="20px" height="20px"'
+ ' onclick="imgClick(\'' + item.qrcodeDocId + '\')" />';
}
}
}],
/**
* 翻页事件,点翻页按钮,输入页数跳转时触发
......@@ -410,3 +420,26 @@ function saveDetail(btn) {
});
}
}
/**
* 图片放大
*/
let imgClick = function (docId) {
// 图片路径
$("#bigImg").attr("src", downloadHref(docId));
$("#bigImg").css({'width': 400});
// 图片淡入
$("#back-curtain").fadeIn("fast");
// 遮罩效果
$("#back-curtain").css({
'position': 'fixed',
'overflow-y': 'auto',
'width': '100%',
'height': '100%',
'z-index': '998'
}).show();
// 点击图片或遮罩,图片淡出
$("#back-curtain").on('click', function () {
$(this).fadeOut("fast");
});
}
......@@ -29,6 +29,7 @@
<EF:EFGrid blockId="result" autoDraw="no" isFloat="true">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="100" align="center"/>
<EF:EFColumn enable="false" ename="qrcodeDocId" cname="二维码" width="50" align="center"/>
<EF:EFColumn enable="false" ename="projCode" cname="项目号" readonly="true" hidden="true"/>
<EF:EFColumn enable="false" ename="planInfoNo" cname="生产计划单号" readonly="true" hidden="true" width="100"/>
<EF:EFColumn enable="false" ename="projName" cname="项目名称" width="120" readonly="true"/>
......@@ -86,3 +87,9 @@
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
<div id="back-curtain" style="position:fixed; top:0; left:0; background:rgba(0,0,0,0.5); z-index:998; width:100%;
display:none;display: flex; justify-content: center; align-items: center;">
<img id="bigImg" src=""/>
</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