Commit 2a1f8824 by 宋祥

1.售后维修功能

parent 0de5a647
...@@ -136,7 +136,10 @@ public class HGConstant { ...@@ -136,7 +136,10 @@ public class HGConstant {
public static final String WD_FILE_ID = "WD_FILE_ID"; public static final String WD_FILE_ID = "WD_FILE_ID";
// 回访单号 // 回访单号
public static final String FOL_NO = "FOL_NO"; public static final String FOL_NO = "FOL_NO";
// 维修单号
public static final String REP_ORDER_NO = "REP_ORDER_NO";
} }
/** /**
......
...@@ -7,7 +7,7 @@ package com.baosight.hggp.hg.xs.constant; ...@@ -7,7 +7,7 @@ package com.baosight.hggp.hg.xs.constant;
public class HgXsConstant { public class HgXsConstant {
/** /**
* 状态 * 回访状态
* *
* @author:songx * @author:songx
* @date:2024/5/7,16:36 * @date:2024/5/7,16:36
...@@ -20,4 +20,17 @@ public class HgXsConstant { ...@@ -20,4 +20,17 @@ public class HgXsConstant {
public static final Integer S1 = 1; public static final Integer S1 = 1;
} }
/**
* 维修状态
*
* @author:songx
* @date:2024/5/7,16:36
*/
public static class RepStatus {
// 待维修
public static final Integer S0 = 0;
// 已维修
public static final Integer S1 = 1;
}
} }
...@@ -29,6 +29,20 @@ public class HgXsSqlConstant { ...@@ -29,6 +29,20 @@ public class HgXsSqlConstant {
} }
/** /**
* 售后维修
*
* @author:songx
* @date:2024/5/7,16:36
*/
public static class HgXs006 {
// 审核
public static final String CHECK = "HGXS006.check";
// 锁
public static final String LOCK = "HGXS006.lock";
}
/**
* 客户回访 * 客户回访
* *
* @author:songx * @author:songx
......
package com.baosight.hggp.hg.xs.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.hg.xs.constant.HgXsConstant;
import com.baosight.hggp.hg.xs.constant.HgXsSqlConstant;
import com.baosight.hggp.hg.xs.domain.HGXS006;
import com.baosight.hggp.hg.xs.domain.HGXS007;
import com.baosight.hggp.hg.xs.utils.HGXSUtils;
import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.DateUtils;
import com.baosight.hggp.util.EiInfoUtils;
import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.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.Arrays;
import java.util.List;
import java.util.Map;
/**
* 售后维修
*
* @author:songx
* @date:2024/8/27,9:05
*/
public class ServiceHGXS006 extends ServiceBase {
/**
* 画面初始化
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "客户回访", operType = "查询", operDesc = "初始化")
public EiInfo initLoad(EiInfo inInfo) {
try {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.COMPANY_CODE_BLOCK_ID));
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGXS006().eiMetadata);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询操作
*
* @param inInfo
* @return
*/
@Override
@OperationLogAnnotation(operModul = "客户回访", operType = "查询")
public EiInfo query(EiInfo inInfo) {
try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
queryMap.put(HGXS006.FIELD_REP_DATE, DateUtils.formatShort(queryMap.get(HGXS006.FIELD_REP_DATE)));
inInfo = super.query(inInfo, HGXS006.QUERY, new HGXS006());
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
/**
* 删除操作
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "客户回访", operType = "删除")
public EiInfo remove(EiInfo inInfo) {
try {
List<HGXS006> fXs006s = MapUtils.toDaoEPBases(inInfo, HGXS006.class);
Map<Long, HGXS006> dbXs006s = HGXSUtils.HgXs006.lockAndGet(fXs006s);
for (HGXS006 fXs006 : fXs006s) {
Long id = fXs006.getId();
HGXS006 dbXs006 = dbXs006s.get(id);
this.checkData(dbXs006);
DaoUtils.update(HGXS006.DELETE, fXs006);
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + fXs006s.size() + "]条数据删除成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "删除失败");
}
return inInfo;
}
/**
* 审核
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "客户回访", operType = "审核")
public EiInfo check(EiInfo inInfo) {
try {
List<HGXS006> fXs006s = MapUtils.toDaoEPBases(inInfo, HGXS006.class);
Map<Long, HGXS006> dbXs006s = HGXSUtils.HgXs006.lockAndGet(fXs006s);
for (HGXS006 fXs006 : fXs006s) {
Long id = fXs006.getId();
HGXS006 dbXs006 = dbXs006s.get(id);
this.checkData(dbXs006);
fXs006.setRepStatus(HgXsConstant.RepStatus.S1);
DaoUtils.update(HgXsSqlConstant.HgXs006.CHECK, fXs006);
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + fXs006s.size() + "]条数据审核成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "审核失败");
}
return inInfo;
}
/**
* 检查状态
*
* @param inInfo
* @return
*/
public EiInfo checkStatus(EiInfo inInfo) {
try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
Long id = MapUtils.getLong(queryMap, HGXS006.FIELD_ID);
HGXS006 dbXs006 = HGXSUtils.HgXs006.lockAndGet(id);
this.checkData(dbXs006);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "操作失败");
}
return inInfo;
}
/**
* 数据校验
*
* @param dbXs006
*/
private void checkData(HGXS006 dbXs006) {
AssertUtils.isNotEquals(dbXs006.getDeleteFlag(), CommonConstant.YesNo.NO_0,
String.format("回访单【%s】不是\"未删除\"状态,不允许操作", dbXs006.getId()));
AssertUtils.isNotEquals(dbXs006.getRepStatus(), HgXsConstant.RepStatus.S0,
String.format("回访单【%s】不是\"待维修\"状态,不允许操作", dbXs006.getId()));
}
}
package com.baosight.hggp.hg.xs.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.enums.DeleteFlagEnum;
import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.xs.constant.HgXsConstant;
import com.baosight.hggp.hg.xs.domain.HGXS006;
import com.baosight.hggp.hg.xs.domain.HGXS007;
import com.baosight.hggp.hg.xs.tools.HGXSTools;
import com.baosight.hggp.hg.xs.utils.HGXSUtils;
import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.DateUtils;
import com.baosight.hggp.util.EiInfoUtils;
import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.MapUtils;
import com.baosight.hggp.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 ServiceHGXS0061 extends ServiceEPBase {
/**
* 初始化
*
* @param inInfo
* @return
*/
@Override
public EiInfo initLoad(EiInfo inInfo) {
try {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.COMPANY_CODE_BLOCK_ID));
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.USER_BLOCK_ID));
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.CUSTOMER_RECORD_BLOCK_ID));
this.setProjectInfo(inInfo);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 保存操作.
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "客户回访", operType = "保存", operDesc = "保存")
public EiInfo save(EiInfo inInfo) {
try {
HGXS006 fXs006 = MapUtils.toDaoEPBase(inInfo, HGXS006.class);
fXs006.setRepDate(DateUtils.formatShort(fXs006.getRepDate()));
if (StringUtils.isBlank(fXs006.getRepOrderNo())) {
this.add(fXs006);
} else {
this.modify(fXs006);
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 新增
*
* @param fXs006
*/
private void add(HGXS006 fXs006) {
fXs006.setRepOrderNo(SequenceGenerator.getNextSequence(HGConstant.SequenceId.REP_ORDER_NO));
fXs006.setRepStatus(HgXsConstant.RepStatus.S0);
fXs006.setDeleteFlag(DeleteFlagEnum.UN_REMOVE.getCode());
DaoUtils.insert(HGXS006.INSERT, fXs006);
}
/**
* 修改数据
*
* @param fXs006
*/
private void modify(HGXS006 fXs006) {
HGXS006 dbXs006 = HGXSUtils.HgXs006.lockAndGet(fXs006);
this.checkData(dbXs006);
DaoUtils.update(HGXS006.UPDATE, fXs006);
}
/**
* 设置项目信息
*
* @param inInfo
*/
public void setProjectInfo(EiInfo inInfo) {
Map queryRow = EiInfoUtils.getFirstRow(inInfo);
Long id = MapUtils.getLong(queryRow, HGXS006.FIELD_ID);
if (id == null) {
return;
}
EiBlock resultBlock = new EiBlock(EiConstant.resultBlock);
resultBlock.addRow(HGXSTools.HgXs006.get(id));
resultBlock.addBlockMeta(new HGXS006().eiMetadata);
inInfo.setBlock(resultBlock);
}
/**
* 数据校验
*
* @param dbXs006
*/
private void checkData(HGXS006 dbXs006) {
AssertUtils.isNotEquals(dbXs006.getDeleteFlag(), CommonConstant.YesNo.NO_0,
String.format("维修单【%s】不是\"未删除\"状态,不允许操作", dbXs006.getId()));
AssertUtils.isNotEquals(dbXs006.getRepStatus(), HgXsConstant.FolStatus.S0,
String.format("维修单【%s】不是\"待维修\"状态,不允许操作", dbXs006.getId()));
}
}
<?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="HGXS006">
<sql id="column">
ID as "id", <!-- ID -->
ACCOUNT_CODE as "accountCode", <!-- 账套 -->
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-是 -->
COMPANY_CODE as "companyCode", <!-- 公司编码 -->
COMPANY_NAME as "companyName", <!-- 公司名称 -->
REP_ORDER_NO as "repOrderNo", <!-- 维修单号 -->
REP_DATE as "repDate", <!-- 维修日期 -->
REP_CUSTOM_ID as "repCustomId", <!-- 客户人员ID -->
REP_CUSTOM_NAME as "repCustomName", <!-- 客户人员姓名 -->
REP_USER_ID as "repUserId", <!-- 维修人员 -->
REP_USER_NAME as "repUserName", <!-- 维修人员姓名 -->
REP_STATUS as "repStatus" <!-- 维修状态 0-待维修 1-已维修 -->
</sql>
<sql id="condition">
AND DELETE_FLAG = 0
<include refid="HGXSDataAuth.authCondition"/>
<include refid="idCondition"/>
<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="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyName">
COMPANY_NAME = #companyName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="repOrderNo">
REP_ORDER_NO = #repOrderNo#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="repDate">
REP_DATE = #repDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="repCustomId">
REP_CUSTOM_ID = #repCustomId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="repCustomName">
REP_CUSTOM_NAME LIKE CONCAT('%', #repCustomName#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="repUserId">
REP_USER_ID = #repUserId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="repUserName">
REP_USER_NAME LIKE CONCAT('%', #repUserName#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="repStatus">
REP_STATUS = #repStatus#
</isNotEmpty>
</sql>
<sql id="idCondition">
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="ids">
ID IN <iterate open="(" close=")" conjunction="," property="ids">#ids[]#</iterate>
</isNotEmpty>
<isNotEmpty prepend=" AND " property="repOrderNo">
REP_ORDER_NO = #repOrderNo#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="repOrderNos">
REP_ORDER_NO IN <iterate open="(" close=")" conjunction="," property="repOrderNos">#repOrderNos[]#</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.hggp.hg.xs.domain.HGXS006">
SELECT
<include refid="column"/>
FROM ${hggpSchema}.HGXS006
WHERE 1=1
<include refid="condition" />
<include refid="orderBy"/>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hggpSchema}.HGXS006 WHERE 1=1
<include refid="condition"/>
</select>
<insert id="insert">
INSERT INTO ${hggpSchema}.HGXS006 (
ACCOUNT_CODE, <!-- 账套 -->
DEP_CODE, <!-- 部门编码 -->
CREATED_BY, <!-- 创建人 -->
CREATED_NAME, <!-- 创建人名称 -->
CREATED_TIME, <!-- 创建时间 -->
DELETE_FLAG, <!-- 是否删除 0-否1-是 -->
COMPANY_CODE, <!-- 公司编码 -->
COMPANY_NAME, <!-- 公司名称 -->
REP_ORDER_NO, <!-- 维修单号 -->
REP_DATE, <!-- 维修日期 -->
REP_CUSTOM_ID, <!-- 客户人员ID -->
REP_CUSTOM_NAME, <!-- 客户人员姓名 -->
REP_USER_ID, <!-- 维修人员 -->
REP_USER_NAME, <!-- 维修人员姓名 -->
REP_STATUS <!-- 维修状态 0-待维修 1-已维修 -->
) VALUES (
#accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#,
#deleteFlag#, #companyCode#, #companyName#, #repOrderNo#, #repDate#, #repCustomId#,
#repCustomName#, #repUserId#, #repUserName#, #repStatus#
)
</insert>
<delete id="delete">
UPDATE ${hggpSchema}.HGXS006
SET DELETE_FLAG = 1,
<include refid="SqlBase.updateRevise"/>
WHERE ID = #id#
</delete>
<update id="update">
UPDATE ${hggpSchema}.HGXS006
SET
COMPANY_CODE = #companyCode#, <!-- 公司编码 -->
COMPANY_NAME = #companyName#, <!-- 公司名称 -->
REP_DATE = #repDate#, <!-- 维修日期 -->
REP_CUSTOM_ID = #repCustomId#, <!-- 客户人员ID -->
REP_CUSTOM_NAME = #repCustomName#, <!-- 客户人员姓名 -->
REP_USER_ID = #repUserId#, <!-- 维修人员 -->
REP_USER_NAME = #repUserName#, <!-- 维修人员姓名 -->
<include refid="SqlBase.updateRevise"/>
WHERE ID = #id#
</update>
<!-- 行锁 -->
<update id="lock">
UPDATE ${hggpSchema}.HGXS006
SET CREATED_TIME = CREATED_TIME
WHERE 1=1
<include refid="idCondition"/>
</update>
<!-- 审核 -->
<update id="check">
UPDATE ${hggpSchema}.HGXS006
SET
REP_STATUS = #repStatus#, <!-- 状态 0-待维修 1-已维修 -->
<include refid="SqlBase.updateRevise"/>
WHERE ID = #id#
</update>
</sqlMap>
...@@ -5,6 +5,7 @@ import com.baosight.hggp.core.enums.OrgTypeEnum; ...@@ -5,6 +5,7 @@ import com.baosight.hggp.core.enums.OrgTypeEnum;
import com.baosight.hggp.core.security.UserSessionUtils; import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.constant.HGSqlConstant; import com.baosight.hggp.hg.constant.HGSqlConstant;
import com.baosight.hggp.hg.xs.constant.HgXsSqlConstant; import com.baosight.hggp.hg.xs.constant.HgXsSqlConstant;
import com.baosight.hggp.hg.xs.domain.HGXS006;
import com.baosight.hggp.hg.xs.domain.HGXS007; import com.baosight.hggp.hg.xs.domain.HGXS007;
import com.baosight.hggp.hg.xs.domain.Org; import com.baosight.hggp.hg.xs.domain.Org;
import com.baosight.hggp.hg.xs.domain.User; import com.baosight.hggp.hg.xs.domain.User;
...@@ -36,6 +37,84 @@ import java.util.stream.Collectors; ...@@ -36,6 +37,84 @@ import java.util.stream.Collectors;
public class HGXSTools { public class HGXSTools {
/** /**
* 售后维修
*
* @author:songx
* @date:2024/9/13,10:40
*/
public static class HgXs006 {
/**
* 锁.
*
* @param id ID
*/
public static void lock(Long id) {
AssertUtils.isNull(id, "ID不能为空!");
Map<String, Object> map = new HashMap<>();
map.put(HGXS006.FIELD_ID, id);
DaoBase.getInstance().update(HgXsSqlConstant.HgXs006.LOCK, map);
}
/**
* 锁.
*
* @param ids ID
*/
public static void lock(List<Long> ids) {
AssertUtils.isEmpty(ids, "ID不能为空!");
Map<String, Object> map = new HashMap<>();
map.put("ids", ids);
DaoBase.getInstance().update(HgXsSqlConstant.HgXs006.LOCK, map);
}
/**
* 查询
*
* @param id ID
* @return
*/
public static HGXS006 get(Long id) {
if (id == null) {
return null;
}
Map<String, Object> paramMap = new HashMap();
paramMap.put(HGXS006.FIELD_ID, id);
List<HGXS006> results = DaoBase.getInstance().query(HGXS006.QUERY, paramMap);
return CollectionUtils.isEmpty(results) ? null : results.get(0);
}
/**
* 查询
*
* @param ids ID
* @return
*/
public static List<HGXS006> list(List<Long> ids) {
if (CollectionUtils.isEmpty(ids)) {
return null;
}
Map<String, Object> paramMap = new HashMap();
paramMap.put("ids", ids);
return DaoBase.getInstance().query(HGXS006.QUERY, paramMap);
}
/**
* 查询
*
* @param ids ID
* @return
*/
public static Map<Long, HGXS006> map(List<Long> ids) {
List<HGXS006> results = list(ids);
if (CollectionUtils.isEmpty(results)) {
return null;
}
return results.stream().collect(Collectors.toMap(HGXS006::getId, item -> item));
}
}
/**
* 客户回访 * 客户回访
* *
* @author:songx * @author:songx
...@@ -106,6 +185,9 @@ public class HGXSTools { ...@@ -106,6 +185,9 @@ public class HGXSTools {
*/ */
public static Map<Long, HGXS007> map(List<Long> ids) { public static Map<Long, HGXS007> map(List<Long> ids) {
List<HGXS007> results = list(ids); List<HGXS007> results = list(ids);
if(CollectionUtils.isEmpty(results)){
return null;
}
return results.stream().collect(Collectors.toMap(HGXS007::getId, item -> item)); return results.stream().collect(Collectors.toMap(HGXS007::getId, item -> item));
} }
} }
......
package com.baosight.hggp.hg.xs.utils; package com.baosight.hggp.hg.xs.utils;
import com.baosight.hggp.core.constant.CommonConstant; import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.hg.xs.domain.HGXS006;
import com.baosight.hggp.hg.xs.domain.HGXS007; import com.baosight.hggp.hg.xs.domain.HGXS007;
import com.baosight.hggp.hg.xs.domain.Org; import com.baosight.hggp.hg.xs.domain.Org;
import com.baosight.hggp.hg.xs.domain.User; import com.baosight.hggp.hg.xs.domain.User;
...@@ -140,6 +141,52 @@ public class HGXSUtils { ...@@ -140,6 +141,52 @@ public class HGXSUtils {
} }
/** /**
* 售后维修
*
* @author:songx
* @date:2024/9/13,10:39
*/
public static class HgXs006 {
/**
* 锁并获取数据
*
* @param id
* @return
*/
public static HGXS006 lockAndGet(Long id) {
// 锁
HGXSTools.HgXs006.lock(id);
// 查询数据
return HGXSTools.HgXs006.get(id);
}
/**
* 锁并获取数据
*
* @param fXs006
* @return
*/
public static HGXS006 lockAndGet(HGXS006 fXs006) {
return lockAndGet(fXs006.getId());
}
/**
* 锁并获取数据
*
* @param fXs006s
* @return
*/
public static Map<Long, HGXS006> lockAndGet(List<HGXS006> fXs006s) {
List<Long> ids = ObjectUtils.listEpKey(fXs006s, HGXS007.FIELD_ID);
// 锁
HGXSTools.HgXs006.lock(ids);
// 查询数据
return HGXSTools.HgXs006.map(ids);
}
}
/**
* 客户回访 * 客户回访
* *
* @author:songx * @author:songx
......
...@@ -12,6 +12,9 @@ ...@@ -12,6 +12,9 @@
<!-- 数据权限 --> <!-- 数据权限 -->
<sqlMap resource="com/baosight/hggp/hg/xs/sql/HGXSDataAuth.xml"/> <sqlMap resource="com/baosight/hggp/hg/xs/sql/HGXSDataAuth.xml"/>
<!-- 客户服务-->
<sqlMap resource="com/baosight/hggp/hg/xs/sql/HGXS006.xml"/>
<sqlMap resource="com/baosight/hggp/hg/xs/sql/HGXS007.xml"/> <sqlMap resource="com/baosight/hggp/hg/xs/sql/HGXS007.xml"/>
<!-- 工具 --> <!-- 工具 -->
......
$(function () {
IPLATUI.EFGrid = {
"result": {
pageable: {
pageSize: 20,
pageSizes: [20, 50, 100, 200],
},
columns: [{
field: "operator",
template: function (item) {
let status = item.repStatus;
let template = '';
if (status && status == 0) {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;" '
+ 'onclick="modify(' + item.id + ')" >修改</a>&nbsp;&nbsp;';
}
return template;
}
}],
loadComplete: function (grid) {
},
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 (id) {
let params = "inqu_status-0-id=" + id;
addOrUpdate(params);
}
/**
* 新增
*/
let addOrUpdate = function (params) {
JSColorbox.open({
href: "HGXS0061?" + 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", "HGXS006", "remove",
false, function (res) {
message(res.msg);
if (res.status > -1) {
resultGrid.dataSource.page(1);
}
}
);
}
})
}
/**
* 审核
*
* @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", "HGXS006", "check",
false, function (res) {
message(res.msg);
if (res.status > -1) {
resultGrid.dataSource.page(1);
}
}
);
}
})
}
<!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:EFSelect cname="公司名称" blockId="inqu_status" ename="companyCode" row="0" colWidth="3"
filter="contains" optionLabel="全部" defultValue="">
<EF:EFOptions blockId="company_code_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFDatePicker cname="维修日期" ename="repDate" blockId="inqu_status" row="0" colWidth="3"
format="yyyy-MM-dd" readonly="true"/>
<EF:EFInput cname="客户人员" ename="repCustomName" blockId="inqu_status" row="0" colWidth="3"/>
<EF:EFInput cname="维修人员" ename="repUserName" blockId="inqu_status" row="0" colWidth="3"/>
</div>
<div class="row">
<EF:EFSelect cname="维修状态" ename="repStatus" blockId="inqu_status" row="0" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hggp.xs.repStatus"/>
</EF:EFSelect>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="明细信息">
<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="companyCode" cname="公司编码" hidden="true"/>
<EF:EFColumn ename="companyName" cname="公司名称" enable="false" width="220" align="left"/>
<EF:EFColumn ename="repOrderNo" cname="维修单号" enable="false" width="100" align="center"/>
<EF:EFColumn ename="repDate" cname="维修日期" enable="false" width="100" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']"/>
<EF:EFComboColumn ename="repStatus" cname="维修状态" enable="false" width="80" align="center">
<EF:EFCodeOption codeName="hggp.xs.repStatus"/>
</EF:EFComboColumn>
<EF:EFColumn cname="客户人员" ename="repCustomName" enable="false" width="120" align="center"/>
<EF:EFColumn cname="维修人员" ename="repUserName" enable="false" width="120" align="center"/>
<EF:EFColumn cname="创建人" ename="createdName" enable="false" width="100" align="center"/>
<EF:EFColumn cname="创建时间" ename="createdTime" 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-companyCode": {
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-companyName").val(textField);
} else {
$("#result-0-companyName").val("");
}
}
},
"result-0-repCustomId": {
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-repCustomName").val(textField);
} else {
$("#result-0-repCustomName").val("");
}
}
},
"result-0-repUserId": {
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-repUserName").val(textField);
} else {
$("#result-0-repUserName").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 companyCode = $("#result-0-companyCode").val();
if (isBlank(companyCode)) {
message("企业名称不能为空");
return;
}
let repDate = $("#result-0-repDate").val();
if (isBlank(repDate)) {
message("维修日期不能为空");
return;
}
let repCustomId = $("#result-0-repCustomId").val();
if (isBlank(repCustomId)) {
message("客户人员不能为空");
return;
}
let repUserId = $("#result-0-repUserId").val();
if (isBlank(repUserId)) {
message("维修人员不能为空");
return;
}
JSUtils.confirm("确定对数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGridsData("", "HGXS0061", "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="repOrderNo" cname="维修单号" blockId="result" row="0" colWidth="6" ratio="2:10"
required="true" readonly="true"/>
</div>
<div class="row">
<EF:EFSelect ename="companyCode" cname="公司" blockId="result" row="0" colWidth="6" ratio="2:10"
filter="contains">
<EF:EFOption label="请选择" value=""/>
<EF:EFOptions blockId="company_code_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFInput ename="companyName" cname="公司名称" blockId="result" row="0" colWidth="6" ratio="2:10"
type="hidden"/>
</div>
<div class="row">
<EF:EFDatePicker ename="repDate" cname="维修日期" blockId="result" row="0" colWidth="3" ratio="2:10"
format="yyyy-MM-dd" readonly="true"/>
</div>
<div class="row">
<EF:EFSelect ename="repCustomId" cname="客户人员" blockId="result" row="0" colWidth="3" 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="repCustomName" cname="客户人员姓名" blockId="result" row="0" colWidth="6" ratio="2:10"
type="hidden"/>
</div>
<div class="row">
<EF:EFSelect ename="repUserId" cname="维修人员" blockId="result" row="0" colWidth="3" ratio="2:10"
filter="contains">
<EF:EFOption label="请选择" value=""/>
<EF:EFOptions blockId="user_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFInput ename="repUserName" 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