Commit 6ebe8cde by 宋祥

1.客户关怀功能

parent ddca8ec8
......@@ -97,6 +97,8 @@ public class HPConstant {
public static final String HPCW002_BILL_NUMBER = "HPCW002_BILL_NUMBER";
// 售后单号
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 {
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 {
*/
public static class HpFw001 {
}
/**
* 售后状态
* HPFW001 定义
*
* @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 {
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";
}
}
......@@ -4,6 +4,7 @@ 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.HPFW001;
......@@ -38,6 +39,7 @@ public class ServiceHPFW001 extends ServiceBase {
@OperationLogAnnotation(operModul = "售后维修", operType = "查询", operDesc = "初始化")
public EiInfo initLoad(EiInfo inInfo) {
try {
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HPFW001().eiMetadata);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
......@@ -97,7 +99,7 @@ public class ServiceHPFW001 extends ServiceBase {
String afterSaleNo = fFw001.getAfterSaleNo();
HPFW001 dbFw001 = dbFw001Map.get(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));
}
}
......@@ -150,7 +152,7 @@ public class ServiceHPFW001 extends ServiceBase {
String afterSaleNo = fFw001.getAfterSaleNo();
HPFW001 dbFw001 = dbFw001Map.get(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));
}
}
......@@ -162,7 +164,7 @@ public class ServiceHPFW001 extends ServiceBase {
*/
private void checkData(List<HPFW001> fFw001s) {
for (HPFW001 fFw001 : fFw001s) {
fFw001.setStatus(HpFwConstant.HpFw001.Status.S1);
fFw001.setStatus(HPConstant.dealStatus.S1);
fFw001.setDealUserId(UserSessionUtils.getLoginName());
fFw001.setDealUserName(UserSessionUtils.getLoginCName());
DaoUtils.update(HpFwSqlConstant.HpFw001.UPDATE_DEAL, fFw001.toMap());
......
......@@ -5,7 +5,6 @@ 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.constant.HpFwConstant;
import com.baosight.hpjx.hp.fw.domain.HPFW001;
import com.baosight.hpjx.hp.fw.tools.HpFwTools;
import com.baosight.hpjx.hp.fw.utils.HpFwUtils;
......@@ -83,7 +82,7 @@ public class ServiceHPFW001B extends ServiceEPBase {
*/
private void add(HPFW001 fFw001) {
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);
DaoUtils.insert(HPFW001.INSERT, fFw001);
}
......@@ -126,8 +125,8 @@ public class ServiceHPFW001B extends ServiceEPBase {
AssertUtils.isNull(dbFw001, String.format("售后服务单【%s】不存在", fFw001.getAfterSaleNo()));
AssertUtils.isNotEquals(dbFw001.getDeleteFlag(), CommonConstant.YesNo.NO_0,
String.format("售后服务单【%s】不是\"未删除\"状态,不允许操作", dbFw001.getAfterSaleNo()));
AssertUtils.isNotEquals(dbFw001.getStatus(), HpFwConstant.HpFw001.Status.S0,
String.format("售后服务单【%s】不是\"待回访\"状态,不允许操作", dbFw001.getAfterSaleNo()));
AssertUtils.isNotEquals(dbFw001.getStatus(), HPConstant.dealStatus.S0,
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;
import com.baosight.hpjx.core.dao.DaoBase;
import com.baosight.hpjx.hp.fw.constant.HpFwSqlConstant;
import com.baosight.hpjx.hp.fw.domain.HPFW001;
import com.baosight.hpjx.hp.fw.domain.HPFW002;
import com.baosight.hpjx.util.AssertUtils;
import org.apache.commons.collections.CollectionUtils;
......@@ -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;
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.util.ObjectUtils;
......@@ -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 @@
<!-- 产品服务 -->
<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"/>
......
......@@ -14,9 +14,9 @@
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="app.hpfw.afterSaleType"/>
</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:EFCodeOption codeName="app.hpfw.afterSaleStatus"/>
<EF:EFCodeOption codeName="app.comm.dealStatus"/>
</EF:EFSelect>
<EF:EFInput ename="customName" cname="客户名称" blockId="inqu_status" row="0" colWidth="3"/>
</div>
......@@ -25,7 +25,7 @@
</div>
</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:EFColumn ename="id" cname="ID" enable="false" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="120" align="center"/>
......@@ -35,8 +35,8 @@
<EF:EFComboColumn ename="afterSaleType" cname="售后方式" enable="false" width="80" align="center">
<EF:EFCodeOption codeName="app.hpfw.afterSaleType"/>
</EF:EFComboColumn>
<EF:EFComboColumn ename="status" cname="售后状态" enable="false" width="80" align="center">
<EF:EFCodeOption codeName="app.hpfw.afterSaleStatus"/>
<EF:EFComboColumn ename="status" cname="状态" enable="false" width="80" align="center">
<EF:EFCodeOption codeName="app.comm.dealStatus"/>
</EF:EFComboColumn>
<EF:EFComboColumn ename="urgency" cname="紧急程度" enable="false" width="80" align="center">
<EF:EFCodeOption codeName="app.hpfw.afterSaleUrgency"/>
......
......@@ -35,7 +35,7 @@
<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"
<EF:EFInput ename="customName" cname="客户名称" blockId="result" row="0" colWidth="6" ratio="2:10"
type="hidden"/>
</div>
<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