Commit 6ebe8cde by 宋祥

1.客户关怀功能

parent ddca8ec8
...@@ -97,6 +97,8 @@ public class HPConstant { ...@@ -97,6 +97,8 @@ public class HPConstant {
public static final String HPCW002_BILL_NUMBER = "HPCW002_BILL_NUMBER"; public static final String HPCW002_BILL_NUMBER = "HPCW002_BILL_NUMBER";
// 售后单号 // 售后单号
public static final String AFTER_SALE_NO = "AFTER_SALE_NO"; public static final String AFTER_SALE_NO = "AFTER_SALE_NO";
// 客户关怀单号
public static final String CARE_NO = "CARE_NO";
} }
/** /**
...@@ -129,4 +131,17 @@ public class HPConstant { ...@@ -129,4 +131,17 @@ public class HPConstant {
public static final Integer S_1 = 1; public static final Integer S_1 = 1;
} }
/**
* 处理状态
*
* @author:songx
* @date:2024/2/22,13:57
*/
public static class dealStatus {
// 未处理
public static final Integer S0 = 0;
// 已处理
public static final Integer S1 = 1;
}
} }
...@@ -14,21 +14,16 @@ public class HpFwConstant { ...@@ -14,21 +14,16 @@ public class HpFwConstant {
*/ */
public static class HpFw001 { public static class HpFw001 {
}
/** /**
* 售后状态 * HPFW001 定义
* *
* @author:songx * @author:songx
* @date:2024/5/7,16:36 * @date:2024/9/24,17:54
*/ */
public static class Status { public static class HpFw002 {
// 待处理
public static final Integer S0 = 0;
// 已处理
public static final Integer S1 = 1;
} }
}
} }
...@@ -18,4 +18,16 @@ public class HpFwSqlConstant { ...@@ -18,4 +18,16 @@ public class HpFwSqlConstant {
public static final String UPDATE_DEAL = "HPFW001.updateDeal"; public static final String UPDATE_DEAL = "HPFW001.updateDeal";
} }
/**
* @author:songx
* @date:2024/8/29,15:54
*/
public static class HpFw002 {
// 锁
public static final String LOCK = "HPFW002.lock";
// 修改
public static final String UPDATE_DEAL = "HPFW002.updateDeal";
}
} }
package com.baosight.hpjx.hp.fw.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.util.HashMap;
import java.util.Map;
/**
* Project: <br>
* Title:THpfw002.java <br>
* Description: <br>
*
* Copyrigth:Baosight Software LTD.co Copyright (c) 2019. <br>
*
* @version 1.0
* @history 2024-09-25 15:04:32 create
*/
public class HPFW002 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_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"; /* 是否删除 0-否1-是*/
public static final String FIELD_STATUS = "status"; /* 状态 0-未处理 1-已维修*/
public static final String FIELD_CARE_DATE = "careDate"; /* 关怀日期*/
public static final String FIELD_CARE_NO = "careNo"; /* 关怀单号*/
public static final String FIELD_CARE_WAY = "careWay"; /* 关怀方式*/
public static final String FIELD_CARE_TYPE = "careType"; /* 关怀类型*/
public static final String FIELD_CUSTOM_ID = "customId"; /* 客户ID*/
public static final String FIELD_CUSTOM_NAME = "customName"; /* 客户名称*/
public static final String FIELD_DEAL_USER_ID = "dealUserId"; /* 执行人ID*/
public static final String FIELD_DEAL_USER_NAME = "dealUserName"; /* 执行人名称*/
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_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"; /* 是否删除 0-否1-是*/
public static final String COL_STATUS = "STATUS"; /* 状态 0-未处理 1-已维修*/
public static final String COL_CARE_DATE = "CARE_DATE"; /* 关怀日期*/
public static final String COL_CARE_NO = "CARE_NO"; /* 关怀单号*/
public static final String COL_CARE_WAY = "CARE_WAY"; /* 关怀方式*/
public static final String COL_CARE_TYPE = "CARE_TYPE"; /* 关怀类型*/
public static final String COL_CUSTOM_ID = "CUSTOM_ID"; /* 客户ID*/
public static final String COL_CUSTOM_NAME = "CUSTOM_NAME"; /* 客户名称*/
public static final String COL_DEAL_USER_ID = "DEAL_USER_ID"; /* 执行人ID*/
public static final String COL_DEAL_USER_NAME = "DEAL_USER_NAME"; /* 执行人名称*/
public static final String QUERY = "HPFW002.query";
public static final String COUNT = "HPFW002.count";
public static final String INSERT = "HPFW002.insert";
public static final String UPDATE = "HPFW002.update";
public static final String DELETE = "HPFW002.delete";
private Long id = new Long(0); /* 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 Integer status; /* 状态 0-未处理 1-已维修*/
private String careDate = " "; /* 关怀日期*/
private String careNo = " "; /* 关怀单号*/
private Integer careWay = new Integer(0); /* 关怀方式*/
private Integer careType = new Integer(0); /* 关怀类型*/
private String customId = " "; /* 客户ID*/
private String customName = " "; /* 客户名称*/
private String dealUserId = " "; /* 执行人ID*/
private String dealUserName = " "; /* 执行人名称*/
/**
* 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_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("是否删除 0-否1-是");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_STATUS);
eiColumn.setDescName("状态 0-未处理 1-已维修");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CARE_DATE);
eiColumn.setDescName("关怀日期");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CARE_NO);
eiColumn.setDescName("关怀单号");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CARE_WAY);
eiColumn.setDescName("关怀方式");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CARE_TYPE);
eiColumn.setDescName("关怀类型");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CUSTOM_ID);
eiColumn.setDescName("客户ID");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CUSTOM_NAME);
eiColumn.setDescName("客户名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DEAL_USER_ID);
eiColumn.setDescName("执行人ID");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DEAL_USER_NAME);
eiColumn.setDescName("执行人名称");
eiMetadata.addMeta(eiColumn);
}
/**
* the constructor.
*/
public HPFW002() {
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 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 - 是否删除 0-否1-是.
* @return the deleteFlag
*/
public Integer getDeleteFlag() {
return this.deleteFlag;
}
/**
* set the deleteFlag - 是否删除 0-否1-是.
*
* @param deleteFlag - 是否删除 0-否1-是
*/
public void setDeleteFlag(Integer deleteFlag) {
this.deleteFlag = deleteFlag;
}
/**
* get the status - 状态 0-未处理 1-已维修.
* @return the status
*/
public Integer getStatus() {
return this.status;
}
/**
* set the status - 状态 0-未处理 1-已维修.
*
* @param status - 状态 0-未处理 1-已维修
*/
public void setStatus(Integer status) {
this.status = status;
}
/**
* get the careDate - 关怀日期.
* @return the careDate
*/
public String getCareDate() {
return this.careDate;
}
/**
* set the careDate - 关怀日期.
*
* @param careDate - 关怀日期
*/
public void setCareDate(String careDate) {
this.careDate = careDate;
}
/**
* get the careNo - 关怀单号.
* @return the careNo
*/
public String getCareNo() {
return this.careNo;
}
/**
* set the careNo - 关怀单号.
*
* @param careNo - 关怀单号
*/
public void setCareNo(String careNo) {
this.careNo = careNo;
}
/**
* get the careWay - 关怀方式.
* @return the careWay
*/
public Integer getCareWay() {
return this.careWay;
}
/**
* set the careWay - 关怀方式.
*
* @param careWay - 关怀方式
*/
public void setCareWay(Integer careWay) {
this.careWay = careWay;
}
/**
* get the careType - 关怀类型.
* @return the careType
*/
public Integer getCareType() {
return this.careType;
}
/**
* set the careType - 关怀类型.
*
* @param careType - 关怀类型
*/
public void setCareType(Integer careType) {
this.careType = careType;
}
/**
* get the customId - 客户ID.
* @return the customId
*/
public String getCustomId() {
return this.customId;
}
/**
* set the customId - 客户ID.
*
* @param customId - 客户ID
*/
public void setCustomId(String customId) {
this.customId = customId;
}
/**
* get the customName - 客户名称.
* @return the customName
*/
public String getCustomName() {
return this.customName;
}
/**
* set the customName - 客户名称.
*
* @param customName - 客户名称
*/
public void setCustomName(String customName) {
this.customName = customName;
}
/**
* get the dealUserId - 执行人ID.
* @return the dealUserId
*/
public String getDealUserId() {
return this.dealUserId;
}
/**
* set the dealUserId - 执行人ID.
*
* @param dealUserId - 执行人ID
*/
public void setDealUserId(String dealUserId) {
this.dealUserId = dealUserId;
}
/**
* get the dealUserName - 执行人名称.
* @return the dealUserName
*/
public String getDealUserName() {
return this.dealUserName;
}
/**
* set the dealUserName - 执行人名称.
*
* @param dealUserName - 执行人名称
*/
public void setDealUserName(String dealUserName) {
this.dealUserName = dealUserName;
}
/**
* 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));
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));
setStatus(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_STATUS)), status));
setCareDate(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CARE_DATE)), careDate));
setCareNo(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CARE_NO)), careNo));
setCareWay(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_CARE_WAY)), careWay));
setCareType(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_CARE_TYPE)), careType));
setCustomId(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CUSTOM_ID)), customId));
setCustomName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CUSTOM_NAME)), customName));
setDealUserId(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DEAL_USER_ID)), dealUserId));
setDealUserName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DEAL_USER_NAME)), dealUserName));
}
/**
* 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_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_STATUS, StringUtils.toString(status, eiMetadata.getMeta(FIELD_STATUS)));
map.put(FIELD_CARE_DATE, StringUtils.toString(careDate, eiMetadata.getMeta(FIELD_CARE_DATE)));
map.put(FIELD_CARE_NO, StringUtils.toString(careNo, eiMetadata.getMeta(FIELD_CARE_NO)));
map.put(FIELD_CARE_WAY, StringUtils.toString(careWay, eiMetadata.getMeta(FIELD_CARE_WAY)));
map.put(FIELD_CARE_TYPE, StringUtils.toString(careType, eiMetadata.getMeta(FIELD_CARE_TYPE)));
map.put(FIELD_CUSTOM_ID, StringUtils.toString(customId, eiMetadata.getMeta(FIELD_CUSTOM_ID)));
map.put(FIELD_CUSTOM_NAME, StringUtils.toString(customName, eiMetadata.getMeta(FIELD_CUSTOM_NAME)));
map.put(FIELD_DEAL_USER_ID, StringUtils.toString(dealUserId, eiMetadata.getMeta(FIELD_DEAL_USER_ID)));
map.put(FIELD_DEAL_USER_NAME, StringUtils.toString(dealUserName, eiMetadata.getMeta(FIELD_DEAL_USER_NAME)));
return map;
}
}
...@@ -4,6 +4,7 @@ import com.baosight.hpjx.aspect.annotation.OperationLogAnnotation; ...@@ -4,6 +4,7 @@ import com.baosight.hpjx.aspect.annotation.OperationLogAnnotation;
import com.baosight.hpjx.core.constant.CommonConstant; import com.baosight.hpjx.core.constant.CommonConstant;
import com.baosight.hpjx.core.dao.DaoUtils; import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.core.security.UserSessionUtils; import com.baosight.hpjx.core.security.UserSessionUtils;
import com.baosight.hpjx.hp.constant.HPConstant;
import com.baosight.hpjx.hp.fw.constant.HpFwConstant; import com.baosight.hpjx.hp.fw.constant.HpFwConstant;
import com.baosight.hpjx.hp.fw.constant.HpFwSqlConstant; import com.baosight.hpjx.hp.fw.constant.HpFwSqlConstant;
import com.baosight.hpjx.hp.fw.domain.HPFW001; import com.baosight.hpjx.hp.fw.domain.HPFW001;
...@@ -38,6 +39,7 @@ public class ServiceHPFW001 extends ServiceBase { ...@@ -38,6 +39,7 @@ public class ServiceHPFW001 extends ServiceBase {
@OperationLogAnnotation(operModul = "售后维修", operType = "查询", operDesc = "初始化") @OperationLogAnnotation(operModul = "售后维修", operType = "查询", operDesc = "初始化")
public EiInfo initLoad(EiInfo inInfo) { public EiInfo initLoad(EiInfo inInfo) {
try { try {
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HPFW001().eiMetadata);
} catch (PlatException e) { } catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败"); LogUtils.setDetailMsg(inInfo, e, "初始化失败");
} }
...@@ -97,7 +99,7 @@ public class ServiceHPFW001 extends ServiceBase { ...@@ -97,7 +99,7 @@ public class ServiceHPFW001 extends ServiceBase {
String afterSaleNo = fFw001.getAfterSaleNo(); String afterSaleNo = fFw001.getAfterSaleNo();
HPFW001 dbFw001 = dbFw001Map.get(afterSaleNo); HPFW001 dbFw001 = dbFw001Map.get(afterSaleNo);
AssertUtils.isNull(dbFw001, String.format("售后服务单[%s]不存在", afterSaleNo)); AssertUtils.isNull(dbFw001, String.format("售后服务单[%s]不存在", afterSaleNo));
AssertUtils.isNotEquals(HpFwConstant.HpFw001.Status.S0, dbFw001.getStatus(), AssertUtils.isNotEquals(HPConstant.dealStatus.S0, dbFw001.getStatus(),
String.format("售后服务单[%s]状态不是\"待处理\",不允许操作", afterSaleNo)); String.format("售后服务单[%s]状态不是\"待处理\",不允许操作", afterSaleNo));
} }
} }
...@@ -150,7 +152,7 @@ public class ServiceHPFW001 extends ServiceBase { ...@@ -150,7 +152,7 @@ public class ServiceHPFW001 extends ServiceBase {
String afterSaleNo = fFw001.getAfterSaleNo(); String afterSaleNo = fFw001.getAfterSaleNo();
HPFW001 dbFw001 = dbFw001Map.get(afterSaleNo); HPFW001 dbFw001 = dbFw001Map.get(afterSaleNo);
AssertUtils.isNull(dbFw001, String.format("售后服务单[%s]不存在", afterSaleNo)); AssertUtils.isNull(dbFw001, String.format("售后服务单[%s]不存在", afterSaleNo));
AssertUtils.isNotEquals(HpFwConstant.HpFw001.Status.S0, dbFw001.getStatus(), AssertUtils.isNotEquals(HPConstant.dealStatus.S0, dbFw001.getStatus(),
String.format("售后服务单[%s]状态不是\"待处理\",不允许操作", afterSaleNo)); String.format("售后服务单[%s]状态不是\"待处理\",不允许操作", afterSaleNo));
} }
} }
...@@ -162,7 +164,7 @@ public class ServiceHPFW001 extends ServiceBase { ...@@ -162,7 +164,7 @@ public class ServiceHPFW001 extends ServiceBase {
*/ */
private void checkData(List<HPFW001> fFw001s) { private void checkData(List<HPFW001> fFw001s) {
for (HPFW001 fFw001 : fFw001s) { for (HPFW001 fFw001 : fFw001s) {
fFw001.setStatus(HpFwConstant.HpFw001.Status.S1); fFw001.setStatus(HPConstant.dealStatus.S1);
fFw001.setDealUserId(UserSessionUtils.getLoginName()); fFw001.setDealUserId(UserSessionUtils.getLoginName());
fFw001.setDealUserName(UserSessionUtils.getLoginCName()); fFw001.setDealUserName(UserSessionUtils.getLoginCName());
DaoUtils.update(HpFwSqlConstant.HpFw001.UPDATE_DEAL, fFw001.toMap()); DaoUtils.update(HpFwSqlConstant.HpFw001.UPDATE_DEAL, fFw001.toMap());
......
...@@ -5,7 +5,6 @@ import com.baosight.hpjx.common.DdynamicEnum; ...@@ -5,7 +5,6 @@ import com.baosight.hpjx.common.DdynamicEnum;
import com.baosight.hpjx.core.constant.CommonConstant; import com.baosight.hpjx.core.constant.CommonConstant;
import com.baosight.hpjx.core.dao.DaoUtils; import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.hp.constant.HPConstant; import com.baosight.hpjx.hp.constant.HPConstant;
import com.baosight.hpjx.hp.fw.constant.HpFwConstant;
import com.baosight.hpjx.hp.fw.domain.HPFW001; import com.baosight.hpjx.hp.fw.domain.HPFW001;
import com.baosight.hpjx.hp.fw.tools.HpFwTools; import com.baosight.hpjx.hp.fw.tools.HpFwTools;
import com.baosight.hpjx.hp.fw.utils.HpFwUtils; import com.baosight.hpjx.hp.fw.utils.HpFwUtils;
...@@ -83,7 +82,7 @@ public class ServiceHPFW001B extends ServiceEPBase { ...@@ -83,7 +82,7 @@ public class ServiceHPFW001B extends ServiceEPBase {
*/ */
private void add(HPFW001 fFw001) { private void add(HPFW001 fFw001) {
fFw001.setAfterSaleNo(SequenceGenerator.getNextSequence(HPConstant.SequenceId.AFTER_SALE_NO)); fFw001.setAfterSaleNo(SequenceGenerator.getNextSequence(HPConstant.SequenceId.AFTER_SALE_NO));
fFw001.setStatus(HpFwConstant.HpFw001.Status.S0); fFw001.setStatus(HPConstant.dealStatus.S0);
fFw001.setDeleteFlag(CommonConstant.YesNo.NO_0); fFw001.setDeleteFlag(CommonConstant.YesNo.NO_0);
DaoUtils.insert(HPFW001.INSERT, fFw001); DaoUtils.insert(HPFW001.INSERT, fFw001);
} }
...@@ -126,8 +125,8 @@ public class ServiceHPFW001B extends ServiceEPBase { ...@@ -126,8 +125,8 @@ public class ServiceHPFW001B extends ServiceEPBase {
AssertUtils.isNull(dbFw001, String.format("售后服务单【%s】不存在", fFw001.getAfterSaleNo())); AssertUtils.isNull(dbFw001, String.format("售后服务单【%s】不存在", fFw001.getAfterSaleNo()));
AssertUtils.isNotEquals(dbFw001.getDeleteFlag(), CommonConstant.YesNo.NO_0, AssertUtils.isNotEquals(dbFw001.getDeleteFlag(), CommonConstant.YesNo.NO_0,
String.format("售后服务单【%s】不是\"未删除\"状态,不允许操作", dbFw001.getAfterSaleNo())); String.format("售后服务单【%s】不是\"未删除\"状态,不允许操作", dbFw001.getAfterSaleNo()));
AssertUtils.isNotEquals(dbFw001.getStatus(), HpFwConstant.HpFw001.Status.S0, AssertUtils.isNotEquals(dbFw001.getStatus(), HPConstant.dealStatus.S0,
String.format("售后服务单【%s】不是\"待回访\"状态,不允许操作", dbFw001.getAfterSaleNo())); String.format("售后服务单【%s】不是\"待处理\"状态,不允许操作", dbFw001.getAfterSaleNo()));
} }
} }
package com.baosight.hpjx.hp.fw.service;
import com.baosight.hpjx.aspect.annotation.OperationLogAnnotation;
import com.baosight.hpjx.core.constant.CommonConstant;
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.fw.constant.HpFwConstant;
import com.baosight.hpjx.hp.fw.constant.HpFwSqlConstant;
import com.baosight.hpjx.hp.fw.domain.HPFW002;
import com.baosight.hpjx.hp.fw.utils.HpFwUtils;
import com.baosight.hpjx.util.AssertUtils;
import com.baosight.hpjx.util.DateUtils;
import com.baosight.hpjx.util.EiInfoUtils;
import com.baosight.hpjx.util.LogUtils;
import com.baosight.hpjx.util.MapUtils;
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 java.util.List;
import java.util.Map;
/**
* 客户关怀
*
* @author:songx
* @date:2024/9/24,17:47
*/
public class ServiceHPFW002 extends ServiceBase {
/**
* 画面初始化
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "售后维修", operType = "查询", operDesc = "初始化")
public EiInfo initLoad(EiInfo inInfo) {
try {
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HPFW002().eiMetadata);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询操作.
*/
@Override
@OperationLogAnnotation(operModul = "售后维修", operType = "查询")
public EiInfo query(EiInfo inInfo) {
try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
queryMap.put(HPFW002.FIELD_CARE_DATE,
DateUtils.formatShort(queryMap.get(HPFW002.FIELD_CARE_DATE)));
inInfo = super.query(inInfo, HPFW002.QUERY, new HPFW002());
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
/**
* 删除操作
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "客户回访", operType = "删除")
public EiInfo remove(EiInfo inInfo) {
try {
List<HPFW002> fFw002s = MapUtils.toDaoEPBases(inInfo, HPFW002.class);
// db数据
Map<String, HPFW002> dbFw002Map = HpFwUtils.HpFw002.lockAndGet(fFw002s);
// 数据校验
this.checkRemoveData(fFw002s, dbFw002Map);
// 保存数据
this.removeData(fFw002s);
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + fFw002s.size() + "]条数据删除成功!");
} catch (Exception e) {
LogUtils.setMsg(inInfo, e, "删除失败");
}
return inInfo;
}
/**
* 数据校验
*
* @param fFw002s
* @param dbFw002Map
*/
private void checkRemoveData(List<HPFW002> fFw002s, Map<String, HPFW002> dbFw002Map) {
for (HPFW002 fFw002 : fFw002s) {
String careNo = fFw002.getCareNo();
HPFW002 dbFw002 = dbFw002Map.get(careNo);
AssertUtils.isNull(dbFw002, String.format("客户关怀单[%s]不存在", careNo));
AssertUtils.isNotEquals(HPConstant.dealStatus.S0, dbFw002.getStatus(),
String.format("客户关怀单[%s]状态不是\"待处理\",不允许操作", careNo));
}
}
/**
* 数据保存
*
* @param fFw002s
*/
private void removeData(List<HPFW002> fFw002s) {
for (HPFW002 fFw002 : fFw002s) {
fFw002.setDeleteFlag(CommonConstant.YesNo.YES_1);
DaoUtils.update(HPFW002.DELETE, fFw002.toMap());
}
}
/**
* 处理
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "客户回访", operType = "审核")
public EiInfo check(EiInfo inInfo) {
try {
List<HPFW002> fFw002s = MapUtils.toDaoEPBases(inInfo, HPFW002.class);
// db数据
Map<String, HPFW002> dbFw002Map = HpFwUtils.HpFw002.lockAndGet(fFw002s);
// 数据校验
this.checkCheckData(fFw002s, dbFw002Map);
// 保存数据
this.checkData(fFw002s);
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + fFw002s.size() + "]条数据处理成功!");
} catch (Exception e) {
LogUtils.setMsg(inInfo, e, "处理失败");
}
return inInfo;
}
/**
* 数据校验
*
* @param fFw002s
* @param dbFw002Map
*/
private void checkCheckData(List<HPFW002> fFw002s, Map<String, HPFW002> dbFw002Map) {
for (HPFW002 fFw002 : fFw002s) {
String careNo = fFw002.getCareNo();
HPFW002 dbFw002 = dbFw002Map.get(careNo);
AssertUtils.isNull(dbFw002, String.format("客户关怀单[%s]不存在", careNo));
AssertUtils.isNotEquals(HPConstant.dealStatus.S0, dbFw002.getStatus(),
String.format("客户关怀单[%s]状态不是\"待处理\",不允许操作", careNo));
}
}
/**
* 数据保存
*
* @param fFw002s
*/
private void checkData(List<HPFW002> fFw002s) {
for (HPFW002 fFw002 : fFw002s) {
fFw002.setStatus(HPConstant.dealStatus.S1);
fFw002.setDealUserId(UserSessionUtils.getLoginName());
fFw002.setDealUserName(UserSessionUtils.getLoginCName());
DaoUtils.update(HpFwSqlConstant.HpFw002.UPDATE_DEAL, fFw002.toMap());
}
}
}
package com.baosight.hpjx.hp.fw.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.DaoUtils;
import com.baosight.hpjx.hp.constant.HPConstant;
import com.baosight.hpjx.hp.fw.domain.HPFW002;
import com.baosight.hpjx.hp.fw.tools.HpFwTools;
import com.baosight.hpjx.hp.fw.utils.HpFwUtils;
import com.baosight.hpjx.util.AssertUtils;
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.MapUtils;
import com.baosight.hpjx.util.StringUtils;
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.ServiceEPBase;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import java.util.Arrays;
import java.util.Map;
/**
* 新增修改
*
* @author:songx
* @date:2022/7/11,11:08
*/
public class ServiceHPFW002B extends ServiceEPBase {
/**
* 初始化
*
* @param inInfo
* @return
*/
@Override
public EiInfo initLoad(EiInfo inInfo) {
try {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.USER_BLOCK_ID), null);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.CUSTOMER_RECORD_BLOCK_ID), null);
this.setBaseInfo(inInfo);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 保存操作.
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "客户回访", operType = "保存", operDesc = "保存")
public EiInfo save(EiInfo inInfo) {
try {
HPFW002 fFw002 = MapUtils.toDaoEPBase(inInfo, HPFW002.class);
fFw002.setCareDate(DateUtils.formatShort(fFw002.getCareDate()));
if (StringUtils.isBlank(fFw002.getCareNo())) {
this.add(fFw002);
} else {
this.modify(fFw002);
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 新增
*
* @param fFw002
*/
private void add(HPFW002 fFw002) {
fFw002.setCareNo(SequenceGenerator.getNextSequence(HPConstant.SequenceId.CARE_NO));
fFw002.setStatus(HPConstant.dealStatus.S0);
fFw002.setDeleteFlag(CommonConstant.YesNo.NO_0);
DaoUtils.insert(HPFW002.INSERT, fFw002);
}
/**
* 修改数据
*
* @param fFw002
*/
private void modify(HPFW002 fFw002) {
HPFW002 dbFw002 = HpFwUtils.HpFw002.lockAndGet(fFw002);
this.checkData(fFw002, dbFw002);
DaoUtils.update(HPFW002.UPDATE, fFw002);
}
/**
* 设置信息
*
* @param inInfo
*/
public void setBaseInfo(EiInfo inInfo) {
Map queryRow = EiInfoUtils.getFirstRow(inInfo);
String careNo = MapUtils.getString(queryRow, HPFW002.FIELD_CARE_NO);
if (StringUtils.isBlank(careNo)) {
return;
}
EiBlock resultBlock = new EiBlock(EiConstant.resultBlock);
resultBlock.addRow(HpFwTools.HpFw002.get(careNo));
resultBlock.addBlockMeta(new HPFW002().eiMetadata);
inInfo.setBlock(resultBlock);
}
/**
* 数据校验
*
* @param fFw002
* @param dbFw002
*/
private void checkData(HPFW002 fFw002, HPFW002 dbFw002) {
String careNo = fFw002.getCareNo();
AssertUtils.isNull(dbFw002, String.format("客户关怀单【%s】不存在", careNo));
AssertUtils.isNotEquals(dbFw002.getDeleteFlag(), CommonConstant.YesNo.NO_0,
String.format("客户关怀单【%s】不是\"未删除\"状态,不允许操作", careNo));
AssertUtils.isNotEquals(dbFw002.getStatus(), HPConstant.dealStatus.S0,
String.format("客户关怀单【%s】不是\"待处理\"状态,不允许操作", careNo));
}
}
<?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="HPFW002">
<sql id="column">
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-是 -->
STATUS as "status", <!-- 状态 0-未处理 1-已维修 -->
CARE_DATE as "careDate", <!-- 关怀日期 -->
CARE_NO as "careNo", <!-- 关怀单号 -->
CARE_WAY as "careWay", <!-- 关怀方式 -->
CARE_TYPE as "careType", <!-- 关怀类型 -->
CUSTOM_ID as "customId", <!-- 客户ID -->
CUSTOM_NAME as "customName", <!-- 客户名称 -->
DEAL_USER_ID as "dealUserId", <!-- 执行人ID -->
DEAL_USER_NAME as "dealUserName" <!-- 执行人名称 -->
</sql>
<sql id="condition">
AND DELETE_FLAG = 0
<include refid="idCondition"/>
<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="status">
STATUS = #status#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="careDate">
CARE_DATE = #careDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="careWay">
CARE_WAY = #careWay#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="careType">
CARE_TYPE = #careType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="customId">
CUSTOM_ID = #customId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="customName">
CUSTOM_NAME LIKE CONCAT('%', #customName#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="dealUserId">
DEAL_USER_ID = #dealUserId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="dealUserName">
DEAL_USER_NAME LIKE CONCAT('%', #dealUserName#, '%')
</isNotEmpty>
</sql>
<sql id="idCondition">
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="ids">
ID IN <iterate close=")" open="(" conjunction="," property="ids">#ids[]#</iterate>
</isNotEmpty>
<isNotEmpty prepend=" AND " property="careNo">
CARE_NO = #careNo#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="careNos">
CARE_NO IN <iterate close=")" open="(" conjunction="," property="careNos">#careNos[]#</iterate>
</isNotEmpty>
</sql>
<sql id="orderBy">
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
ID asc
</isEmpty>
</dynamic>
</sql>
<select id="query" resultClass="com.baosight.hpjx.hp.fw.domain.HPFW002">
SELECT
<include refid="column"/>
FROM ${hpjxSchema}.T_HPFW002 WHERE 1=1
<include refid="condition"/>
<include refid="orderBy"/>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hpjxSchema}.T_HPFW002 WHERE 1=1
<include refid="condition"/>
</select>
<insert id="insert">
INSERT INTO ${hpjxSchema}.T_HPFW002 (
COMPANY_CODE, <!-- 公司编码 -->
DEP_CODE, <!-- 部门编码 -->
CREATED_BY, <!-- 创建人 -->
CREATED_NAME, <!-- 创建人名称 -->
CREATED_TIME, <!-- 创建时间 -->
UPDATED_BY, <!-- 修改人 -->
UPDATED_NAME, <!-- 修改人名称 -->
UPDATED_TIME, <!-- 修改时间 -->
DELETE_FLAG, <!-- 是否删除 0-否1-是 -->
STATUS, <!-- 状态 0-未处理 1-已维修 -->
CARE_DATE, <!-- 关怀日期 -->
CARE_NO, <!-- 关怀单号 -->
CARE_WAY, <!-- 关怀方式 -->
CARE_TYPE, <!-- 关怀类型 -->
CUSTOM_ID, <!-- 客户ID -->
CUSTOM_NAME, <!-- 客户名称 -->
DEAL_USER_ID, <!-- 执行人ID -->
DEAL_USER_NAME <!-- 执行人名称 -->
) VALUES (
#companyCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#,
#updatedTime#, #deleteFlag#, #status#, #careDate#, #careNo#, #careWay#, #careType#,
#customId#, #customName#, #dealUserId#, #dealUserName#)
</insert>
<delete id="delete">
UPDATE ${hpjxSchema}.T_HPFW002 SET DELETE_FLAG = 1 WHERE CARE_NO = #careNo#
</delete>
<update id="update">
UPDATE ${hpjxSchema}.T_HPFW002
SET
CARE_DATE = #careDate#, <!-- 关怀日期 -->
CARE_NO = #careNo#, <!-- 关怀单号 -->
CARE_WAY = #careWay#, <!-- 关怀方式 -->
CARE_TYPE = #careType#, <!-- 关怀类型 -->
CUSTOM_ID = #customId#, <!-- 客户ID -->
CUSTOM_NAME = #customName#, <!-- 客户名称 -->
<include refid="SqlBase.updateRevise"/>
WHERE ID = #id#
</update>
<!-- 行锁 -->
<update id="lock">
UPDATE ${hpjxSchema}.T_HPFW002
SET CREATED_TIME = CREATED_TIME
WHERE 1=1
<include refid="idCondition"/>
</update>
<!-- 修改 -->
<update id="updateDeal">
UPDATE ${hpjxSchema}.T_HPFW002
SET
STATUS = #status#,
DEAL_USER_ID = #dealUserId#, <!-- 处理人ID -->
DEAL_USER_NAME = #dealUserName#, <!-- 处理人名称 -->
<include refid="SqlBase.updateRevise"/>
WHERE CARE_NO = #careNo#
</update>
</sqlMap>
...@@ -3,6 +3,7 @@ package com.baosight.hpjx.hp.fw.tools; ...@@ -3,6 +3,7 @@ package com.baosight.hpjx.hp.fw.tools;
import com.baosight.hpjx.core.dao.DaoBase; import com.baosight.hpjx.core.dao.DaoBase;
import com.baosight.hpjx.hp.fw.constant.HpFwSqlConstant; import com.baosight.hpjx.hp.fw.constant.HpFwSqlConstant;
import com.baosight.hpjx.hp.fw.domain.HPFW001; import com.baosight.hpjx.hp.fw.domain.HPFW001;
import com.baosight.hpjx.hp.fw.domain.HPFW002;
import com.baosight.hpjx.util.AssertUtils; import com.baosight.hpjx.util.AssertUtils;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
...@@ -87,4 +88,74 @@ public class HpFwTools { ...@@ -87,4 +88,74 @@ public class HpFwTools {
} }
/**
* @author:songx
* @date:2024/9/24,18:08
*/
public static class HpFw002 {
/**
* 锁.
*
* @param careNo
*/
public static void lock(String careNo) {
AssertUtils.isEmpty(careNo, "关怀单号不能为空!");
Map<String, Object> paramMap = new HashMap<>();
paramMap.put(HPFW002.FIELD_CARE_NO, careNo);
DaoBase.getInstance().update(HpFwSqlConstant.HpFw002.LOCK, paramMap);
}
/**
* 锁.
*
* @param careNos
*/
public static void lock(List<String> careNos) {
AssertUtils.isEmpty(careNos, "关怀单号不能为空!");
Map<String, Object> paramMap = new HashMap<>();
paramMap.put("careNos", careNos);
DaoBase.getInstance().update(HpFwSqlConstant.HpFw002.LOCK, paramMap);
}
/**
* 查询
*
* @param careNo
* @return
*/
public static HPFW002 get(String careNo) {
AssertUtils.isEmpty(careNo, "关怀单号不能为空!");
Map<String, Object> paramMap = new HashMap();
paramMap.put(HPFW002.FIELD_CARE_NO, careNo);
List<HPFW002> results = DaoBase.getInstance().query(HPFW002.QUERY, paramMap);
return CollectionUtils.isEmpty(results) ? null : results.get(0);
}
/**
* 查询
*
* @param careNos
* @return
*/
public static List<HPFW002> list(List<String> careNos) {
AssertUtils.isEmpty(careNos, "客户关怀单号不能为空");
Map<String, Object> paramMap = new HashMap();
paramMap.put("careNos", careNos);
return DaoBase.getInstance().query(HPFW002.QUERY, paramMap);
}
/**
* 查询
*
* @param careNos
* @return
*/
public static Map<String, HPFW002> map(List<String> careNos) {
List<HPFW002> results = list(careNos);
return results.stream().collect(Collectors.toMap(HPFW002::getCareNo, item -> item));
}
}
} }
package com.baosight.hpjx.hp.fw.utils; package com.baosight.hpjx.hp.fw.utils;
import com.baosight.hpjx.hp.fw.domain.HPFW001; import com.baosight.hpjx.hp.fw.domain.HPFW001;
import com.baosight.hpjx.hp.fw.domain.HPFW002;
import com.baosight.hpjx.hp.fw.tools.HpFwTools; import com.baosight.hpjx.hp.fw.tools.HpFwTools;
import com.baosight.hpjx.util.ObjectUtils; import com.baosight.hpjx.util.ObjectUtils;
...@@ -57,4 +58,47 @@ public class HpFwUtils { ...@@ -57,4 +58,47 @@ public class HpFwUtils {
} }
} }
/**
* @author:songx
* @date:2024/9/24,18:07
*/
public static class HpFw002 {
/**
* 锁并获取数据
*
* @param fFw002s
* @return
*/
public static Map<String, HPFW002> lockAndGet(List<HPFW002> fFw002s) {
List<String> careNos = ObjectUtils.listEpKey(fFw002s, HPFW002.FIELD_CARE_NO);
// 锁
HpFwTools.HpFw002.lock(careNos);
// 查询数据
return HpFwTools.HpFw002.map(careNos);
}
/**
* 锁并获取数据
*
* @param fFw002
* @return
*/
public static HPFW002 lockAndGet(HPFW002 fFw002) {
return lockAndGet(fFw002.getCareNo());
}
/**
* 锁并获取数据
*
* @param careNo
* @return
*/
public static HPFW002 lockAndGet(String careNo) {
// 锁
HpFwTools.HpFw002.lock(careNo);
// 查询数据
return HpFwTools.HpFw002.get(careNo);
}
}
} }
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
<!-- 产品服务 --> <!-- 产品服务 -->
<sqlMap resource="com/baosight/hpjx/hp/fw/sql/HPFW001.xml"/> <sqlMap resource="com/baosight/hpjx/hp/fw/sql/HPFW001.xml"/>
<sqlMap resource="com/baosight/hpjx/hp/fw/sql/HPFW002.xml"/>
<!--财务服务--> <!--财务服务-->
<sqlMap resource="com/baosight/hpjx/hp/cw/sql/HPCW001.xml"/> <sqlMap resource="com/baosight/hpjx/hp/cw/sql/HPCW001.xml"/>
......
...@@ -14,9 +14,9 @@ ...@@ -14,9 +14,9 @@
<EF:EFOption label="全部" value=""/> <EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="app.hpfw.afterSaleType"/> <EF:EFCodeOption codeName="app.hpfw.afterSaleType"/>
</EF:EFSelect> </EF:EFSelect>
<EF:EFSelect ename="status" cname="售后状态" blockId="inqu_status" row="0" colWidth="3"> <EF:EFSelect ename="status" cname="状态" blockId="inqu_status" row="0" colWidth="3">
<EF:EFOption label="全部" value=""/> <EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="app.hpfw.afterSaleStatus"/> <EF:EFCodeOption codeName="app.comm.dealStatus"/>
</EF:EFSelect> </EF:EFSelect>
<EF:EFInput ename="customName" cname="客户名称" blockId="inqu_status" row="0" colWidth="3"/> <EF:EFInput ename="customName" cname="客户名称" blockId="inqu_status" row="0" colWidth="3"/>
</div> </div>
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
</div> </div>
</EF:EFRegion> </EF:EFRegion>
<EF:EFRegion id="result" title="明细信息"> <EF:EFRegion id="result" title="明细信息" fitHeight="true">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row"> <EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row">
<EF:EFColumn ename="id" cname="ID" enable="false" hidden="true"/> <EF:EFColumn ename="id" cname="ID" enable="false" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="120" align="center"/> <EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="120" align="center"/>
...@@ -35,8 +35,8 @@ ...@@ -35,8 +35,8 @@
<EF:EFComboColumn ename="afterSaleType" cname="售后方式" enable="false" width="80" align="center"> <EF:EFComboColumn ename="afterSaleType" cname="售后方式" enable="false" width="80" align="center">
<EF:EFCodeOption codeName="app.hpfw.afterSaleType"/> <EF:EFCodeOption codeName="app.hpfw.afterSaleType"/>
</EF:EFComboColumn> </EF:EFComboColumn>
<EF:EFComboColumn ename="status" cname="售后状态" enable="false" width="80" align="center"> <EF:EFComboColumn ename="status" cname="状态" enable="false" width="80" align="center">
<EF:EFCodeOption codeName="app.hpfw.afterSaleStatus"/> <EF:EFCodeOption codeName="app.comm.dealStatus"/>
</EF:EFComboColumn> </EF:EFComboColumn>
<EF:EFComboColumn ename="urgency" cname="紧急程度" enable="false" width="80" align="center"> <EF:EFComboColumn ename="urgency" cname="紧急程度" enable="false" width="80" align="center">
<EF:EFCodeOption codeName="app.hpfw.afterSaleUrgency"/> <EF:EFCodeOption codeName="app.hpfw.afterSaleUrgency"/>
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
<EF:EFOption label="请选择" value=""/> <EF:EFOption label="请选择" value=""/>
<EF:EFOptions blockId="customer_record_block_id" textField="textField" valueField="valueField"/> <EF:EFOptions blockId="customer_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect> </EF:EFSelect>
<EF:EFInput ename="customName" cname="公司名称" blockId="result" row="0" colWidth="6" ratio="2:10" <EF:EFInput ename="customName" cname="客户名称" blockId="result" row="0" colWidth="6" ratio="2:10"
type="hidden"/> type="hidden"/>
</div> </div>
<br/> <br/>
......
$(function () {
IPLATUI.EFGrid = {
"result": {
pageable: {
pageSize: 20,
pageSizes: [20, 50, 100, 200],
},
columns: [{
field: "operator",
template: function (item) {
let status = item.status;
let template = '';
if (status && status == 0) {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;" '
+ 'onclick="modify(\'' + item.careNo + '\')" >修改</a>&nbsp;&nbsp;';
}
return template;
}
}],
loadComplete: function (grid) {
},
onSuccess: function (e) {
},
onRowClick: function (e) {
}
}
}
// 查询
$("#QUERY").on("click", query);
// 新增
$("#ADD").on("click", add);
// 删除
$("#REMOVE").on("click", remove);
// 处理
$("#CHECK").on("click", check);
// 键盘按键
downKeyUp();
});
/**
* 页面加载完成
*/
$(window).load(function () {
// 查询
query();
});
/**
* 查询
*/
let query = function () {
resultGrid.dataSource.page(1);
}
/**
* 新增
*/
let add = function () {
addOrUpdate("");
}
/**
* 修改
*/
let modify = function (careNo) {
let params = "inqu_status-0-careNo=" + careNo;
addOrUpdate(params);
}
/**
* 新增
*/
let addOrUpdate = function (params) {
JSColorbox.open({
href: "HPFW002B?" + params,
title: "<div style='text-align: center;'>" + (isBlank(params) ? "新增客户关怀" : "修改客户关怀") + "</div>",
width: "60%",
height: "70%",
callbackName: addOrUpdateCallback
});
}
/**
* 新增成功后回调
*/
let addOrUpdateCallback = function (res) {
// 消息
message(res.msg);
// 刷新列表
query();
// 关闭弹窗
JSColorbox.close();
}
/**
* 删除
*/
function remove() {
var rows = resultGrid.getCheckedRows();
if (rows.length == 0) {
message("请先勾选数据!");
return;
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"删除\"操作?", {
ok: function () {
JSUtils.submitGridsData("result", "HPFW002", "remove", true);
}
})
}
/**
* 处理
*
* @param id
* @param auditStatus
*/
function check(id) {
var rows = resultGrid.getCheckedRows();
if (rows.length == 0) {
message("请先勾选数据!");
return;
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"处理\"操作?", {
ok: function () {
JSUtils.submitGridsData("result", "HPFW002", "check", true);
}
})
}
<!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 ename="careDate" cname="关怀日期" blockId="inqu_status" row="0" colWidth="3"
format="yyyy-MM-dd" readonly="true"/>
<EF:EFSelect ename="careWay" cname="关怀方式" blockId="inqu_status" row="0" colWidth="3">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="app.hpfw.careWay"/>
</EF:EFSelect>
<EF:EFSelect ename="careType" cname="关怀类型" blockId="inqu_status" row="0" colWidth="3">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="app.hpfw.careType"/>
</EF:EFSelect>
<EF:EFSelect ename="status" cname="状态" blockId="inqu_status" row="0" colWidth="3">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="app.comm.dealStatus"/>
</EF:EFSelect>
</div>
<div class="row">
<EF:EFInput ename="customName" cname="客户名称" blockId="inqu_status" row="0" colWidth="3"/>
<EF:EFInput ename="dealUserName" cname="处理人名称" blockId="inqu_status" row="0" colWidth="3"/>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="明细信息" fitHeight="true">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row">
<EF:EFColumn ename="id" cname="ID" enable="false" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="120" align="center"/>
<EF:EFColumn ename="careNo" cname="关怀单号" enable="false" width="100" align="center"/>
<EF:EFColumn ename="careDate" cname="关怀日期" enable="false" width="100" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']"/>
<EF:EFComboColumn ename="status" cname="状态" enable="false" width="80" align="center">
<EF:EFCodeOption codeName="app.comm.dealStatus"/>
</EF:EFComboColumn>
<EF:EFComboColumn ename="careWay" cname="关怀方式" enable="false" width="80" align="center">
<EF:EFCodeOption codeName="app.hpfw.careWay"/>
</EF:EFComboColumn>
<EF:EFComboColumn ename="careType" cname="关怀类型" enable="false" width="80" align="center">
<EF:EFCodeOption codeName="app.hpfw.careType"/>
</EF:EFComboColumn>
<EF:EFColumn ename="customId" cname="客户ID" enable="false" width="120" align="center" hidden="true"/>
<EF:EFColumn ename="customName" cname="客户名称" enable="false" width="120" align="center"/>
<EF:EFColumn ename="dealUserId" cname="处理人ID" enable="false" width="120" align="center"/>
<EF:EFColumn ename="dealUserName" cname="处理人名称" enable="false" width="120" align="center"/>
<EF:EFColumn ename="createdName" cname="创建人" enable="false" width="100" align="center"/>
<EF:EFColumn ename="createdTime" cname="创建时间" enable="false" width="150" align="center"
editType="datetime" parseFormats="['yyyyMMddHHmmss']" dateFormat="yyyy-MM-dd HH:mm:ss"/>
<EF:EFColumn cname="修改人" ename="updatedName" enable="false" width="100" align="center"/>
<EF:EFColumn cname="修改时间" ename="updatedTime" enable="false" width="150" align="center"
editType="datetime" parseFormats="['yyyyMMddHHmmss']" dateFormat="yyyy-MM-dd HH:mm:ss"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
$(function () {
IPLATUI.EFSelect = {
"result-0-customId": {
select: function (e) {
var dataItem = e.dataItem;
var valueField = dataItem['valueField'];
var textField = dataItem['textField'];
if (valueField) {
textField = textField.indexOf("-") > -1 ? textField.split("-")[1] : textField;
$("#result-0-customName").val(textField);
} else {
$("#result-0-customName").val("");
}
}
}
}
IPLATUI.EFGrid = {
"result": {
pageable: false,
exportGrid: false,
toolbarConfig: {
hidden: false,
},
columns: [],
loadComplete: function (grid) {
},
onSuccess: function (e) {
}
}
};
// 确认
$('#SAVE').on('click', save);
// 键盘按键
downKeyUp();
})
/**
* 保存
*/
let save = function () {
let careDate = $("#result-0-careDate").val();
if (isBlank(careDate)) {
message("关怀日期不能为空");
return;
}
let careWay = $("#result-0-careWay").val();
if (isBlank(careWay)) {
message("关怀方式不能为空");
return;
}
let careType = $("#result-0-careType").val();
if (isBlank(careType)) {
message("关怀类型不能为空");
return;
}
JSUtils.confirm("确定对数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGridsData("", "HPFW002B", "save", true, function (res) {
if (res.status > -1) {
parent.JSColorbox.setValueCallback(res);
} else {
message(res.msg);
}
});
}
});
}
<!DOCTYPE html>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<EF:EFPage title="客户关怀单详情">
<EF:EFRegion id="result" title="数据区域">
<EF:EFInput ename="id" cname="ID" blockId="result" row="0" type="hidden"/>
<div class="row">
<EF:EFInput ename="careNo" cname="客户关怀单号" blockId="result" row="0" colWidth="6" ratio="2:10"
required="true" readonly="true"/>
</div>
<div class="row">
<EF:EFDatePicker ename="careDate" cname="关怀日期" blockId="result" row="0" colWidth="6" ratio="2:10"
format="yyyy-MM-dd" readonly="true"/>
</div>
<div class="row">
<EF:EFSelect ename="careWay" cname="关怀方式" blockId="result" row="0" colWidth="6" ratio="2:10">
<EF:EFOption label="请选择" value=""/>
<EF:EFCodeOption codeName="app.hpfw.careWay"/>
</EF:EFSelect>
</div>
<div class="row">
<EF:EFSelect ename="careType" cname="关怀类型" blockId="result" row="0" colWidth="6" ratio="2:10">
<EF:EFOption label="请选择" value=""/>
<EF:EFCodeOption codeName="app.hpfw.careType"/>
</EF:EFSelect>
</div>
<div class="row">
<EF:EFSelect ename="customId" cname="客户名称" blockId="result" row="0" colWidth="6" ratio="2:10"
filter="contains">
<EF:EFOption label="请选择" value=""/>
<EF:EFOptions blockId="customer_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFInput ename="customName" cname="客户名称" blockId="result" row="0" colWidth="6" ratio="2:10"
type="hidden"/>
</div>
<br/>
<span style="color: red; ">说明:客户关怀单号由系统自动生成</span><br>
</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