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)));
......
......@@ -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
......
......@@ -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