Commit 53634abe by 宋祥

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

parents da554616 b524f46a
...@@ -134,11 +134,18 @@ public enum DdynamicEnum { ...@@ -134,11 +134,18 @@ public enum DdynamicEnum {
/** /**
* 模块:组管理 * 模块:组管理
* 用途:组管理下拉框 * 用途:组管理下拉框
* 编写:songx * 编写:w
*/ */
USER_GROUP_BLOCK_ID("user_group_block_id","groupCode","groupName","factoryCode","HPXSOrg.queryAppGroup"), USER_GROUP_BLOCK_ID("user_group_block_id","groupCode","groupName","factoryCode","HPXSOrg.queryAppGroup"),
/** /**
* 模块:组管理
* 用途:组管理下拉框
* 编写:w
*/
SALE_NO_BLOCK_ID("sale_no_block_id","saleNo","saleNo","HPXS007.getSaleCode"),
/**
* 分厂与组一起查出,用于生产任务分派 * 分厂与组一起查出,用于生产任务分派
*/ */
FACTORY_GROUP_ECORD_BLOCK_ID("factory_group_ecord_block_id","factoryCode","factoryName","groupCode","groupName","HPPZ011.queryComboBoxAll"), FACTORY_GROUP_ECORD_BLOCK_ID("factory_group_ecord_block_id","factoryCode","factoryName","groupCode","groupName","HPPZ011.queryComboBoxAll"),
......
package com.baosight.hpjx.hp.bi.service;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baosight.eplat.be.dz.constants.BEDZConstants;
import com.baosight.hpjx.aspect.annotation.OperationLogAnnotation;
import com.baosight.hpjx.common.InventTypeEnum;
import com.baosight.hpjx.core.security.UserSessionUtils;
import com.baosight.hpjx.util.DateUtils;
import com.baosight.hpjx.util.StringUtils;
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.core.service.soa.XServiceManager;
import java.util.*;
import static com.baosight.eplat.be.dz.service.ServiceBEDZ04.PARAMS_KEY_STR;
/**
* @author wancheng
* @date 2024年02月01日 17:18
*/
public class ServiceHPBI003 extends ServiceBase {
/**
* 查询报屏设备状态
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "设备监控",operType = "查询",operDesc = "查询报屏模块日产量")
public EiInfo querySbStatus(EiInfo inInfo) {
String companyCode = UserSessionUtils.getCompanyCode();
String factoryCode = (String) inInfo.get("factoryCode");
Map sqlMap = new HashMap();
sqlMap.put("companyCode", companyCode);
sqlMap.put("factoryCode", factoryCode);
List<Map> result = this.dao.query("HPBI003.querySbStatus", sqlMap);
inInfo.set("result",result);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
return inInfo;
}
/**
* 日作业率 ba260e11f7014b6ea19be8239cd43218
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "设备监控",operType = "查询",operDesc = "各组组拼加焊综合产量")
public EiInfo queryZYLInfo(EiInfo inInfo) {
String paramsStr = inInfo.getString(PARAMS_KEY_STR);
JSONArray jsonArray = (JSONArray) JSONArray.parse(paramsStr);
JSONObject jsonObject = (JSONObject) jsonArray.get(0);
JSONArray idsArr = (JSONArray) jsonObject.get("ids");
String idsStr = idsArr.getString(0);
EiInfo eiInfo = new EiInfo();
String serviceId = "S_BE_XP_17";
eiInfo.set(EiConstant.serviceId,serviceId);
Map map = new HashMap();
map.put("uuid","ba260e11f7014b6ea19be8239cd43218");
map.put("offset",0);
map.put("limit",1000);
//获取公司代码
String companycode = "%";
if(!StringUtils.isEmpty(UserSessionUtils.getCompanyCode().trim())){
companycode = UserSessionUtils.getCompanyCode();
}
//数据集入参
Map params =new HashMap();
params.put("companycode",companycode);
map.put("params",params);
List list =new ArrayList();
list.add(map);
eiInfo.set("queryInfo",list);
//服务接口调用
EiInfo outInfo = XServiceManager.call(eiInfo);
//调用微服务后的结果
Map result = (Map) outInfo.get("result");
Map result1 = (Map) result.get("ba260e11f7014b6ea19be8239cd43218");
List<Map> list1 = (List) result1.get("data");
JSONArray tempArr = new JSONArray();
String json = "appEname,date,unitCover";
List tempContentList = Arrays.asList(json.split(","));
tempArr.add(tempContentList);
JSONObject item = new JSONObject();
list1.forEach(obj -> {
// 处理obj
List datalist =new ArrayList();
datalist.add(obj.get("SERIES"));
datalist.add(obj.get("X"));
datalist.add(obj.get("VALUE"));
tempArr.add(datalist);
});
JSONArray ids = new JSONArray();
ids.add(idsStr);
item.put("ids", ids);
item.put("component", null);
item.put("data", tempArr);
List list2 =new ArrayList();
list2.add(item);
outInfo.set("result",list2);
return outInfo;
}
/**
* 日故障率 c6bd51e5c73345f2ad7851d4c4aa1820
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "设备监控",operType = "查询",operDesc = "各组组拼加焊综合产量")
public EiInfo queryGZLInfo(EiInfo inInfo) {
String paramsStr = inInfo.getString(PARAMS_KEY_STR);
JSONArray jsonArray = (JSONArray) JSONArray.parse(paramsStr);
JSONObject jsonObject = (JSONObject) jsonArray.get(0);
JSONArray idsArr = (JSONArray) jsonObject.get("ids");
String idsStr = idsArr.getString(0);
EiInfo eiInfo = new EiInfo();
String serviceId = "S_BE_XP_17";
eiInfo.set(EiConstant.serviceId,serviceId);
Map map = new HashMap();
map.put("uuid","c6bd51e5c73345f2ad7851d4c4aa1820");
map.put("offset",0);
map.put("limit",1000);
//获取公司代码
String companycode = "%";
if(!StringUtils.isEmpty(UserSessionUtils.getCompanyCode().trim())){
companycode = UserSessionUtils.getCompanyCode();
}
//数据集入参
Map params =new HashMap();
params.put("companycode",companycode);
map.put("params",params);
List list =new ArrayList();
list.add(map);
eiInfo.set("queryInfo",list);
//服务接口调用
EiInfo outInfo = XServiceManager.call(eiInfo);
//调用微服务后的结果
Map result = (Map) outInfo.get("result");
Map result1 = (Map) result.get("c6bd51e5c73345f2ad7851d4c4aa1820");
List<Map> list1 = (List) result1.get("data");
JSONArray tempArr = new JSONArray();
String json = "appEname,date,unitCover";
List tempContentList = Arrays.asList(json.split(","));
tempArr.add(tempContentList);
JSONObject item = new JSONObject();
list1.forEach(obj -> {
// 处理obj
List datalist =new ArrayList();
datalist.add(obj.get("SERIES"));
datalist.add(obj.get("X"));
datalist.add(obj.get("VALUE"));
tempArr.add(datalist);
});
JSONArray ids = new JSONArray();
ids.add(idsStr);
item.put("ids", ids);
item.put("component", null);
item.put("data", tempArr);
List list2 =new ArrayList();
list2.add(item);
outInfo.set("result",list2);
return outInfo;
}
}
<?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="HPBI003">
<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
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
<isNotEmpty prepend=" AND " property="companyCode">
A.COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryCode">
A.FACTORY_CODE = #factoryCode#
</isNotEmpty>
limit 1
</select>
</sqlMap>
\ No newline at end of file
/**
* Generate time : 2024-04-22 14:15:25
* Version : 1.0
*/
package com.baosight.hpjx.hp.xs.domain;
import com.baosight.iplat4j.core.util.NumberUtils;
import com.baosight.iplat4j.core.ei.EiColumn;
import com.baosight.iplat4j.core.data.DaoEPBase;
import java.util.HashMap;
import java.util.Map;
import com.baosight.iplat4j.core.util.StringUtils;
/**
* THpxs007
*
*/
public class HPXS007 extends DaoEPBase {
private Long id = 0L; /* ID*/
private String companyCode = " "; /* 公司编码*/
private String depCode = " "; /* 部门编码*/
private String createdBy = " "; /* 创建人*/
private String createdName = " "; /* 创建人名称*/
private String createdTime = " "; /* 创建时间*/
private String updatedBy = " "; /* 修改人*/
private String updatedName = " "; /* 修改人名称*/
private String updatedTime = " "; /* 修改时间*/
private Integer deleteFlag; /* 是否删除 0-否1-是*/
private String folDate = " "; /* 回访日期*/
private String delOrderNo = " "; /* 发货单号*/
private Integer folType; /* 回访方式 1-电话回访 2-上门回访*/
private Integer folStatus; /* 回访状态 0-待回访 1-已回访*/
public static final String FIELD_FOL_DATE = "folDate";
public static final String QUERY = "HPXS007.query";
public static final String COUNT = "HPXS007.count";
public static final String INSERT = "HPXS007.insert";
public static final String UPDATE = "HPXS007.update";
public static final String DELETE = "HPXS007.delete";
public static final String CHECK = "HPXS007.check";
/**
* initialize the metadata
*/
public void initMetaData() {
EiColumn eiColumn;
eiColumn = new EiColumn("id");
eiColumn.setPrimaryKey(true);
eiColumn.setDescName("ID");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("companyCode");
eiColumn.setDescName("公司编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("depCode");
eiColumn.setDescName("部门编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("createdBy");
eiColumn.setDescName("创建人");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("createdName");
eiColumn.setDescName("创建人名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("createdTime");
eiColumn.setDescName("创建时间");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("updatedBy");
eiColumn.setDescName("修改人");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("updatedName");
eiColumn.setDescName("修改人名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("updatedTime");
eiColumn.setDescName("修改时间");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("deleteFlag");
eiColumn.setDescName("是否删除 0-否1-是");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("folDate");
eiColumn.setDescName("回访日期");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("delOrderNo");
eiColumn.setDescName("发货单号");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("folType");
eiColumn.setDescName("回访方式 1-电话回访 2-上门回访");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("folStatus");
eiColumn.setDescName("回访状态 0-待回访 1-已回访");
eiMetadata.addMeta(eiColumn);
}
/**
* the constructor
*/
public HPXS007() {
initMetaData();
}
/**
* get the id - ID
* @return the id
*/
public Long getId() {
return this.id;
}
/**
* set the 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 - 公司编码
*/
public void setCompanyCode(String companyCode) {
this.companyCode = companyCode;
}
/**
* get the depCode - 部门编码
* @return the depCode
*/
public String getDepCode() {
return this.depCode;
}
/**
* set the depCode - 部门编码
*/
public void setDepCode(String depCode) {
this.depCode = depCode;
}
/**
* get the createdBy - 创建人
* @return the createdBy
*/
public String getCreatedBy() {
return this.createdBy;
}
/**
* set the createdBy - 创建人
*/
public void setCreatedBy(String createdBy) {
this.createdBy = createdBy;
}
/**
* get the createdName - 创建人名称
* @return the createdName
*/
public String getCreatedName() {
return this.createdName;
}
/**
* set the createdName - 创建人名称
*/
public void setCreatedName(String createdName) {
this.createdName = createdName;
}
/**
* get the createdTime - 创建时间
* @return the createdTime
*/
public String getCreatedTime() {
return this.createdTime;
}
/**
* set the createdTime - 创建时间
*/
public void setCreatedTime(String createdTime) {
this.createdTime = createdTime;
}
/**
* get the updatedBy - 修改人
* @return the updatedBy
*/
public String getUpdatedBy() {
return this.updatedBy;
}
/**
* set the updatedBy - 修改人
*/
public void setUpdatedBy(String updatedBy) {
this.updatedBy = updatedBy;
}
/**
* get the updatedName - 修改人名称
* @return the updatedName
*/
public String getUpdatedName() {
return this.updatedName;
}
/**
* set the updatedName - 修改人名称
*/
public void setUpdatedName(String updatedName) {
this.updatedName = updatedName;
}
/**
* get the updatedTime - 修改时间
* @return the updatedTime
*/
public String getUpdatedTime() {
return this.updatedTime;
}
/**
* set the updatedTime - 修改时间
*/
public void setUpdatedTime(String updatedTime) {
this.updatedTime = updatedTime;
}
/**
* get the deleteFlag - 是否删除 0-否1-是
* @return the deleteFlag
*/
public Integer getDeleteFlag() {
return this.deleteFlag;
}
/**
* set the deleteFlag - 是否删除 0-否1-是
*/
public void setDeleteFlag(Integer deleteFlag) {
this.deleteFlag = deleteFlag;
}
/**
* get the folDate - 回访日期
* @return the folDate
*/
public String getFolDate() {
return this.folDate;
}
/**
* set the folDate - 回访日期
*/
public void setFolDate(String folDate) {
this.folDate = folDate;
}
/**
* get the delOrderNo - 发货单号
* @return the delOrderNo
*/
public String getDelOrderNo() {
return this.delOrderNo;
}
/**
* set the delOrderNo - 发货单号
*/
public void setDelOrderNo(String delOrderNo) {
this.delOrderNo = delOrderNo;
}
/**
* get the folType - 回访方式 1-电话回访 1-上门回访
* @return the folType
*/
public Integer getFolType() {
return this.folType;
}
/**
* set the folType - 回访方式 1-电话回访 1-上门回访
*/
public void setFolType(Integer folType) {
this.folType = folType;
}
/**
* get the folStatus - 回访状态 0-待回访 1-已回访
* @return the folStatus
*/
public Integer getFolStatus() {
return this.folStatus;
}
/**
* set the folStatus - 回访状态 0-待回访 1-已回访
*/
public void setFolStatus(Integer folStatus) {
this.folStatus = folStatus;
}
/**
* get the value from Map
*/
public void fromMap(Map map) {
setId(NumberUtils.toLong(StringUtils.toString(map.get("id")), id));
setCompanyCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("companyCode")), companyCode));
setDepCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("depCode")), depCode));
setCreatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("createdBy")), createdBy));
setCreatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("createdName")), createdName));
setCreatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("createdTime")), createdTime));
setUpdatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("updatedBy")), updatedBy));
setUpdatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("updatedName")), updatedName));
setUpdatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("updatedTime")), updatedTime));
setDeleteFlag(NumberUtils.toInteger(StringUtils.toString(map.get("deleteFlag")), deleteFlag));
setFolDate(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("folDate")), folDate));
setDelOrderNo(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("delOrderNo")), delOrderNo));
setFolType(NumberUtils.toInteger(StringUtils.toString(map.get("folType")), folType));
setFolStatus(NumberUtils.toInteger(StringUtils.toString(map.get("folStatus")), folStatus));
}
/**
* set the value to Map
*/
public Map toMap() {
Map map = new HashMap();
map.put("id",StringUtils.toString(id, eiMetadata.getMeta("id")));
map.put("companyCode",StringUtils.toString(companyCode, eiMetadata.getMeta("companyCode")));
map.put("depCode",StringUtils.toString(depCode, eiMetadata.getMeta("depCode")));
map.put("createdBy",StringUtils.toString(createdBy, eiMetadata.getMeta("createdBy")));
map.put("createdName",StringUtils.toString(createdName, eiMetadata.getMeta("createdName")));
map.put("createdTime",StringUtils.toString(createdTime, eiMetadata.getMeta("createdTime")));
map.put("updatedBy",StringUtils.toString(updatedBy, eiMetadata.getMeta("updatedBy")));
map.put("updatedName",StringUtils.toString(updatedName, eiMetadata.getMeta("updatedName")));
map.put("updatedTime",StringUtils.toString(updatedTime, eiMetadata.getMeta("updatedTime")));
map.put("deleteFlag",StringUtils.toString(deleteFlag, eiMetadata.getMeta("deleteFlag")));
map.put("folDate",StringUtils.toString(folDate, eiMetadata.getMeta("folDate")));
map.put("delOrderNo",StringUtils.toString(delOrderNo, eiMetadata.getMeta("delOrderNo")));
map.put("folType",StringUtils.toString(folType, eiMetadata.getMeta("folType")));
map.put("folStatus",StringUtils.toString(folStatus, eiMetadata.getMeta("folStatus")));
return map;
}
}
\ No newline at end of file
...@@ -42,7 +42,7 @@ public class ServiceHPXS006 extends ServiceBase { ...@@ -42,7 +42,7 @@ public class ServiceHPXS006 extends ServiceBase {
try { try {
/*inInfo.setCell(EiConstant.queryBlock,ACConstants.ROW_CODE_0, "userId",UserSessionUtils.getFactoryCode().get(0));*/ /*inInfo.setCell(EiConstant.queryBlock,ACConstants.ROW_CODE_0, "userId",UserSessionUtils.getFactoryCode().get(0));*/
inInfo = super.query(inInfo, HPXS006.QUERY, new HPSC001()); inInfo = super.query(inInfo, HPXS006.QUERY, new HPXS006());
Map map = new HashMap(); Map map = new HashMap();
map.put("companyCode", UserSessionUtils.getCompanyCode()); map.put("companyCode", UserSessionUtils.getCompanyCode());
map.put("factoryCodes", getFactoryCode(inInfo)); map.put("factoryCodes", getFactoryCode(inInfo));
...@@ -183,53 +183,6 @@ public class ServiceHPXS006 extends ServiceBase { ...@@ -183,53 +183,6 @@ public class ServiceHPXS006 extends ServiceBase {
} }
public void buildHPSC002(EiInfo eiInfo) {
HPSC001 hpsc001 = new HPSC001();
EiBlock eiBlock = eiInfo.getBlock(EiConstant.resultBlock);
List rows = new ArrayList();
for (int i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
hpsc001.fromMap(map);
Map hpsc002 = new HashMap();
hpsc002.put("companyCode", hpsc001.getCompanyCode());
hpsc002.put("depCode", hpsc001.getDepCode());
hpsc002.put("projCode", hpsc001.getProjCode());
hpsc002.put("projName", hpsc001.getProjName());
hpsc002.put("parentId", "root"); //固定写死
hpsc002.put("parentPrdtName", hpsc001.getProjName());
hpsc002.put("deliveryDate",hpsc001.getDeliveryDate());
hpsc002.put("type", "");
hpsc002.put("leaf", "0");
hpsc002.put("sort", "");
hpsc002.put("icon", "");
hpsc002.put("prdtCode", hpsc001.getProjCode());
hpsc002.put("prdtName", hpsc001.getProjName());
hpsc002.put("depCode", hpsc001.getDepCode());
rows.add(hpsc002);
}
eiBlock.setRows(rows);
eiInfo.set(EiConstant.serviceName, "HPSC002");
eiInfo.set(EiConstant.methodName, "insert");
EiInfo outInfo = XLocalManager.call(eiInfo);
if (outInfo.getStatus() < 0) {
throw new PlatException(outInfo.getMsg());
}
}
/**
* 项目下拉框
*
* @param inInfo
* @return
*/
public EiInfo queryComboBox(EiInfo inInfo) {
List<DdynamicEnum> list = new ArrayList<>();
list.add(DdynamicEnum.PROJ_RECORD_BLOCK_ID);
CommonMethod.initBlock(inInfo, list, EiInfoUtils.getFirstRow(inInfo));
return inInfo;
}
/** /**
* @param inInfo * @param inInfo
* @return * @return
......
package com.baosight.hpjx.hp.xs.service;
import com.baosight.hpjx.aspect.annotation.OperationLogAnnotation;
import com.baosight.hpjx.common.DdynamicEnum;
import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.core.security.UserSessionUtils;
import com.baosight.hpjx.hp.constant.HPConstant;
import com.baosight.hpjx.hp.sc.domain.HPSC001;
import com.baosight.hpjx.hp.xs.domain.HPXS007;
import com.baosight.hpjx.util.CommonMethod;
import com.baosight.hpjx.util.DateUtils;
import com.baosight.hpjx.util.EiInfoUtils;
import com.baosight.hpjx.util.LogUtils;
import com.baosight.hpjx.util.contants.ACConstants;
import com.baosight.iplat4j.core.ei.EiBlock;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.service.impl.ServiceBase;
import com.baosight.iplat4j.core.service.soa.XLocalManager;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import java.util.*;
/**
*
*/
public class ServiceHPXS007 extends ServiceBase {
/**
* 画面初始化.
*/
@OperationLogAnnotation(operModul = "客户回访",operType = "查询",operDesc = "初始化")
public EiInfo initLoad(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HPXS007.QUERY, new HPXS007());
Map map = new HashMap();
map.put("companyCode", UserSessionUtils.getCompanyCode());
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.SALE_NO_BLOCK_ID), null,false);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询操作.
*/
@Override
@OperationLogAnnotation(operModul = "客户回访",operType = "查询")
public EiInfo query(EiInfo inInfo) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HPXS007.FIELD_FOL_DATE,
DateUtils.formatShort(inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HPXS007.FIELD_FOL_DATE)));
EiInfo outInfo = super.query(inInfo, HPXS007.QUERY, new HPXS007());
return outInfo;
}
/**
* 保存操作.
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "客户回访",operType = "保存",operDesc = "保存")
public EiInfo save(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 写入数据
for (int i = 0; i < resultRows.size(); i++) {
HPXS007 hpsc007 = new HPXS007();
hpsc007.fromMap(resultRows.get(i));
hpsc007.setFolDate(DateUtils.formatShort(hpsc007.getFolDate()));
if (hpsc007.getId() == null || hpsc007.getId() == 0) {
this.add(hpsc007);
} else {
this.modify(hpsc007);
}
}
//inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 新增
*
* @param hpsc007
* @throws Exception
*/
private void add(HPXS007 hpsc007) throws Exception {
DaoUtils.insert(HPXS007.INSERT, hpsc007);
}
/**
* 修改数据
*
* @param hpxs007
*/
private void modify(HPXS007 hpxs007) {
DaoUtils.update(HPXS007.UPDATE, hpxs007);
}
/**
* 删除操作.
*/
@OperationLogAnnotation(operModul = "客户回访",operType = "删除")
public EiInfo delete(EiInfo eiInfo) {
HPXS007 hpxs007 = new HPXS007();
EiBlock eiBlock = eiInfo.getBlock(EiConstant.resultBlock);
try {
for (int i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
hpxs007.fromMap(map);
this.dao.delete(HPXS007.DELETE, hpxs007.toMap());
}
} catch (PlatException e) {
eiInfo.setStatus(EiConstant.STATUS_FAILURE);
eiInfo.setMsg("删除失败,原因参见详细错误描述!");
eiInfo.setDetailMsg(e.getMessage());
logError("删除失败!", e.getMessage());
return eiInfo;
}
eiInfo.setStatus(EiConstant.STATUS_SUCCESS);
eiInfo.setMsg("删除成功!");
return query(eiInfo);
}
/**
*审核
*/
@OperationLogAnnotation(operModul = "客户回访",operType = "审核")
public EiInfo check(EiInfo eiInfo) {
HPXS007 hpxs007 = new HPXS007();
EiBlock eiBlock = eiInfo.getBlock(EiConstant.resultBlock);
try {
for (int i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
hpxs007.fromMap(map);
DaoUtils.update(HPXS007.CHECK, hpxs007.toMap());
}
} catch (PlatException e) {
eiInfo.setStatus(EiConstant.STATUS_FAILURE);
eiInfo.setMsg("审核失败,原因参见详细错误描述!");
eiInfo.setDetailMsg(e.getMessage());
logError("审核失败!", e.getMessage());
return eiInfo;
}
eiInfo.setStatus(EiConstant.STATUS_SUCCESS);
eiInfo.setMsg("审核成功!");
return eiInfo;
}
}
...@@ -47,7 +47,6 @@ ...@@ -47,7 +47,6 @@
<isNotEmpty prepend=" AND " property="repStatus"> <isNotEmpty prepend=" AND " property="repStatus">
REP_STATUS = #repStatus# REP_STATUS = #repStatus#
</isNotEmpty> </isNotEmpty>
</sql> </sql>
<select id="query" parameterClass="java.util.HashMap" <select id="query" parameterClass="java.util.HashMap"
...@@ -219,6 +218,5 @@ ...@@ -219,6 +218,5 @@
<isNotEmpty prepend=" AND " property="userId"> <isNotEmpty prepend=" AND " property="userId">
b.USER_ID = #userId# b.USER_ID = #userId#
</isNotEmpty> </isNotEmpty>
</select> </select>
</sqlMap> </sqlMap>
\ No newline at end of file
<?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">
<!-- table information
Generate time : 2024-04-22 14:15:25
Version : 1.0
tableName :hpjx.t_hpxs007
ID BIGINT NOT NULL primarykey,
COMPANY_CODE VARCHAR,
DEP_CODE VARCHAR,
CREATED_BY VARCHAR,
CREATED_NAME VARCHAR,
CREATED_TIME VARCHAR,
UPDATED_BY VARCHAR,
UPDATED_NAME VARCHAR,
UPDATED_TIME VARCHAR,
DELETE_FLAG TINYINT,
FOL_DATE VARCHAR,
DEL_ORDER_NO VARCHAR,
FOL_TYPE TINYINT,
FOL_STATUS TINYINT
-->
<sqlMap namespace="HPXS007">
<sql id="authCondition">
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCodes">
DEP_CODE IN <iterate close=")" open="(" conjunction="," property="depCodes">#depCodes[]#</iterate>
</isNotEmpty>
</sql>
<sql id="condition">
<isNotEmpty prepend=" AND " property="repDate">
REP_DATE = #repDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="repOrderNo">
REP_ORDER_NO LIKE CONCAT('%', #repOrderNo#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="repCustomId">
REP_CUSTOM_ID = #repCustomId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="repUserId">
REP_USER_ID = #repUserId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="repStatus">
REP_STATUS = #repStatus#
</isNotEmpty>
</sql>
<select id="query" parameterClass="java.util.HashMap"
resultClass="com.baosight.hpjx.hp.xs.domain.HPXS007">
SELECT
ID as "id", <!-- ID -->
COMPANY_CODE as "companyCode", <!-- 公司编码 -->
DEP_CODE as "depCode", <!-- 部门编码 -->
CREATED_BY as "createdBy", <!-- 创建人 -->
CREATED_NAME as "createdName", <!-- 创建人名称 -->
CREATED_TIME as "createdTime", <!-- 创建时间 -->
UPDATED_BY as "updatedBy", <!-- 修改人 -->
UPDATED_NAME as "updatedName", <!-- 修改人名称 -->
UPDATED_TIME as "updatedTime", <!-- 修改时间 -->
DELETE_FLAG as "deleteFlag", <!-- 是否删除 0-否1-是 -->
FOL_DATE as "folDate", <!-- 回访日期 -->
DEL_ORDER_NO as "delOrderNo", <!-- 发货单号 -->
FOL_TYPE as "folType", <!-- 回访方式 1-电话回访 2-上门回访 -->
FOL_STATUS as "folStatus" <!-- 回访状态 0-待回访 1-已回访 -->
FROM hpjx.t_hpxs007 WHERE 1=1
<include refid="authCondition"/>
<include refid="condition"/>
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
ID asc
</isEmpty>
</dynamic>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM hpjx.t_hpxs007 WHERE 1=1
<include refid="authCondition"/>
<include refid="condition"/>
</select>
<!--
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
CREATED_BY = #createdBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdName">
CREATED_NAME = #createdName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
CREATED_TIME = #createdTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy">
UPDATED_BY = #updatedBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedName">
UPDATED_NAME = #updatedName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime">
UPDATED_TIME = #updatedTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deleteFlag">
DELETE_FLAG = #deleteFlag#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="folDate">
FOL_DATE = #folDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="delOrderNo">
DEL_ORDER_NO = #delOrderNo#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="folType">
FOL_TYPE = #folType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="folStatus">
FOL_STATUS = #folStatus#
</isNotEmpty>
-->
<insert id="insert">
INSERT INTO hpjx.t_hpxs007 (ID, <!-- ID -->
COMPANY_CODE, <!-- 公司编码 -->
DEP_CODE, <!-- 部门编码 -->
CREATED_BY, <!-- 创建人 -->
CREATED_NAME, <!-- 创建人名称 -->
CREATED_TIME, <!-- 创建时间 -->
UPDATED_BY, <!-- 修改人 -->
UPDATED_NAME, <!-- 修改人名称 -->
UPDATED_TIME, <!-- 修改时间 -->
DELETE_FLAG, <!-- 是否删除 0-否1-是 -->
FOL_DATE, <!-- 回访日期 -->
DEL_ORDER_NO, <!-- 发货单号 -->
FOL_TYPE, <!-- 回访方式 1-电话回访 1-上门回访 -->
FOL_STATUS <!-- 回访状态 0-待回访 1-已回访 -->
)
VALUES (#id#, #companyCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #deleteFlag#, #folDate#, #delOrderNo#, #folType#, #folStatus#)
</insert>
<delete id="delete">
DELETE FROM hpjx.t_hpxs007 WHERE
ID = #id#
</delete>
<update id="update">
UPDATE hpjx.t_hpxs007
SET
COMPANY_CODE = #companyCode#, <!-- 公司编码 -->
DEP_CODE = #depCode#, <!-- 部门编码 -->
CREATED_BY = #createdBy#, <!-- 创建人 -->
CREATED_NAME = #createdName#, <!-- 创建人名称 -->
CREATED_TIME = #createdTime#, <!-- 创建时间 -->
UPDATED_BY = #updatedBy#, <!-- 修改人 -->
UPDATED_NAME = #updatedName#, <!-- 修改人名称 -->
UPDATED_TIME = #updatedTime#, <!-- 修改时间 -->
DELETE_FLAG = #deleteFlag#, <!-- 是否删除 0-否1-是 -->
FOL_DATE = #folDate#, <!-- 回访日期 -->
DEL_ORDER_NO = #delOrderNo#, <!-- 发货单号 -->
FOL_TYPE = #folType#, <!-- 回访方式 1-电话回访 1-上门回访 -->
FOL_STATUS = #folStatus# <!-- 回访状态 0-待回访 1-已回访 -->
WHERE
ID = #id#
</update>
<update id="check">
UPDATE hpjx.t_hpxs007
SET
FOL_STATUS = #folStatus# <!-- 回访状态 0-待回访 1-已回访 -->
WHERE
ID = #id#
</update>
<select id="getSaleCode" parameterClass="java.util.HashMap" resultClass="java.util.HashMap">
select SALE_NO as "saleNo"
from hpjx.T_HPKC004
where DELETE_FLAG = 0 and IS_PRINT = 1
<include refid="authCondition"/>
</select>
</sqlMap>
\ No newline at end of file
$(function () {
$("#QUERY").on("click", query);
IPLATUI.EFGrid = {
"result": {
pageable: {
pageSize: 10,
pageSizes: [10, 20, 30, 50, 100, 200],
},
columns: [{
field: "operator",
template: function (item) {
let auditStatus = item.folStatus;
let template = '';
if (auditStatus) {
if (auditStatus == 0) {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;" ' +
'onclick="check(' + item.id + ',1)" >审核</a>';
}
}
return template;
}
}],
loadComplete: function(grid) {
},
onSave: function (e) {
// 阻止默认请求,使用自定义保存
e.preventDefault();
//let btnNode = $(this);
//禁用按钮
//btnNode.attr("disabled", true);
//saveResult(btnNode);
save();
},
onSuccess: function (e) {
if (e.eiInfo.extAttr.methodName == 'save') {
query();
}
},
onRowClick: function (e) {
},
}
}
downKeyUp();
});
let query = function () { resultGrid.dataSource.page(1);}
function check(id, auditStatus) {
const inEiInfo = new EiInfo();
inEiInfo.set("result-0-id", id);
inEiInfo.set("result-0-folStatus", auditStatus);
EiCommunicator.send('HPXS007', 'check', inEiInfo, {
onSuccess(response) {
//NotificationUtil(response.msg);
message("审核成功");
resultGrid.dataSource.page(1);
},
onFail(errorMessage, status, e) {
NotificationUtil("执行失败!", "error");
}
},
{
async: false
}
);
}
/**
* 删除
*/
/*function deleteFunc() {
var rows = resultGrid.getCheckedRows();
if (rows.length == 0) {
message("请先勾选数据!");
return;
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"删除\"操作?", {
ok: function () {
JSUtils.submitGridsData("result", "HPSC002A", "delete", true);
}
})
}*/
function save() {
var rows = resultGrid.getCheckedRows();
if (rows.length == 0) {
message("请先勾选数据!");
return;
}
for (let i = 0; i < rows.length; i++) {
if (rows[i]['folStatus']==1) {
message("勾选的第" + (i + 1) + "行已回访不允许修改!");
return;
}
if (isBlank(rows[i]['folDate'])) {
message("勾选的第" + (i + 1) + "行回访日期不能为空");
return;
}
if (isBlank(rows[i]['delOrderNo'])) {
message("勾选的第" + (i + 1) + "行发货单号不能为空");
return;
}
if (isBlank(rows[i]['folType'])) {
message("勾选的第" + (i + 1) + "行回访方式不能为空");
return;
}
if (isBlank(rows[i]['folStatus'])) {
message("勾选的第" + (i + 1) + "行维修状态不能为空");
return;
}
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作?", {
ok: function () {
JSUtils.submitGridsData("result", "HPXS007", "save", true);
}
})
}
<%--
Created by IntelliJ IDEA.
User: 1
Date: 2024/3/25
Time: 16:17
To change this template use File | Settings | File Templates.
--%>
<!DOCTYPE html>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ 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="folDate" blockId="inqu_status" row="0" colWidth="3"
format="yyyy-MM-dd" readonly="true"/>
<%-- <EF:EFInput cname="发货单号" ename="inqu_status-0-folOrderNo" colWidth="3"/>--%>
<EF:EFSelect cname="发货单号" ename="inqu_status-0-folOrderNo" colWidth="3" filter="contains" defultValue="">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="sale_no_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFSelect blockId="inqu_status" row="0" ename="folType" cname="回访方式" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hpjx.hpxs.folType"/>
</EF:EFSelect>
<EF:EFSelect blockId="inqu_status" row="0" ename="folStatus" cname="回访状态" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hpjx.hpxs.folStatus"/>
</EF:EFSelect>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row">
<EF:EFColumn ename="id" primaryKey="true" cname="主键" hidden="true"/>
<EF:EFColumn ename="companyCode" cname="公司编码" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="120" align="center"/>
<EF:EFColumn ename="folDate" cname="回访日期" width="100" align="center" editType="date" readonly="false"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true"/>
<%--<EF:EFColumn ename="folOrderNo" cname="发货单号" enable="false" width="140" align="center"/>--%>
<EF:EFComboColumn ename="delOrderNo" cname="发货单号" width="120" align="center" required="true"
blockName="sale_no_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#" readonly="false"
filter="contains">
</EF:EFComboColumn>
<EF:EFComboColumn ename="folType" cname="回访方式" width="80" align="center" readonly="false" required="true" defaultValue="1">
<EF:EFCodeOption codeName="hpjx.hpxs.folType"/>
</EF:EFComboColumn>
<EF:EFComboColumn ename="folStatus" cname="回访状态" width="80" align="center" readonly="true" required="true" defaultValue="0">
<EF:EFCodeOption codeName="hpjx.hpxs.folStatus"/>
</EF:EFComboColumn>
<EF:EFColumn cname="创建人" ename="createdName" align="center" width="150" readonly="true" required="false" enable="false"/>
<EF:EFColumn cname="创建时间" ename="createdTime" parseFormats="['yyyyMMddHHmmss']" editType="datetime"
dateFormat="yyyy-MM-dd HH:mm:ss" align="center" width="150" readonly="true" required="false"
enable="false"/>
<EF:EFColumn cname="修改人" ename="updatedName" align="center" width="150" readonly="true" required="false" enable="false"/>
<EF:EFColumn cname="修改时间" ename="updatedTime" parseFormats="['yyyyMMddHHmmss']" editType="datetime"
dateFormat="yyyy-MM-dd HH:mm:ss" align="center" width="150" readonly="true" required="false"
enable="false"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment