Commit f4dfdb66 by 宋祥

1.客户投诉、客户建议、客户回访、客户关怀、公告管理

parent ea751d9a
......@@ -357,6 +357,13 @@ public enum DdynamicEnum {
*/
PROJ_RECORD_BY_ROLE_BLOCK_ID("projRecordByRole_block_id","projCode", "projName","companyCode","companyName", "HGSC001.queryProjectByRoleBox"),
/**
* 模块:组管理
* 用途:组管理下拉框
* 编写:w
*/
SALE_NO_BLOCK_ID("sale_no_block_id","saleOutCode","saleOutCode","HGXS007.getSaleCode"),
;
......
......@@ -143,15 +143,24 @@ public class HGConstant {
public static final String RETURN_CODE = "RETURN_CODE";
public static final String WD_FILE_ID = "WD_FILE_ID";
// 回访单号
public static final String FOL_NO = "FOL_NO";
// 维修单号
public static final String REP_ORDER_NO = "REP_ORDER_NO";
// 生产领料单号
public static final String SC_APPLY_CODE = "SC_APPLY_CODE";
// 生产领料单行号
public static final String SC_APPLY_LINE_CODE = "SC_APPLY_LINE_CODE";
// 售后单号
public static final String AFTER_SALE_NO = "AFTER_SALE_NO";
// 客户关怀单号
public static final String CARE_NO = "CARE_NO";
// 回访单号
public static final String FOL_NO = "FOL_NO";
// 投诉单号
public static final String COMPLAINT_NO = "COMPLAINT_NO";
// 建议单号
public static final String SUGGEST_NO = "SUGGEST_NO";
// 公告号
public static final String NOTICE_NO = "NOTICE_NO";
}
/**
......@@ -425,4 +434,32 @@ public class HGConstant {
// 已审核
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;
}
/**
* 提交状态
*
* @author:songx
* @date:2024/2/22,13:57
*/
public static class SubmitStatus {
// 未提交
public static final Integer S0 = 0;
// 已提交
public static final Integer S1 = 1;
}
}
package com.baosight.hggp.hg.fw.constant;
/**
* @author:songx
* @date:2024/9/24,17:53
*/
public class HgFwConst {
/**
* HGFW001 定义
*
* @author:songx
* @date:2024/9/24,17:54
*/
public static class HpFw001 {
}
/**
* HGFW002 定义
*
* @author:songx
* @date:2024/9/24,17:54
*/
public static class HpFw002 {
}
}
package com.baosight.hggp.hg.fw.constant;
/**
* @author:songx
* @date:2024/9/24,18:09
*/
public class HgFwSqlConst {
/**
* @author:songx
* @date:2024/8/29,15:54
*/
public static class HgFw001 {
// 锁
public static final String LOCK = "HGFW001.lock";
// 修改
public static final String UPDATE_DEAL = "HGFW001.updateDeal";
}
/**
* @author:songx
* @date:2024/8/29,15:54
*/
public static class HgFw002 {
// 锁
public static final String LOCK = "HGFW002.lock";
// 修改
public static final String UPDATE_DEAL = "HGFW002.updateDeal";
}
/**
* @author:songx
* @date:2024/8/29,15:54
*/
public static class HgFw003 {
// 锁
public static final String LOCK = "HGFW003.lock";
// 修改
public static final String UPDATE_DEAL = "HGFW003.updateDeal";
}
/**
* @author:songx
* @date:2024/8/29,15:54
*/
public static class HgFw004 {
// 锁
public static final String LOCK = "HGFW004.lock";
// 修改
public static final String UPDATE_DEAL = "HGFW004.updateDeal";
}
/**
* @author:songx
* @date:2024/8/29,15:54
*/
public static class HgFw007 {
// 锁
public static final String LOCK = "HGFW007.lock";
// 修改
public static final String UPDATE_DEAL = "HGFW007.updateDeal";
}
}
package com.baosight.hggp.hg.fw.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.fw.constant.HgFwSqlConst;
import com.baosight.hggp.hg.fw.domain.HGFW001;
import com.baosight.hggp.hg.fw.utils.HgFwUtils;
import com.baosight.hggp.util.AssertUtils;
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.List;
import java.util.Map;
/**
* 售后服务
*
* @author:songx
* @date:2024/9/24,17:47
*/
public class ServiceHGFW001 extends ServiceBase {
/**
* 画面初始化
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "售后维修", operType = "查询", operDesc = "初始化")
public EiInfo initLoad(EiInfo inInfo) {
try {
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGFW001().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(HGFW001.FIELD_AFTER_SALE_DATE,
DateUtils.formatShort(queryMap.get(HGFW001.FIELD_AFTER_SALE_DATE)));
inInfo = super.query(inInfo, HGFW001.QUERY, new HGFW001());
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 删除操作
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "客户回访", operType = "删除")
public EiInfo remove(EiInfo inInfo) {
try {
List<HGFW001> fFw001s = MapUtils.toDaoEPBases(inInfo, HGFW001.class);
// db数据
Map<String, HGFW001> dbFw001Map = HgFwUtils.HgFw001.lockAndGet(fFw001s);
// 数据校验
this.checkRemoveData(fFw001s, dbFw001Map);
// 保存数据
this.removeData(fFw001s);
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + fFw001s.size() + "]条数据删除成功!");
} catch (Exception e) {
LogUtils.setMsg(inInfo, e, "删除失败");
}
return inInfo;
}
/**
* 数据校验
*
* @param fFw001s
* @param dbFw001Map
*/
private void checkRemoveData(List<HGFW001> fFw001s, Map<String, HGFW001> dbFw001Map) {
for (HGFW001 fFw001 : fFw001s) {
String afterSaleNo = fFw001.getAfterSaleNo();
HGFW001 dbFw001 = dbFw001Map.get(afterSaleNo);
this.checkData(afterSaleNo, dbFw001);
}
}
/**
* 数据保存
*
* @param fFw001s
*/
private void removeData(List<HGFW001> fFw001s) {
for (HGFW001 fFw001 : fFw001s) {
fFw001.setDeleteFlag(CommonConstant.YesNo.YES_1);
DaoUtils.update(HGFW001.DELETE, fFw001.toMap());
}
}
/**
* 检查状态
*
* @param inInfo
* @return
*/
public EiInfo checkStatus(EiInfo inInfo) {
try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
String afterSaleNo = MapUtils.getString(queryMap, HGFW001.FIELD_AFTER_SALE_NO);
HGFW001 dbFw001 = HgFwUtils.HgFw001.lockAndGet(afterSaleNo);
this.checkData(afterSaleNo, dbFw001);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "操作失败");
}
return inInfo;
}
/**
* 处理
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "客户回访", operType = "审核")
public EiInfo deal(EiInfo inInfo) {
try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
String content = MapUtils.getString(queryMap, "content");
List<HGFW001> fFw001s = MapUtils.toDaoEPBases(inInfo, HGFW001.class);
// db数据
Map<String, HGFW001> dbFw001Map = HgFwUtils.HgFw001.lockAndGet(fFw001s);
// 数据校验
this.checkDealData(fFw001s, dbFw001Map);
// 保存数据
this.dealData(fFw001s, content);
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + fFw001s.size() + "]条数据处理成功!");
} catch (Exception e) {
LogUtils.setMsg(inInfo, e, "处理失败");
}
return inInfo;
}
/**
* 数据校验
*
* @param fFw001s
* @param dbFw001Map
*/
private void checkDealData(List<HGFW001> fFw001s, Map<String, HGFW001> dbFw001Map) {
for (HGFW001 fFw001 : fFw001s) {
String afterSaleNo = fFw001.getAfterSaleNo();
HGFW001 dbFw001 = dbFw001Map.get(afterSaleNo);
this.checkData(afterSaleNo, dbFw001);
}
}
/**
* 数据保存
*
* @param fFw001s
* @param content
*/
private void dealData(List<HGFW001> fFw001s, String content) {
for (HGFW001 fFw001 : fFw001s) {
fFw001.setDealContent(content);
fFw001.setStatus(HGConstant.DealStatus.S1);
fFw001.setDealUserId(UserSessionUtils.getLoginName());
fFw001.setDealUserName(UserSessionUtils.getLoginCName());
DaoUtils.update(HgFwSqlConst.HgFw001.UPDATE_DEAL, fFw001.toMap());
}
}
/**
* 数据校验
*
* @param afterSaleNo
* @param dbFw001
*/
private void checkData(String afterSaleNo, HGFW001 dbFw001) {
AssertUtils.isNull(dbFw001, String.format("售后服务单[%s]不存在", afterSaleNo));
AssertUtils.isNotEquals(dbFw001.getDeleteFlag(), CommonConstant.YesNo.NO_0,
String.format("售后服务单【%s】不是\"未删除\"状态,不允许操作", afterSaleNo));
AssertUtils.isNotEquals(dbFw001.getStatus(), HGConstant.DealStatus.S0,
String.format("售后服务单【%s】不是\"待处理\"状态,不允许操作", afterSaleNo));
}
}
package com.baosight.hggp.hg.fw.service;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.utils.Iplat4jUtils;
import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.dm.domain.HGDM099;
import com.baosight.hggp.hg.fw.domain.HGFW001;
import com.baosight.hggp.hg.fw.tools.HgFwTools;
import com.baosight.hggp.hg.fw.utils.HgFwUtils;
import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.EiInfoUtils;
import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.MapUtils;
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 java.util.List;
import java.util.Map;
/**
* 附件清单
*
* @author:songx
* @date:2022/7/11,11:08
*/
public class ServiceHGFW001A extends ServiceEPBase {
/**
* 初始化
*
* @param inInfo
* @return
*/
@Override
public EiInfo initLoad(EiInfo inInfo) {
try {
this.setDetailInfo(inInfo);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGDM099().eiMetadata);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询操作
*
* @param inInfo
* @return
*/
@Override
public EiInfo query(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HGDM099.QUERY, new HGDM099());
} catch (Throwable e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
/**
* 删除
*
* @param inInfo
* @return
*/
public EiInfo remove(EiInfo inInfo) {
try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
String bizId = MapUtils.getString(queryMap, HGDM099.FIELD_BIZ_ID);
HGFW001 dbFw001 = HgFwUtils.HgFw001.lockAndGet(bizId);
this.checkData(dbFw001);
List<HGDM099> fDm099s = MapUtils.toDaoEPBases(inInfo, HGDM099.class);
for (HGDM099 fDm099 : fDm099s) {
DaoUtils.update(HGDM099.DELETE, fDm099);
if (!fDm099.getDocId().isEmpty()) {
Iplat4jUtils.deleteFileByDocId(fDm099.getDocId());
}
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + fDm099s.size() + "]条数据删除成功!");
} catch (Throwable e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
/**
* 数据校验
*
* @param dbFw001
*/
private void checkData(HGFW001 dbFw001) {
AssertUtils.isNotEquals(dbFw001.getDeleteFlag(), CommonConstant.YesNo.NO_0,
String.format("售后服务单【%s】不是\"未删除\"状态,不允许操作", dbFw001.getAfterSaleNo()));
AssertUtils.isNotEquals(dbFw001.getStatus(), HGConstant.DealStatus.S0,
String.format("售后服务单【%s】不是\"待处理\"状态,不允许操作", dbFw001.getAfterSaleNo()));
}
/**
* 设置信息
*
* @param inInfo
*/
public void setDetailInfo(EiInfo inInfo) {
Map queryRow = EiInfoUtils.getFirstRow(inInfo);
String bizId = MapUtils.getString(queryRow, HGDM099.FIELD_BIZ_ID);
if (bizId == null) {
return;
}
EiBlock block = new EiBlock(CommonConstant.Field.DETAIL);
block.addRow(HgFwTools.HgFw001.get(bizId));
block.addBlockMeta(new HGFW001().eiMetadata);
inInfo.setBlock(block);
}
}
package com.baosight.hggp.hg.fw.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.constant.HGConstant;
import com.baosight.hggp.hg.fw.domain.HGFW001;
import com.baosight.hggp.hg.fw.tools.HgFwTools;
import com.baosight.hggp.hg.fw.utils.HgFwUtils;
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 ServiceHGFW001B 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 {
HGFW001 fFw001 = MapUtils.toDaoEPBase(inInfo, HGFW001.class);
fFw001.setAfterSaleDate(DateUtils.formatShort(fFw001.getAfterSaleDate()));
if (StringUtils.isBlank(fFw001.getAfterSaleNo())) {
this.add(fFw001);
} else {
this.modify(fFw001);
}
// 回填实体信息,移动端更新数据使用
inInfo.set("detail", fFw001);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 新增
*
* @param fFw001
*/
private void add(HGFW001 fFw001) {
fFw001.setAfterSaleNo(SequenceGenerator.getNextSequence(HGConstant.SequenceId.AFTER_SALE_NO));
fFw001.setStatus(HGConstant.DealStatus.S0);
fFw001.setDeleteFlag(CommonConstant.YesNo.NO_0);
DaoUtils.insert(HGFW001.INSERT, fFw001);
}
/**
* 修改数据
*
* @param fFw001
*/
private void modify(HGFW001 fFw001) {
HGFW001 dbFw001 = HgFwUtils.HgFw001.lockAndGet(fFw001);
this.checkData(fFw001, dbFw001);
DaoUtils.update(HGFW001.UPDATE, fFw001);
}
/**
* 设置信息
*
* @param inInfo
*/
public void setBaseInfo(EiInfo inInfo) {
Map queryRow = EiInfoUtils.getFirstRow(inInfo);
String afterSaleNo = MapUtils.getString(queryRow, HGFW001.FIELD_AFTER_SALE_NO);
if (StringUtils.isBlank(afterSaleNo)) {
return;
}
EiBlock resultBlock = new EiBlock(EiConstant.resultBlock);
resultBlock.addRow(HgFwTools.HgFw001.get(afterSaleNo));
resultBlock.addBlockMeta(new HGFW001().eiMetadata);
inInfo.setBlock(resultBlock);
}
/**
* 数据校验
*
* @param fFw001
* @param dbFw001
*/
private void checkData(HGFW001 fFw001, HGFW001 dbFw001) {
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(), HGConstant.DealStatus.S0,
String.format("售后服务单【%s】不是\"待处理\"状态,不允许操作", dbFw001.getAfterSaleNo()));
}
}
package com.baosight.hggp.hg.fw.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.fw.constant.HgFwSqlConst;
import com.baosight.hggp.hg.fw.domain.HGFW002;
import com.baosight.hggp.hg.fw.utils.HgFwUtils;
import com.baosight.hggp.util.AssertUtils;
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.List;
import java.util.Map;
/**
* 客户关怀
*
* @author:songx
* @date:2024/9/24,17:47
*/
public class ServiceHGFW002 extends ServiceBase {
/**
* 画面初始化
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "售后维修", operType = "查询", operDesc = "初始化")
public EiInfo initLoad(EiInfo inInfo) {
try {
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGFW002().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(HGFW002.FIELD_CARE_DATE,
DateUtils.formatShort(queryMap.get(HGFW002.FIELD_CARE_DATE)));
inInfo = super.query(inInfo, HGFW002.QUERY, new HGFW002());
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
/**
* 删除操作
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "客户回访", operType = "删除")
public EiInfo remove(EiInfo inInfo) {
try {
List<HGFW002> fFw002s = MapUtils.toDaoEPBases(inInfo, HGFW002.class);
// db数据
Map<String, HGFW002> dbFw002Map = HgFwUtils.HgFw002.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<HGFW002> fFw002s, Map<String, HGFW002> dbFw002Map) {
for (HGFW002 fFw002 : fFw002s) {
String careNo = fFw002.getCareNo();
HGFW002 dbFw002 = dbFw002Map.get(careNo);
this.checkData(careNo, dbFw002);
}
}
/**
* 数据保存
*
* @param fFw002s
*/
private void removeData(List<HGFW002> fFw002s) {
for (HGFW002 fFw002 : fFw002s) {
fFw002.setDeleteFlag(CommonConstant.YesNo.YES_1);
DaoUtils.update(HGFW002.DELETE, fFw002.toMap());
}
}
/**
* 检查状态
*
* @param inInfo
* @return
*/
public EiInfo checkStatus(EiInfo inInfo) {
try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
String careNo = MapUtils.getString(queryMap, HGFW002.FIELD_CARE_NO);
HGFW002 dbFw002 = HgFwUtils.HgFw002.lockAndGet(careNo);
this.checkData(careNo, dbFw002);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "操作失败");
}
return inInfo;
}
/**
* 处理
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "客户回访", operType = "审核")
public EiInfo deal(EiInfo inInfo) {
try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
String content = MapUtils.getString(queryMap, "content");
List<HGFW002> fFw002s = MapUtils.toDaoEPBases(inInfo, HGFW002.class);
// db数据
Map<String, HGFW002> dbFw002Map = HgFwUtils.HgFw002.lockAndGet(fFw002s);
// 数据校验
this.checkDealData(fFw002s, dbFw002Map);
// 保存数据
this.dealData(fFw002s, content);
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 checkDealData(List<HGFW002> fFw002s, Map<String, HGFW002> dbFw002Map) {
for (HGFW002 fFw002 : fFw002s) {
String careNo = fFw002.getCareNo();
HGFW002 dbFw002 = dbFw002Map.get(careNo);
this.checkData(careNo, dbFw002);
}
}
/**
* 数据保存
*
* @param fFw002s
* @param content
*/
private void dealData(List<HGFW002> fFw002s, String content) {
for (HGFW002 fFw002 : fFw002s) {
fFw002.setStatus(HGConstant.DealStatus.S1);
fFw002.setDealUserId(UserSessionUtils.getLoginName());
fFw002.setDealUserName(UserSessionUtils.getLoginCName());
fFw002.setDealContent(content);
DaoUtils.update(HgFwSqlConst.HgFw002.UPDATE_DEAL, fFw002.toMap());
}
}
/**
* 数据校验
*
* @param careNo
* @param dbFw002
*/
private void checkData(String careNo, HGFW002 dbFw002) {
AssertUtils.isNull(dbFw002, String.format("客户关怀单[%s]不存在", careNo));
AssertUtils.isNotEquals(dbFw002.getDeleteFlag(), CommonConstant.YesNo.NO_0,
String.format("客户关怀单【%s】不是\"未删除\"状态,不允许操作", careNo));
AssertUtils.isNotEquals(dbFw002.getStatus(), HGConstant.DealStatus.S0,
String.format("客户关怀单【%s】不是\"待处理\"状态,不允许操作", careNo));
}
}
package com.baosight.hggp.hg.fw.service;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.utils.Iplat4jUtils;
import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.dm.domain.HGDM099;
import com.baosight.hggp.hg.fw.domain.HGFW002;
import com.baosight.hggp.hg.fw.tools.HgFwTools;
import com.baosight.hggp.hg.fw.utils.HgFwUtils;
import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.EiInfoUtils;
import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.MapUtils;
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 java.util.List;
import java.util.Map;
/**
* 附件清单
*
* @author:songx
* @date:2022/7/11,11:08
*/
public class ServiceHGFW002A extends ServiceEPBase {
/**
* 初始化
*
* @param inInfo
* @return
*/
@Override
public EiInfo initLoad(EiInfo inInfo) {
try {
this.setDetailInfo(inInfo);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGDM099().eiMetadata);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询操作
*
* @param inInfo
* @return
*/
@Override
public EiInfo query(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HGDM099.QUERY, new HGDM099());
} catch (Throwable e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
/**
* 删除
*
* @param inInfo
* @return
*/
public EiInfo remove(EiInfo inInfo) {
try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
String bizId = MapUtils.getString(queryMap, HGDM099.FIELD_BIZ_ID);
HGFW002 dbFw002 = HgFwUtils.HgFw002.lockAndGet(bizId);
this.checkData(bizId, dbFw002);
List<HGDM099> fDm099s = MapUtils.toDaoEPBases(inInfo, HGDM099.class);
for (HGDM099 fDm099 : fDm099s) {
DaoUtils.update(HGDM099.DELETE, fDm099);
if (!fDm099.getDocId().isEmpty()) {
Iplat4jUtils.deleteFileByDocId(fDm099.getDocId());
}
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + fDm099s.size() + "]条数据删除成功!");
} catch (Throwable e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
/**
* 数据校验
*
* @param careNo
* @param dbFw002
*/
private void checkData(String careNo, HGFW002 dbFw002) {
AssertUtils.isNull(dbFw002, String.format("客户关怀单[%s]不存在", careNo));
AssertUtils.isNotEquals(dbFw002.getDeleteFlag(), CommonConstant.YesNo.NO_0,
String.format("客户关怀单【%s】不是\"未删除\"状态,不允许操作", careNo));
AssertUtils.isNotEquals(dbFw002.getStatus(), HGConstant.DealStatus.S0,
String.format("客户关怀单【%s】不是\"待回访\"状态,不允许操作", careNo));
}
/**
* 设置信息
*
* @param inInfo
*/
public void setDetailInfo(EiInfo inInfo) {
Map queryRow = EiInfoUtils.getFirstRow(inInfo);
String bizId = MapUtils.getString(queryRow, HGDM099.FIELD_BIZ_ID);
if (bizId == null) {
return;
}
EiBlock block = new EiBlock(CommonConstant.Field.DETAIL);
block.addRow(HgFwTools.HgFw002.get(bizId));
block.addBlockMeta(new HGFW002().eiMetadata);
inInfo.setBlock(block);
}
}
package com.baosight.hggp.hg.fw.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.constant.HGConstant;
import com.baosight.hggp.hg.fw.domain.HGFW002;
import com.baosight.hggp.hg.fw.tools.HgFwTools;
import com.baosight.hggp.hg.fw.utils.HgFwUtils;
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 ServiceHGFW002B 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 {
HGFW002 fFw002 = MapUtils.toDaoEPBase(inInfo, HGFW002.class);
fFw002.setCareDate(DateUtils.formatShort(fFw002.getCareDate()));
if (StringUtils.isBlank(fFw002.getCareNo())) {
this.add(fFw002);
} else {
this.modify(fFw002);
}
// 回填实体信息,移动端更新数据使用
inInfo.set("detail", fFw002);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 新增
*
* @param fFw002
*/
private void add(HGFW002 fFw002) {
fFw002.setCareNo(SequenceGenerator.getNextSequence(HGConstant.SequenceId.CARE_NO));
fFw002.setStatus(HGConstant.DealStatus.S0);
fFw002.setDeleteFlag(CommonConstant.YesNo.NO_0);
DaoUtils.insert(HGFW002.INSERT, fFw002);
}
/**
* 修改数据
*
* @param fFw002
*/
private void modify(HGFW002 fFw002) {
HGFW002 dbFw002 = HgFwUtils.HgFw002.lockAndGet(fFw002);
this.checkData(fFw002, dbFw002);
DaoUtils.update(HGFW002.UPDATE, fFw002);
}
/**
* 设置信息
*
* @param inInfo
*/
public void setBaseInfo(EiInfo inInfo) {
Map queryRow = EiInfoUtils.getFirstRow(inInfo);
String careNo = MapUtils.getString(queryRow, HGFW002.FIELD_CARE_NO);
if (StringUtils.isBlank(careNo)) {
return;
}
EiBlock resultBlock = new EiBlock(EiConstant.resultBlock);
resultBlock.addRow(HgFwTools.HgFw002.get(careNo));
resultBlock.addBlockMeta(new HGFW002().eiMetadata);
inInfo.setBlock(resultBlock);
}
/**
* 数据校验
*
* @param fFw002
* @param dbFw002
*/
private void checkData(HGFW002 fFw002, HGFW002 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(), HGConstant.DealStatus.S0,
String.format("客户关怀单【%s】不是\"待处理\"状态,不允许操作", careNo));
}
}
package com.baosight.hggp.hg.fw.service;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.fw.constant.HgFwSqlConst;
import com.baosight.hggp.hg.fw.domain.HGFW003;
import com.baosight.hggp.hg.fw.utils.HgFwUtils;
import com.baosight.hggp.util.AssertUtils;
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.List;
import java.util.Map;
/**
* 客户投诉
*
* @author:songx
* @date:2024/9/24,17:47
*/
public class ServiceHGFW003 extends ServiceBase {
/**
* 画面初始化
*
* @param inInfo
* @return
*/
@Override
public EiInfo initLoad(EiInfo inInfo) {
try {
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGFW003().eiMetadata);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询操作.
*/
@Override
public EiInfo query(EiInfo inInfo) {
try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
queryMap.put(HGFW003.FIELD_COMPLAINT_DATE,
DateUtils.formatShort(queryMap.get(HGFW003.FIELD_COMPLAINT_DATE)));
inInfo = super.query(inInfo, HGFW003.QUERY, new HGFW003());
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
/**
* 删除操作
*
* @param inInfo
* @return
*/
public EiInfo remove(EiInfo inInfo) {
try {
List<HGFW003> fFw003s = MapUtils.toDaoEPBases(inInfo, HGFW003.class);
// db数据
Map<String, HGFW003> dbFw003Map = HgFwUtils.HgFw003.lockAndGet(fFw003s);
// 数据校验
this.checkRemoveData(fFw003s, dbFw003Map);
// 保存数据
this.removeData(fFw003s);
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + fFw003s.size() + "]条数据删除成功!");
} catch (Exception e) {
LogUtils.setMsg(inInfo, e, "删除失败");
}
return inInfo;
}
/**
* 数据校验
*
* @param fFw003s
* @param dbFw003Map
*/
private void checkRemoveData(List<HGFW003> fFw003s, Map<String, HGFW003> dbFw003Map) {
for (HGFW003 fFw003 : fFw003s) {
String complaintNo = fFw003.getComplaintNo();
HGFW003 dbFw003 = dbFw003Map.get(complaintNo);
this.checkData(complaintNo, dbFw003);
}
}
/**
* 数据保存
*
* @param fFw003s
*/
private void removeData(List<HGFW003> fFw003s) {
for (HGFW003 fFw003 : fFw003s) {
fFw003.setDeleteFlag(CommonConstant.YesNo.YES_1);
DaoUtils.update(HGFW003.DELETE, fFw003.toMap());
}
}
/**
* 检查状态
*
* @param inInfo
* @return
*/
public EiInfo checkStatus(EiInfo inInfo) {
try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
String complaintNo = MapUtils.getString(queryMap, HGFW003.FIELD_COMPLAINT_NO);
HGFW003 dbFw003 = HgFwUtils.HgFw003.lockAndGet(complaintNo);
this.checkData(complaintNo, dbFw003);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "操作失败");
}
return inInfo;
}
/**
* 处理
*
* @param inInfo
* @return
*/
public EiInfo deal(EiInfo inInfo) {
try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
String content = MapUtils.getString(queryMap, "content");
List<HGFW003> fFw003s = MapUtils.toDaoEPBases(inInfo, HGFW003.class);
// db数据
Map<String, HGFW003> dbFw003Map = HgFwUtils.HgFw003.lockAndGet(fFw003s);
// 数据校验
this.checkDealData(fFw003s, dbFw003Map);
// 保存数据
this.dealData(fFw003s, content);
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + fFw003s.size() + "]条数据处理成功!");
} catch (Exception e) {
LogUtils.setMsg(inInfo, e, "处理失败");
}
return inInfo;
}
/**
* 数据校验
*
* @param fFw003s
* @param dbFw003Map
*/
private void checkDealData(List<HGFW003> fFw003s, Map<String, HGFW003> dbFw003Map) {
for (HGFW003 fFw003 : fFw003s) {
String complaintNo = fFw003.getComplaintNo();
HGFW003 dbFw003 = dbFw003Map.get(complaintNo);
this.checkData(complaintNo, dbFw003);
}
}
/**
* 数据保存
*
* @param fFw003s
* @param content
*/
private void dealData(List<HGFW003> fFw003s, String content) {
for (HGFW003 fFw003 : fFw003s) {
fFw003.setStatus(HGConstant.DealStatus.S1);
fFw003.setDealUserId(UserSessionUtils.getLoginName());
fFw003.setDealUserName(UserSessionUtils.getLoginCName());
fFw003.setDealContent(content);
DaoUtils.update(HgFwSqlConst.HgFw003.UPDATE_DEAL, fFw003.toMap());
}
}
/**
* 数据校验
*
* @param careNo
* @param dbFw003
*/
private void checkData(String careNo, HGFW003 dbFw003) {
AssertUtils.isNull(dbFw003, String.format("投诉单[%s]不存在", careNo));
AssertUtils.isNotEquals(dbFw003.getDeleteFlag(), CommonConstant.YesNo.NO_0,
String.format("投诉单【%s】不是\"未删除\"状态,不允许操作", careNo));
AssertUtils.isNotEquals(dbFw003.getStatus(), HGConstant.DealStatus.S0,
String.format("投诉单【%s】不是\"待处理\"状态,不允许操作", careNo));
}
}
package com.baosight.hggp.hg.fw.service;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.utils.Iplat4jUtils;
import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.dm.domain.HGDM099;
import com.baosight.hggp.hg.fw.domain.HGFW003;
import com.baosight.hggp.hg.fw.tools.HgFwTools;
import com.baosight.hggp.hg.fw.utils.HgFwUtils;
import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.EiInfoUtils;
import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.MapUtils;
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 java.util.List;
import java.util.Map;
/**
* 附件清单
*
* @author:songx
* @date:2022/7/11,11:08
*/
public class ServiceHGFW003A extends ServiceEPBase {
/**
* 初始化
*
* @param inInfo
* @return
*/
@Override
public EiInfo initLoad(EiInfo inInfo) {
try {
this.setDetailInfo(inInfo);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGDM099().eiMetadata);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询操作
*
* @param inInfo
* @return
*/
@Override
public EiInfo query(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HGDM099.QUERY, new HGDM099());
} catch (Throwable e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
/**
* 删除
*
* @param inInfo
* @return
*/
public EiInfo remove(EiInfo inInfo) {
try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
String bizId = MapUtils.getString(queryMap, HGDM099.FIELD_BIZ_ID);
HGFW003 dbFw003 = HgFwUtils.HgFw003.lockAndGet(bizId);
this.checkData(bizId, dbFw003);
List<HGDM099> fDm099s = MapUtils.toDaoEPBases(inInfo, HGDM099.class);
for (HGDM099 fDm099 : fDm099s) {
DaoUtils.update(HGDM099.DELETE, fDm099);
if (!fDm099.getDocId().isEmpty()) {
Iplat4jUtils.deleteFileByDocId(fDm099.getDocId());
}
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + fDm099s.size() + "]条数据删除成功!");
} catch (Throwable e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
/**
* 数据校验
*
* @param complaintNo
* @param dbFw003
*/
private void checkData(String complaintNo, HGFW003 dbFw003) {
AssertUtils.isNull(dbFw003, String.format("投诉单[%s]不存在", complaintNo));
AssertUtils.isNotEquals(dbFw003.getDeleteFlag(), CommonConstant.YesNo.NO_0,
String.format("投诉单【%s】不是\"未删除\"状态,不允许操作", complaintNo));
AssertUtils.isNotEquals(dbFw003.getStatus(), HGConstant.DealStatus.S0,
String.format("投诉单【%s】不是\"未处理\"状态,不允许操作", complaintNo));
}
/**
* 设置信息
*
* @param inInfo
*/
public void setDetailInfo(EiInfo inInfo) {
Map queryRow = EiInfoUtils.getFirstRow(inInfo);
String bizId = MapUtils.getString(queryRow, HGDM099.FIELD_BIZ_ID);
if (bizId == null) {
return;
}
EiBlock block = new EiBlock(CommonConstant.Field.DETAIL);
block.addRow(HgFwTools.HgFw003.get(bizId));
block.addBlockMeta(new HGFW003().eiMetadata);
inInfo.setBlock(block);
}
}
package com.baosight.hggp.hg.fw.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.constant.HGConstant;
import com.baosight.hggp.hg.fw.domain.HGFW003;
import com.baosight.hggp.hg.fw.tools.HgFwTools;
import com.baosight.hggp.hg.fw.utils.HgFwUtils;
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 ServiceHGFW003B 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 {
HGFW003 fFw003 = MapUtils.toDaoEPBase(inInfo, HGFW003.class);
fFw003.setComplaintDate(DateUtils.formatShort(fFw003.getComplaintDate()));
fFw003.setLastDate(DateUtils.formatShort(fFw003.getLastDate()));
if (StringUtils.isBlank(fFw003.getComplaintNo())) {
this.add(fFw003);
} else {
this.modify(fFw003);
}
// 回填实体信息,移动端更新数据使用
inInfo.set("detail", fFw003);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 新增
*
* @param fFw003
*/
private void add(HGFW003 fFw003) {
fFw003.setComplaintNo(SequenceGenerator.getNextSequence(HGConstant.SequenceId.COMPLAINT_NO));
fFw003.setStatus(HGConstant.DealStatus.S0);
fFw003.setDeleteFlag(CommonConstant.YesNo.NO_0);
DaoUtils.insert(HGFW003.INSERT, fFw003);
}
/**
* 修改数据
*
* @param fFw003
*/
private void modify(HGFW003 fFw003) {
HGFW003 dbFw003 = HgFwUtils.HgFw003.lockAndGet(fFw003);
this.checkData(fFw003, dbFw003);
DaoUtils.update(HGFW003.UPDATE, fFw003);
}
/**
* 设置信息
*
* @param inInfo
*/
public void setBaseInfo(EiInfo inInfo) {
Map queryRow = EiInfoUtils.getFirstRow(inInfo);
String complaintNo = MapUtils.getString(queryRow, HGFW003.FIELD_COMPLAINT_NO);
if (StringUtils.isBlank(complaintNo)) {
return;
}
EiBlock resultBlock = new EiBlock(EiConstant.resultBlock);
resultBlock.addRow(HgFwTools.HgFw003.get(complaintNo));
resultBlock.addBlockMeta(new HGFW003().eiMetadata);
inInfo.setBlock(resultBlock);
}
/**
* 数据校验
*
* @param fFw003
* @param dbFw003
*/
private void checkData(HGFW003 fFw003, HGFW003 dbFw003) {
String complaintNo = fFw003.getComplaintNo();
AssertUtils.isNull(dbFw003, String.format("投诉单【%s】不存在", complaintNo));
AssertUtils.isNotEquals(dbFw003.getDeleteFlag(), CommonConstant.YesNo.NO_0,
String.format("投诉单【%s】不是\"未删除\"状态,不允许操作", complaintNo));
AssertUtils.isNotEquals(dbFw003.getStatus(), HGConstant.DealStatus.S0,
String.format("投诉单【%s】不是\"未处理\"状态,不允许操作", complaintNo));
}
}
package com.baosight.hggp.hg.fw.service;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.fw.constant.HgFwSqlConst;
import com.baosight.hggp.hg.fw.domain.HGFW004;
import com.baosight.hggp.hg.fw.utils.HgFwUtils;
import com.baosight.hggp.util.AssertUtils;
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.List;
import java.util.Map;
/**
* 客户建议
*
* @author:songx
* @date:2024/9/24,17:47
*/
public class ServiceHGFW004 extends ServiceBase {
/**
* 画面初始化
*
* @param inInfo
* @return
*/
@Override
public EiInfo initLoad(EiInfo inInfo) {
try {
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGFW004().eiMetadata);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询操作.
*/
@Override
public EiInfo query(EiInfo inInfo) {
try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
queryMap.put(HGFW004.FIELD_SUGGEST_DATE,
DateUtils.formatShort(queryMap.get(HGFW004.FIELD_SUGGEST_DATE)));
inInfo = super.query(inInfo, HGFW004.QUERY, new HGFW004());
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
/**
* 删除操作
*
* @param inInfo
* @return
*/
public EiInfo remove(EiInfo inInfo) {
try {
List<HGFW004> fFw004s = MapUtils.toDaoEPBases(inInfo, HGFW004.class);
// db数据
Map<String, HGFW004> dbFw004Map = HgFwUtils.HgFw004.lockAndGet(fFw004s);
// 数据校验
this.checkRemoveData(fFw004s, dbFw004Map);
// 保存数据
this.removeData(fFw004s);
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + fFw004s.size() + "]条数据删除成功!");
} catch (Exception e) {
LogUtils.setMsg(inInfo, e, "删除失败");
}
return inInfo;
}
/**
* 数据校验
*
* @param fFw004s
* @param dbFw004Map
*/
private void checkRemoveData(List<HGFW004> fFw004s, Map<String, HGFW004> dbFw004Map) {
for (HGFW004 fFw004 : fFw004s) {
String suggestNo = fFw004.getSuggestNo();
HGFW004 dbFw004 = dbFw004Map.get(suggestNo);
this.checkData(suggestNo, dbFw004);
}
}
/**
* 数据保存
*
* @param fFw004s
*/
private void removeData(List<HGFW004> fFw004s) {
for (HGFW004 fFw004 : fFw004s) {
fFw004.setDeleteFlag(CommonConstant.YesNo.YES_1);
DaoUtils.update(HGFW004.DELETE, fFw004.toMap());
}
}
/**
* 检查状态
*
* @param inInfo
* @return
*/
public EiInfo checkStatus(EiInfo inInfo) {
try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
String suggestNo = MapUtils.getString(queryMap, HGFW004.FIELD_SUGGEST_NO);
HGFW004 dbFw004 = HgFwUtils.HgFw004.lockAndGet(suggestNo);
this.checkData(suggestNo, dbFw004);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "操作失败");
}
return inInfo;
}
/**
* 处理
*
* @param inInfo
* @return
*/
public EiInfo deal(EiInfo inInfo) {
try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
String content = MapUtils.getString(queryMap, "content");
List<HGFW004> fFw004s = MapUtils.toDaoEPBases(inInfo, HGFW004.class);
// db数据
Map<String, HGFW004> dbFw004Map = HgFwUtils.HgFw004.lockAndGet(fFw004s);
// 数据校验
this.checkDealData(fFw004s, dbFw004Map);
// 保存数据
this.dealData(fFw004s, content);
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + fFw004s.size() + "]条数据处理成功!");
} catch (Exception e) {
LogUtils.setMsg(inInfo, e, "处理失败");
}
return inInfo;
}
/**
* 数据校验
*
* @param fFw004s
* @param dbFw004Map
*/
private void checkDealData(List<HGFW004> fFw004s, Map<String, HGFW004> dbFw004Map) {
for (HGFW004 fFw004 : fFw004s) {
String suggestNo = fFw004.getSuggestNo();
HGFW004 dbFw004 = dbFw004Map.get(suggestNo);
this.checkData(suggestNo, dbFw004);
}
}
/**
* 数据保存
*
* @param fFw004s
* @param content
*/
private void dealData(List<HGFW004> fFw004s, String content) {
for (HGFW004 fFw004 : fFw004s) {
fFw004.setStatus(HGConstant.DealStatus.S1);
fFw004.setDealUserId(UserSessionUtils.getLoginName());
fFw004.setDealUserName(UserSessionUtils.getLoginCName());
fFw004.setDealContent(content);
DaoUtils.update(HgFwSqlConst.HgFw004.UPDATE_DEAL, fFw004.toMap());
}
}
/**
* 数据校验
*
* @param suggestNo
* @param dbFw004
*/
private void checkData(String suggestNo, HGFW004 dbFw004) {
AssertUtils.isNull(dbFw004, String.format("建议单[%s]不存在", suggestNo));
AssertUtils.isNotEquals(dbFw004.getDeleteFlag(), CommonConstant.YesNo.NO_0,
String.format("建议单【%s】不是\"未删除\"状态,不允许操作", suggestNo));
AssertUtils.isNotEquals(dbFw004.getStatus(), HGConstant.DealStatus.S0,
String.format("建议单【%s】不是\"待处理\"状态,不允许操作", suggestNo));
}
}
package com.baosight.hggp.hg.fw.service;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.utils.Iplat4jUtils;
import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.dm.domain.HGDM099;
import com.baosight.hggp.hg.fw.domain.HGFW004;
import com.baosight.hggp.hg.fw.tools.HgFwTools;
import com.baosight.hggp.hg.fw.utils.HgFwUtils;
import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.EiInfoUtils;
import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.MapUtils;
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 java.util.List;
import java.util.Map;
/**
* 附件清单
*
* @author:songx
* @date:2022/7/11,11:08
*/
public class ServiceHGFW004A extends ServiceEPBase {
/**
* 初始化
*
* @param inInfo
* @return
*/
@Override
public EiInfo initLoad(EiInfo inInfo) {
try {
this.setDetailInfo(inInfo);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGDM099().eiMetadata);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询操作
*
* @param inInfo
* @return
*/
@Override
public EiInfo query(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HGDM099.QUERY, new HGDM099());
} catch (Throwable e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
/**
* 删除
*
* @param inInfo
* @return
*/
public EiInfo remove(EiInfo inInfo) {
try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
String bizId = MapUtils.getString(queryMap, HGDM099.FIELD_BIZ_ID);
HGFW004 dbFw004 = HgFwUtils.HgFw004.lockAndGet(bizId);
this.checkData(bizId, dbFw004);
List<HGDM099> fDm099s = MapUtils.toDaoEPBases(inInfo, HGDM099.class);
for (HGDM099 fDm099 : fDm099s) {
DaoUtils.update(HGDM099.DELETE, fDm099);
if (!fDm099.getDocId().isEmpty()) {
Iplat4jUtils.deleteFileByDocId(fDm099.getDocId());
}
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + fDm099s.size() + "]条数据删除成功!");
} catch (Throwable e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
/**
* 数据校验
*
* @param complaintNo
* @param dbFw004
*/
private void checkData(String complaintNo, HGFW004 dbFw004) {
AssertUtils.isNull(dbFw004, String.format("建议单[%s]不存在", complaintNo));
AssertUtils.isNotEquals(dbFw004.getDeleteFlag(), CommonConstant.YesNo.NO_0,
String.format("建议单【%s】不是\"未删除\"状态,不允许操作", complaintNo));
AssertUtils.isNotEquals(dbFw004.getStatus(), HGConstant.DealStatus.S0,
String.format("建议单【%s】不是\"未处理\"状态,不允许操作", complaintNo));
}
/**
* 设置信息
*
* @param inInfo
*/
public void setDetailInfo(EiInfo inInfo) {
Map queryRow = EiInfoUtils.getFirstRow(inInfo);
String bizId = MapUtils.getString(queryRow, HGDM099.FIELD_BIZ_ID);
if (bizId == null) {
return;
}
EiBlock block = new EiBlock(CommonConstant.Field.DETAIL);
block.addRow(HgFwTools.HgFw004.get(bizId));
block.addBlockMeta(new HGFW004().eiMetadata);
inInfo.setBlock(block);
}
}
package com.baosight.hggp.hg.fw.service;
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.constant.HGConstant;
import com.baosight.hggp.hg.fw.domain.HGFW004;
import com.baosight.hggp.hg.fw.tools.HgFwTools;
import com.baosight.hggp.hg.fw.utils.HgFwUtils;
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 ServiceHGFW004B 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
*/
public EiInfo save(EiInfo inInfo) {
try {
HGFW004 fFw004 = MapUtils.toDaoEPBase(inInfo, HGFW004.class);
fFw004.setSuggestDate(DateUtils.formatShort(fFw004.getSuggestDate()));
if (StringUtils.isBlank(fFw004.getSuggestNo())) {
this.add(fFw004);
} else {
this.modify(fFw004);
}
// 回填实体信息,移动端更新数据使用
inInfo.set("detail", fFw004);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 新增
*
* @param fFw004
*/
private void add(HGFW004 fFw004) {
fFw004.setSuggestNo(SequenceGenerator.getNextSequence(HGConstant.SequenceId.SUGGEST_NO));
fFw004.setStatus(HGConstant.DealStatus.S0);
fFw004.setDeleteFlag(CommonConstant.YesNo.NO_0);
DaoUtils.insert(HGFW004.INSERT, fFw004);
}
/**
* 修改数据
*
* @param fFw004
*/
private void modify(HGFW004 fFw004) {
HGFW004 dbFw004 = HgFwUtils.HgFw004.lockAndGet(fFw004);
this.checkData(fFw004, dbFw004);
DaoUtils.update(HGFW004.UPDATE, fFw004);
}
/**
* 设置信息
*
* @param inInfo
*/
public void setBaseInfo(EiInfo inInfo) {
Map queryRow = EiInfoUtils.getFirstRow(inInfo);
String suggestNo = MapUtils.getString(queryRow, HGFW004.FIELD_SUGGEST_NO);
if (StringUtils.isBlank(suggestNo)) {
return;
}
EiBlock resultBlock = new EiBlock(EiConstant.resultBlock);
resultBlock.addRow(HgFwTools.HgFw004.get(suggestNo));
resultBlock.addBlockMeta(new HGFW004().eiMetadata);
inInfo.setBlock(resultBlock);
}
/**
* 数据校验
*
* @param fFw004
* @param dbFw004
*/
private void checkData(HGFW004 fFw004, HGFW004 dbFw004) {
String suggestNo = fFw004.getSuggestNo();
AssertUtils.isNull(dbFw004, String.format("建议单【%s】不存在", suggestNo));
AssertUtils.isNotEquals(dbFw004.getDeleteFlag(), CommonConstant.YesNo.NO_0,
String.format("建议单【%s】不是\"未删除\"状态,不允许操作", suggestNo));
AssertUtils.isNotEquals(dbFw004.getStatus(), HGConstant.DealStatus.S0,
String.format("建议单【%s】不是\"未处理\"状态,不允许操作", suggestNo));
}
}
package com.baosight.hggp.hg.fw.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.security.UserSessionUtils;
import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.fw.constant.HgFwSqlConst;
import com.baosight.hggp.hg.fw.domain.HGFW007;
import com.baosight.hggp.hg.fw.utils.HgFwUtils;
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.ArrayList;
import java.util.List;
import java.util.Map;
/**
* 客户回访
*
* @author:songx
* @date:2024/9/24,17:47
*/
public class ServiceHGFW007 extends ServiceBase {
/**
* 画面初始化
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "售后维修", operType = "查询", operDesc = "初始化")
public EiInfo initLoad(EiInfo inInfo) {
try {
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGFW007().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(HGFW007.FIELD_FOL_DATE, DateUtils.formatShort(queryMap.get(HGFW007.FIELD_FOL_DATE)));
inInfo = super.query(inInfo, HGFW007.QUERY, new HGFW007());
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
/**
* 删除操作
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "客户回访", operType = "删除")
public EiInfo remove(EiInfo inInfo) {
try {
List<HGFW007> fFw007s = MapUtils.toDaoEPBases(inInfo, HGFW007.class);
// db数据
Map<String, HGFW007> dbFw007Map = HgFwUtils.HgFw007.lockAndGet(fFw007s);
// 数据校验
this.checkRemoveData(fFw007s, dbFw007Map);
// 保存数据
this.removeData(fFw007s);
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + fFw007s.size() + "]条数据删除成功!");
} catch (Exception e) {
LogUtils.setMsg(inInfo, e, "删除失败");
}
return inInfo;
}
/**
* 数据校验
*
* @param fFw007s
* @param dbFw007Map
*/
private void checkRemoveData(List<HGFW007> fFw007s, Map<String, HGFW007> dbFw007Map) {
for (HGFW007 fFw007 : fFw007s) {
String folNo = fFw007.getFolNo();
HGFW007 dbFw007 = dbFw007Map.get(folNo);
this.checkData(folNo, dbFw007);
}
}
/**
* 数据保存
*
* @param fFw007s
*/
private void removeData(List<HGFW007> fFw007s) {
for (HGFW007 fFw007 : fFw007s) {
fFw007.setDeleteFlag(CommonConstant.YesNo.YES_1);
DaoUtils.update(HGFW007.DELETE, fFw007.toMap());
}
}
/**
* 检查状态
*
* @param inInfo
* @return
*/
public EiInfo checkStatus(EiInfo inInfo) {
try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
String folNo = MapUtils.getString(queryMap, HGFW007.FIELD_FOL_NO);
HGFW007 dbFw007 = HgFwUtils.HgFw007.lockAndGet(folNo);
this.checkData(folNo, dbFw007);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "操作失败");
}
return inInfo;
}
/**
* 处理
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "客户回访", operType = "审核")
public EiInfo deal(EiInfo inInfo) {
try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
String content = MapUtils.getString(queryMap, "content");
List<HGFW007> fFw007s = MapUtils.toDaoEPBases(inInfo, HGFW007.class);
// db数据
Map<String, HGFW007> dbFw007Map = HgFwUtils.HgFw007.lockAndGet(fFw007s);
// 数据校验
this.checkDealData(fFw007s, dbFw007Map);
// 保存数据
this.dealData(fFw007s, content);
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + fFw007s.size() + "]条数据处理成功!");
} catch (Exception e) {
LogUtils.setMsg(inInfo, e, "处理失败");
}
return inInfo;
}
/**
* 数据校验
*
* @param fFw007s
* @param dbFw007Map
*/
private void checkDealData(List<HGFW007> fFw007s, Map<String, HGFW007> dbFw007Map) {
for (HGFW007 fFw007 : fFw007s) {
String folNo = fFw007.getFolNo();
HGFW007 dbFw007 = dbFw007Map.get(folNo);
this.checkData(folNo, dbFw007);
}
}
/**
* 数据保存
*
* @param fFw007s
* @param content
*/
private void dealData(List<HGFW007> fFw007s, String content) {
for (HGFW007 fFw007 : fFw007s) {
fFw007.setStatus(HGConstant.DealStatus.S1);
fFw007.setDealUserId(UserSessionUtils.getLoginName());
fFw007.setDealUserName(UserSessionUtils.getLoginCName());
fFw007.setDealContent(content);
DaoUtils.update(HgFwSqlConst.HgFw007.UPDATE_DEAL, fFw007.toMap());
}
}
/**
* 数据校验
*
* @param folNo
* @param dbFw007
*/
private void checkData(String folNo, HGFW007 dbFw007) {
AssertUtils.isNull(dbFw007, String.format("回访单[%s]不存在", folNo));
AssertUtils.isNotEquals(dbFw007.getDeleteFlag(), CommonConstant.YesNo.NO_0,
String.format("回访单【%s】不是\"未删除\"状态,不允许操作", folNo));
AssertUtils.isNotEquals(dbFw007.getStatus(), HGConstant.DealStatus.S0,
String.format("回访单【%s】不是\"待回访\"状态,不允许操作", folNo));
}
/**
* 销售单号
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "组织管理", operType = "查询", operDesc = "组下拉框")
public EiInfo querySaleNo(EiInfo inInfo) {
try {
Map queryRow = EiInfoUtils.getFirstRow(inInfo);
List<DdynamicEnum> list = new ArrayList<>();
list.add(DdynamicEnum.SALE_NO_BLOCK_ID);
CommonMethod.initBlock(inInfo, list, queryRow, false);
} catch (Exception e) {
LogUtils.setMsg(inInfo, e, "查询失败");
}
return inInfo;
}
}
package com.baosight.hggp.hg.fw.service;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.utils.Iplat4jUtils;
import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.dm.domain.HGDM099;
import com.baosight.hggp.hg.fw.domain.HGFW007;
import com.baosight.hggp.hg.fw.tools.HgFwTools;
import com.baosight.hggp.hg.fw.utils.HgFwUtils;
import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.EiInfoUtils;
import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.MapUtils;
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 java.util.List;
import java.util.Map;
/**
* 附件清单
*
* @author:songx
* @date:2022/7/11,11:08
*/
public class ServiceHGFW007A extends ServiceEPBase {
/**
* 初始化
*
* @param inInfo
* @return
*/
@Override
public EiInfo initLoad(EiInfo inInfo) {
try {
this.setDetailInfo(inInfo);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGDM099().eiMetadata);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询操作
*
* @param inInfo
* @return
*/
@Override
public EiInfo query(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HGDM099.QUERY, new HGDM099());
} catch (Throwable e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
/**
* 删除
*
* @param inInfo
* @return
*/
public EiInfo remove(EiInfo inInfo) {
try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
String bizId = MapUtils.getString(queryMap, HGDM099.FIELD_BIZ_ID);
HGFW007 dbFw007 = HgFwUtils.HgFw007.lockAndGet(bizId);
this.checkData(bizId, dbFw007);
List<HGDM099> fDm099s = MapUtils.toDaoEPBases(inInfo, HGDM099.class);
for (HGDM099 fDm099 : fDm099s) {
DaoUtils.update(HGDM099.DELETE, fDm099);
if (!fDm099.getDocId().isEmpty()) {
Iplat4jUtils.deleteFileByDocId(fDm099.getDocId());
}
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + fDm099s.size() + "]条数据删除成功!");
} catch (Throwable e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
/**
* 数据校验
*
* @param folNo
* @param dbFw007
*/
private void checkData(String folNo, HGFW007 dbFw007) {
AssertUtils.isNull(dbFw007, String.format("回访单[%s]不存在", folNo));
AssertUtils.isNotEquals(dbFw007.getDeleteFlag(), CommonConstant.YesNo.NO_0,
String.format("回访单【%s】不是\"未删除\"状态,不允许操作", folNo));
AssertUtils.isNotEquals(dbFw007.getStatus(), HGConstant.DealStatus.S0,
String.format("回访单【%s】不是\"待回访\"状态,不允许操作", folNo));
}
/**
* 设置信息
*
* @param inInfo
*/
public void setDetailInfo(EiInfo inInfo) {
Map queryRow = EiInfoUtils.getFirstRow(inInfo);
String bizId = MapUtils.getString(queryRow, HGDM099.FIELD_BIZ_ID);
if (bizId == null) {
return;
}
EiBlock block = new EiBlock(CommonConstant.Field.DETAIL);
block.addRow(HgFwTools.HgFw007.get(bizId));
block.addBlockMeta(new HGFW007().eiMetadata);
inInfo.setBlock(block);
}
}
package com.baosight.hggp.hg.fw.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.constant.HGConstant;
import com.baosight.hggp.hg.fw.domain.HGFW007;
import com.baosight.hggp.hg.fw.tools.HgFwTools;
import com.baosight.hggp.hg.fw.utils.HgFwUtils;
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 ServiceHGFW007B extends ServiceEPBase {
/**
* 初始化
*
* @param inInfo
* @return
*/
@Override
public EiInfo initLoad(EiInfo inInfo) {
try {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.CUSTOMER_RECORD_BLOCK_ID), null);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.SALE_NO_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 {
HGFW007 fFw007 = MapUtils.toDaoEPBase(inInfo, HGFW007.class);
fFw007.setFolDate(DateUtils.formatShort(fFw007.getFolDate()));
if (StringUtils.isBlank(fFw007.getFolNo())) {
this.add(fFw007);
} else {
this.modify(fFw007);
}
// 回填实体信息,移动端更新数据使用
inInfo.set("detail", fFw007);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 新增
*
* @param fFw007
*/
private void add(HGFW007 fFw007) {
fFw007.setFolNo(SequenceGenerator.getNextSequence(HGConstant.SequenceId.FOL_NO));
fFw007.setStatus(HGConstant.DealStatus.S0);
fFw007.setDeleteFlag(CommonConstant.YesNo.NO_0);
DaoUtils.insert(HGFW007.INSERT, fFw007);
}
/**
* 修改数据
*
* @param fFw007
*/
private void modify(HGFW007 fFw007) {
HGFW007 dbFw007 = HgFwUtils.HgFw007.lockAndGet(fFw007);
this.checkData(fFw007, dbFw007);
DaoUtils.update(HGFW007.UPDATE, fFw007);
}
/**
* 设置信息
*
* @param inInfo
*/
public void setBaseInfo(EiInfo inInfo) {
Map queryRow = EiInfoUtils.getFirstRow(inInfo);
String folNo = MapUtils.getString(queryRow, HGFW007.FIELD_FOL_NO);
if (StringUtils.isBlank(folNo)) {
return;
}
EiBlock resultBlock = new EiBlock(EiConstant.resultBlock);
resultBlock.addRow(HgFwTools.HgFw007.get(folNo));
resultBlock.addBlockMeta(new HGFW007().eiMetadata);
inInfo.setBlock(resultBlock);
}
/**
* 数据校验
*
* @param fFw007
* @param dbFw002
*/
private void checkData(HGFW007 fFw007, HGFW007 dbFw002) {
String folNo = fFw007.getFolNo();
AssertUtils.isNull(dbFw002, String.format("回访单【%s】不存在", folNo));
AssertUtils.isNotEquals(dbFw002.getDeleteFlag(), CommonConstant.YesNo.NO_0,
String.format("回访单【%s】不是\"未删除\"状态,不允许操作", folNo));
AssertUtils.isNotEquals(dbFw002.getStatus(), HGConstant.DealStatus.S0,
String.format("回访单【%s】不是\"待回访\"状态,不允许操作", folNo));
}
}
<?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="HGFW001">
<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-已维修 -->
AFTER_SALE_DATE as "afterSaleDate", <!-- 售后日期 -->
AFTER_SALE_NO as "afterSaleNo", <!-- 售后单号 -->
AFTER_SALE_TYPE as "afterSaleType", <!-- 售后方式 -->
URGENCY as "urgency", <!-- 紧急程度 -->
AFTER_SALE_CONTENT as "afterSaleContent", <!-- 售后内容 -->
CUSTOM_ID as "customId", <!-- 客户ID -->
CUSTOM_NAME as "customName", <!-- 客户名称 -->
DEAL_USER_ID as "dealUserId", <!-- 处理人ID -->
DEAL_USER_NAME as "dealUserName", <!-- 处理人名称 -->
DEAL_CONTENT as "dealContent" <!-- 处理内容 -->
</sql>
<sql id="condition">
AND DELETE_FLAG = 0
<include refid="idCondition"/>
<include refid="HGXSDataAuth.authCondition"/>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</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="afterSaleDate">
AFTER_SALE_DATE = #afterSaleDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="afterSaleType">
AFTER_SALE_TYPE = #afterSaleType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="urgency">
URGENCY = #urgency#
</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="afterSaleNo">
AFTER_SALE_NO = #afterSaleNo#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="afterSaleNos">
AFTER_SALE_NO IN <iterate close=")" open="(" conjunction="," property="afterSaleNos">#afterSaleNos[]#</iterate>
</isNotEmpty>
</sql>
<sql id="orderBy">
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
ID DESC
</isEmpty>
</dynamic>
</sql>
<select id="query" resultClass="com.baosight.hggp.hg.fw.domain.HGFW001">
SELECT
<include refid="column"/>
FROM ${hggpSchema}.HGFW001 WHERE 1=1
<include refid="condition"/>
<include refid="orderBy"/>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hggpSchema}.HGFW001 WHERE 1=1
<include refid="condition"/>
</select>
<insert id="insert">
INSERT INTO ${hggpSchema}.HGFW001 (
ACCOUNT_CODE, <!-- 企业编码 -->
DEP_CODE, <!-- 部门编码 -->
CREATED_BY, <!-- 创建人 -->
CREATED_NAME, <!-- 创建人名称 -->
CREATED_TIME, <!-- 创建时间 -->
UPDATED_BY, <!-- 修改人 -->
UPDATED_NAME, <!-- 修改人名称 -->
UPDATED_TIME, <!-- 修改时间 -->
DELETE_FLAG, <!-- 是否删除 0-否1-是 -->
STATUS, <!-- 维修状态 0-未处理 1-已维修 -->
COMPANY_CODE, <!-- 公司编码 -->
COMPANY_NAME, <!-- 公司名称 -->
AFTER_SALE_DATE, <!-- 售后日期 -->
AFTER_SALE_NO, <!-- 售后单号 -->
AFTER_SALE_TYPE, <!-- 售后方式 -->
URGENCY, <!-- 紧急程度 -->
AFTER_SALE_CONTENT, <!-- 售后内容 -->
CUSTOM_ID, <!-- 客户ID -->
CUSTOM_NAME, <!-- 客户名称 -->
DEAL_USER_ID, <!-- 处理人ID -->
DEAL_USER_NAME, <!-- 处理人名称 -->
DEAL_CONTENT <!-- 处理内容 -->
) VALUES (
#accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#,
#updatedName#, #updatedTime#, #deleteFlag#, #status#, #companyCode#, #companyName#,
#afterSaleDate#, #afterSaleNo#, #afterSaleType#, #urgency#, #afterSaleContent#,
#customId#, #customName#, #dealUserId#, #dealUserName#, #dealContent#)
</insert>
<delete id="delete">
UPDATE ${hggpSchema}.HGFW001 SET DELETE_FLAG = 1 WHERE AFTER_SALE_NO = #afterSaleNo#
</delete>
<update id="update">
UPDATE ${hggpSchema}.HGFW001
SET
COMPANY_CODE = #companyCode#, <!-- 公司编码 -->
COMPANY_NAME = #companyName#, <!-- 公司名称 -->
AFTER_SALE_DATE = #afterSaleDate#, <!-- 售后日期 -->
AFTER_SALE_TYPE = #afterSaleType#, <!-- 售后方式 -->
URGENCY = #urgency#, <!-- 紧急程度 -->
AFTER_SALE_CONTENT = #afterSaleContent#, <!-- 售后内容 -->
CUSTOM_ID = #customId#, <!-- 客户ID -->
CUSTOM_NAME = #customName#, <!-- 客户名称 -->
<include refid="SqlBase.updateRevise"/>
WHERE AFTER_SALE_NO = #afterSaleNo#
</update>
<!-- 行锁 -->
<update id="lock">
UPDATE ${hggpSchema}.HGFW001
SET CREATED_TIME = CREATED_TIME
WHERE 1=1
<include refid="idCondition"/>
</update>
<!-- 修改 -->
<update id="updateDeal">
UPDATE ${hggpSchema}.HGFW001
SET
STATUS = #status#,
DEAL_USER_ID = #dealUserId#, <!-- 处理人ID -->
DEAL_USER_NAME = #dealUserName#, <!-- 处理人名称 -->
DEAL_CONTENT = #dealContent#,
<include refid="SqlBase.updateRevise"/>
WHERE AFTER_SALE_NO = #afterSaleNo#
</update>
</sqlMap>
<?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="HGFW002">
<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-是 -->
STATUS as "status", <!-- 维修状态 0-未处理 1-已维修 -->
COMPANY_CODE as "companyCode", <!-- 公司编码 -->
COMPANY_NAME as "companyName", <!-- 公司名称 -->
CARE_DATE as "careDate", <!-- 关怀日期 -->
CARE_NO as "careNo", <!-- 关怀单号 -->
CARE_WAY as "careWay", <!-- 关怀方式 -->
CARE_TYPE as "careType", <!-- 关怀类型 -->
CARE_CONTENT as "careContent", <!-- 关怀内容 -->
CUSTOM_ID as "customId", <!-- 客户ID -->
CUSTOM_NAME as "customName", <!-- 客户名称 -->
DEAL_USER_ID as "dealUserId", <!-- 执行人ID -->
DEAL_USER_NAME as "dealUserName", <!-- 执行人名称 -->
DEAL_CONTENT as "dealContent" <!-- 处理内容 -->
</sql>
<sql id="condition">
AND DELETE_FLAG = 0
<include refid="idCondition"/>
<include refid="HGXSDataAuth.authCondition"/>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</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.hggp.hg.fw.domain.HGFW002">
SELECT
<include refid="column"/>
FROM ${hggpSchema}.HGFW002 WHERE 1=1
<include refid="condition"/>
<include refid="orderBy"/>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hggpSchema}.HGFW002 WHERE 1=1
<include refid="condition"/>
</select>
<insert id="insert">
INSERT INTO ${hggpSchema}.HGFW002 (
ACCOUNT_CODE, <!-- 企业编码 -->
DEP_CODE, <!-- 部门编码 -->
CREATED_BY, <!-- 创建人 -->
CREATED_NAME, <!-- 创建人名称 -->
CREATED_TIME, <!-- 创建时间 -->
UPDATED_BY, <!-- 修改人 -->
UPDATED_NAME, <!-- 修改人名称 -->
UPDATED_TIME, <!-- 修改时间 -->
DELETE_FLAG, <!-- 是否删除 0-否1-是 -->
STATUS, <!-- 维修状态 0-未处理 1-已维修 -->
COMPANY_CODE, <!-- 公司编码 -->
COMPANY_NAME, <!-- 公司名称 -->
CARE_DATE, <!-- 关怀日期 -->
CARE_NO, <!-- 关怀单号 -->
CARE_WAY, <!-- 关怀方式 -->
CARE_TYPE, <!-- 关怀类型 -->
CARE_CONTENT, <!-- 关怀内容 -->
CUSTOM_ID, <!-- 客户ID -->
CUSTOM_NAME, <!-- 客户名称 -->
DEAL_USER_ID, <!-- 执行人ID -->
DEAL_USER_NAME, <!-- 执行人名称 -->
DEAL_CONTENT <!-- 处理内容 -->
) VALUES (
#accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#,
#updatedName#, #updatedTime#, #deleteFlag#, #status#, #companyCode#, #companyName#,
#careDate#, #careNo#, #careWay#, #careType#, #careContent#, #customId#, #customName#,
#dealUserId#, #dealUserName#, #dealContent#)
</insert>
<delete id="delete">
UPDATE ${hggpSchema}.HGFW002 SET DELETE_FLAG = 1 WHERE CARE_NO = #careNo#
</delete>
<update id="update">
UPDATE ${hggpSchema}.HGFW002
SET
COMPANY_CODE = #companyCode#, <!-- 公司编码 -->
COMPANY_NAME = #companyName#, <!-- 公司名称 -->
CARE_DATE = #careDate#, <!-- 关怀日期 -->
CARE_NO = #careNo#, <!-- 关怀单号 -->
CARE_WAY = #careWay#, <!-- 关怀方式 -->
CARE_TYPE = #careType#, <!-- 关怀类型 -->
CARE_CONTENT = #careContent#, <!-- 关怀内容 -->
CUSTOM_ID = #customId#, <!-- 客户ID -->
CUSTOM_NAME = #customName#, <!-- 客户名称 -->
<include refid="SqlBase.updateRevise"/>
WHERE ID = #id#
</update>
<!-- 行锁 -->
<update id="lock">
UPDATE ${hggpSchema}.HGFW002
SET CREATED_TIME = CREATED_TIME
WHERE 1=1
<include refid="idCondition"/>
</update>
<!-- 修改 -->
<update id="updateDeal">
UPDATE ${hggpSchema}.HGFW002
SET
STATUS = #status#,
DEAL_USER_ID = #dealUserId#, <!-- 处理人ID -->
DEAL_USER_NAME = #dealUserName#, <!-- 处理人名称 -->
DEAL_CONTENT = #dealContent#, <!-- 处理内容 -->
<include refid="SqlBase.updateRevise"/>
WHERE CARE_NO = #careNo#
</update>
</sqlMap>
<?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="HGFW003">
<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-是 -->
COMPLAINT_DATE as "complaintDate", <!-- 投诉日期 -->
COMPLAINT_NO as "complaintNo", <!-- 投诉单号 -->
STATUS as "status", <!-- 维修状态 0-未处理 1-已维修 -->
COMPANY_CODE as "companyCode", <!-- 公司编码 -->
COMPANY_NAME as "companyName", <!-- 公司名称 -->
CUSTOM_ID as "customId", <!-- 客户ID -->
CUSTOM_NAME as "customName", <!-- 客户名称 -->
COMPLAINT_WAY as "complaintWay", <!-- 投诉方式 -->
COMPLAINT_TYPE as "complaintType", <!-- 投诉类型 -->
COMPLAINT_CONTENT as "complaintContent", <!-- 投诉内容 -->
COMPLAINT_USER_ID as "complaintUserId", <!-- 被投诉人ID -->
COMPLAINT_USER_NAME as "complaintUserName", <!-- 被投诉人名称 -->
ACCEPT_USER_ID as "acceptUserId", <!-- 受理人ID -->
ACCEPT_USER_NAME as "acceptUserName", <!-- 受理人名称 -->
LAST_DATE as "lastDate", <!-- 最后期限 -->
DEAL_CONTENT as "dealContent", <!-- 处理结果 -->
DEAL_USER_ID as "dealUserId", <!-- 处理人ID -->
DEAL_USER_NAME as "dealUserName" <!-- 处理人名称 -->
</sql>
<sql id="condition">
AND DELETE_FLAG = 0
<include refid="idCondition"/>
<include refid="HGXSDataAuth.authCondition"/>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</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="complaintDate">
COMPLAINT_DATE = #complaintDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="status">
STATUS = #status#
</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="complaintWay">
COMPLAINT_WAY = #complaintWay#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="complaintType">
COMPLAINT_TYPE = #complaintType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="complaintContent">
COMPLAINT_CONTENT = #complaintContent#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="complaintUserId">
COMPLAINT_USER_ID = #complaintUserId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="complaintUserName">
COMPLAINT_USER_NAME LIKE CONCAT('%', #complaintUserName#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="acceptUserId">
ACCEPT_USER_ID = #acceptUserId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="acceptUserName">
ACCEPT_USER_NAME = #acceptUserName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="lastDate">
LAST_DATE = #lastDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="dealContent">
DEAL_CONTENT = #dealContent#
</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="complaintNo">
COMPLAINT_NO = #complaintNo#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="complaintNos">
COMPLAINT_NO IN <iterate close=")" open="(" conjunction="," property="complaintNos">#complaintNos[]#</iterate>
</isNotEmpty>
</sql>
<sql id="orderBy">
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
ID DESC
</isEmpty>
</dynamic>
</sql>
<select id="query" resultClass="com.baosight.hggp.hg.fw.domain.HGFW003">
SELECT
<include refid="column"/>
FROM ${hggpSchema}.HGFW003
WHERE 1=1
<include refid="condition"/>
<include refid="orderBy"/>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hggpSchema}.HGFW003 WHERE 1=1
<include refid="condition"/>
</select>
<insert id="insert">
INSERT INTO ${hggpSchema}.HGFW003 (
ACCOUNT_CODE, <!-- 企业编码 -->
DEP_CODE, <!-- 部门编码 -->
CREATED_BY, <!-- 创建人 -->
CREATED_NAME, <!-- 创建人名称 -->
CREATED_TIME, <!-- 创建时间 -->
UPDATED_BY, <!-- 修改人 -->
UPDATED_NAME, <!-- 修改人名称 -->
UPDATED_TIME, <!-- 修改时间 -->
DELETE_FLAG, <!-- 是否删除 0-否1-是 -->
COMPLAINT_DATE, <!-- 投诉日期 -->
COMPLAINT_NO, <!-- 投诉单号 -->
STATUS, <!-- 维修状态 0-未处理 1-已维修 -->
COMPANY_CODE, <!-- 公司编码 -->
COMPANY_NAME, <!-- 公司名称 -->
CUSTOM_ID, <!-- 客户ID -->
CUSTOM_NAME, <!-- 客户名称 -->
COMPLAINT_WAY, <!-- 投诉方式 -->
COMPLAINT_TYPE, <!-- 投诉类型 -->
COMPLAINT_CONTENT, <!-- 投诉内容 -->
COMPLAINT_USER_ID, <!-- 被投诉人ID -->
COMPLAINT_USER_NAME, <!-- 被投诉人名称 -->
ACCEPT_USER_ID, <!-- 受理人ID -->
ACCEPT_USER_NAME, <!-- 受理人名称 -->
LAST_DATE, <!-- 最后期限 -->
DEAL_CONTENT, <!-- 处理结果 -->
DEAL_USER_ID, <!-- 处理人ID -->
DEAL_USER_NAME <!-- 处理人名称 -->
) VALUES (
#accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#,
#updatedName#, #updatedTime#, #deleteFlag#, #complaintDate#, #complaintNo#, #status#,
#companyCode#, #companyName#, #customId#, #customName#, #complaintWay#, #complaintType#,
#complaintContent#, #complaintUserId#, #complaintUserName#, #acceptUserId#, #acceptUserName#,
#lastDate#, #dealContent#, #dealUserId#, #dealUserName#)
</insert>
<delete id="delete">
UPDATE ${hggpSchema}.HGFW003 SET DELETE_FLAG = 1 WHERE COMPLAINT_NO = #complaintNo#
</delete>
<update id="update">
UPDATE ${hggpSchema}.HGFW003
SET
COMPANY_CODE = #companyCode#, <!-- 公司编码 -->
COMPANY_NAME = #companyName#, <!-- 公司名称 -->
COMPLAINT_DATE = #complaintDate#, <!-- 投诉日期 -->
CUSTOM_ID = #customId#, <!-- 客户ID -->
CUSTOM_NAME = #customName#, <!-- 客户名称 -->
COMPLAINT_WAY = #complaintWay#, <!-- 投诉方式 -->
COMPLAINT_TYPE = #complaintType#, <!-- 投诉类型 -->
COMPLAINT_CONTENT = #complaintContent#, <!-- 投诉内容 -->
COMPLAINT_USER_ID = #complaintUserId#, <!-- 被投诉人ID -->
COMPLAINT_USER_NAME = #complaintUserName#, <!-- 被投诉人名称 -->
ACCEPT_USER_ID = #acceptUserId#, <!-- 受理人ID -->
ACCEPT_USER_NAME = #acceptUserName#, <!-- 受理人名称 -->
LAST_DATE = #lastDate#, <!-- 最后期限 -->
<include refid="SqlBase.updateRevise"/>
WHERE ID = #id#
</update>
<!-- 行锁 -->
<update id="lock">
UPDATE ${hggpSchema}.HGFW003
SET CREATED_TIME = CREATED_TIME
WHERE 1=1
<include refid="idCondition"/>
</update>
<!-- 修改 -->
<update id="updateDeal">
UPDATE ${hggpSchema}.HGFW003
SET
STATUS = #status#,
DEAL_USER_ID = #dealUserId#, <!-- 处理人ID -->
DEAL_USER_NAME = #dealUserName#, <!-- 处理人名称 -->
DEAL_CONTENT = #dealContent#, <!-- 处理内容 -->
<include refid="SqlBase.updateRevise"/>
WHERE COMPLAINT_NO = #complaintNo#
</update>
</sqlMap>
<?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="HGFW004">
<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-是 -->
STATUS as "status", <!-- 维修状态 0-未处理 1-已维修 -->
COMPANY_CODE as "companyCode", <!-- 公司编码 -->
COMPANY_NAME as "companyName", <!-- 公司名称 -->
SUGGEST_DATE as "suggestDate", <!-- 建议日期 -->
SUGGEST_NO as "suggestNo", <!-- 建议单号 -->
CUSTOM_ID as "customId", <!-- 客户ID -->
CUSTOM_NAME as "customName", <!-- 客户名称 -->
SUGGEST_WAY as "suggestWay", <!-- 建议方式 -->
SUGGEST_TYPE as "suggestType", <!-- 建议类型 -->
SUGGEST_CONTENT as "suggestContent", <!-- 建议内容 -->
DEAL_USER_ID as "dealUserId", <!-- 处理人ID -->
DEAL_USER_NAME as "dealUserName", <!-- 处理人名称 -->
DEAL_CONTENT as "dealContent" <!-- 处理结果 -->
</sql>
<sql id="condition">
AND DELETE_FLAG = 0
<include refid="idCondition"/>
<include refid="HGXSDataAuth.authCondition"/>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
CREATED_BY = #createdBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdName">
CREATED_NAME = #createdName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
CREATED_TIME = #createdTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy">
UPDATED_BY = #updatedBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedName">
UPDATED_NAME = #updatedName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime">
UPDATED_TIME = #updatedTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deleteFlag">
DELETE_FLAG = #deleteFlag#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="status">
STATUS = #status#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="suggestDate">
SUGGEST_DATE = #suggestDate#
</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="suggestWay">
SUGGEST_WAY = #suggestWay#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="suggestType">
SUGGEST_TYPE = #suggestType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="suggestContent">
SUGGEST_CONTENT = #suggestContent#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="dealContent">
DEAL_CONTENT = #dealContent#
</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="suggestNo">
SUGGEST_NO = #suggestNo#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="suggestNos">
SUGGEST_NO IN <iterate close=")" open="(" conjunction="," property="suggestNos">#suggestNos[]#</iterate>
</isNotEmpty>
</sql>
<sql id="orderBy">
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
ID DESC
</isEmpty>
</dynamic>
</sql>
<select id="query" resultClass="com.baosight.hggp.hg.fw.domain.HGFW004">
SELECT
<include refid="column"/>
FROM ${hggpSchema}.HGFW004
WHERE 1=1
<include refid="condition"/>
<include refid="orderBy"/>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hggpSchema}.HGFW004 WHERE 1=1
<include refid="condition"/>
</select>
<insert id="insert">
INSERT INTO ${hggpSchema}.HGFW004 (
ACCOUNT_CODE, <!-- 企业编码 -->
DEP_CODE, <!-- 部门编码 -->
CREATED_BY, <!-- 创建人 -->
CREATED_NAME, <!-- 创建人名称 -->
CREATED_TIME, <!-- 创建时间 -->
UPDATED_BY, <!-- 修改人 -->
UPDATED_NAME, <!-- 修改人名称 -->
UPDATED_TIME, <!-- 修改时间 -->
DELETE_FLAG, <!-- 是否删除 0-否1-是 -->
STATUS, <!-- 维修状态 0-未处理 1-已维修 -->
COMPANY_CODE, <!-- 公司编码 -->
COMPANY_NAME, <!-- 公司名称 -->
SUGGEST_DATE, <!-- 建议日期 -->
SUGGEST_NO, <!-- 建议单号 -->
CUSTOM_ID, <!-- 客户ID -->
CUSTOM_NAME, <!-- 客户名称 -->
SUGGEST_WAY, <!-- 建议方式 -->
SUGGEST_TYPE, <!-- 建议类型 -->
SUGGEST_CONTENT, <!-- 建议内容 -->
DEAL_USER_ID, <!-- 处理人ID -->
DEAL_USER_NAME, <!-- 处理人名称 -->
DEAL_CONTENT <!-- 处理结果 -->
) VALUES (
#accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#,
#updatedName#, #updatedTime#, #deleteFlag#, #status#, #companyCode#, #companyName#,
#suggestDate#, #suggestNo#, #customId#, #customName#, #suggestWay#, #suggestType#,
#suggestContent#, #dealUserId#, #dealUserName#, #dealContent#)
</insert>
<delete id="delete">
UPDATE ${hggpSchema}.HGFW004 SET DELETE_FLAG = 1 WHERE SUGGEST_NO = #suggestNo#
</delete>
<update id="update">
UPDATE ${hggpSchema}.HGFW004
SET
COMPANY_CODE = #companyCode#, <!-- 公司编码 -->
COMPANY_NAME = #companyName#, <!-- 公司名称 -->
SUGGEST_DATE = #suggestDate#, <!-- 建议日期 -->
CUSTOM_ID = #customId#, <!-- 客户ID -->
CUSTOM_NAME = #customName#, <!-- 客户名称 -->
SUGGEST_WAY = #suggestWay#, <!-- 建议方式 -->
SUGGEST_TYPE = #suggestType#, <!-- 建议类型 -->
SUGGEST_CONTENT = #suggestContent#, <!-- 建议内容 -->
<include refid="SqlBase.updateRevise"/>
WHERE ID = #id#
</update>
<!-- 行锁 -->
<update id="lock">
UPDATE ${hggpSchema}.HGFW004
SET CREATED_TIME = CREATED_TIME
WHERE 1=1
<include refid="idCondition"/>
</update>
<!-- 修改 -->
<update id="updateDeal">
UPDATE ${hggpSchema}.HGFW004
SET
STATUS = #status#,
DEAL_USER_ID = #dealUserId#, <!-- 处理人ID -->
DEAL_USER_NAME = #dealUserName#, <!-- 处理人名称 -->
DEAL_CONTENT = #dealContent#, <!-- 处理内容 -->
<include refid="SqlBase.updateRevise"/>
WHERE SUGGEST_NO = #suggestNo#
</update>
</sqlMap>
<?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="HGFW007">
<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-是 -->
FOL_DATE as "folDate", <!-- 回访日期 -->
FOL_NO as "folNo", <!-- 回访单号 -->
DEL_ORDER_NO as "delOrderNo", <!-- 发货单号 -->
FOL_WAY as "folWay", <!-- 回访方式 1-电话回访 2-上门回访 -->
STATUS as "status", <!-- 维修状态 0-未处理 1-已维修 -->
COMPANY_CODE as "companyCode", <!-- 公司编码 -->
COMPANY_NAME as "companyName", <!-- 公司名称 -->
CUSTOM_ID as "customId", <!-- 客户ID -->
CUSTOM_NAME as "customName", <!-- 客户名称 -->
DEAL_USER_ID as "dealUserId", <!-- 回访人ID -->
DEAL_USER_NAME as "dealUserName", <!-- 回访人名称 -->
DEAL_CONTENT as "dealContent" <!-- 回访内容 -->
</sql>
<sql id="condition">
AND DELETE_FLAG = 0
<include refid="idCondition"/>
<include refid="HGXSDataAuth.authCondition"/>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</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="folDate">
FOL_DATE = #folDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="delOrderNo">
DEL_ORDER_NO LIKE CONCAT('%', #delOrderNo#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="folWay">
FOL_WAY = #folWay#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="status">
STATUS = #status#
</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="dealContent">
DEAL_CONTENT = #dealContent#
</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="folNo">
FOL_NO = #folNo#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="folNos">
FOL_NO IN <iterate close=")" open="(" conjunction="," property="folNos">#folNos[]#</iterate>
</isNotEmpty>
</sql>
<sql id="orderBy">
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
ID DESC
</isEmpty>
</dynamic>
</sql>
<select id="query" resultClass="com.baosight.hggp.hg.fw.domain.HGFW007">
SELECT
<include refid="column"/>
FROM ${hggpSchema}.HGFW007 WHERE 1=1
<include refid="condition"/>
<include refid="orderBy"/>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hggpSchema}.HGFW007 WHERE 1=1
<include refid="condition"/>
</select>
<insert id="insert">
INSERT INTO ${hggpSchema}.HGFW007 (
ACCOUNT_CODE, <!-- 企业编码 -->
DEP_CODE, <!-- 部门编码 -->
CREATED_BY, <!-- 创建人 -->
CREATED_NAME, <!-- 创建人名称 -->
CREATED_TIME, <!-- 创建时间 -->
UPDATED_BY, <!-- 修改人 -->
UPDATED_NAME, <!-- 修改人名称 -->
UPDATED_TIME, <!-- 修改时间 -->
DELETE_FLAG, <!-- 是否删除 0-否1-是 -->
FOL_DATE, <!-- 回访日期 -->
FOL_NO, <!-- 回访单号 -->
DEL_ORDER_NO, <!-- 发货单号 -->
FOL_WAY, <!-- 回访方式 1-电话回访 2-上门回访 -->
STATUS, <!-- 维修状态 0-未处理 1-已维修 -->
COMPANY_CODE, <!-- 公司编码 -->
COMPANY_NAME, <!-- 公司名称 -->
CUSTOM_ID, <!-- 客户ID -->
CUSTOM_NAME, <!-- 客户名称 -->
DEAL_USER_ID, <!-- 回访人ID -->
DEAL_USER_NAME, <!-- 回访人名称 -->
DEAL_CONTENT <!-- 回访内容 -->
) VALUES (
#accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#,
#updatedName#, #updatedTime#, #deleteFlag#, #folDate#, #folNo#, #delOrderNo#,
#folWay#, #status#, #companyCode#, #companyName#, #customId#, #customName#,
#dealUserId#, #dealUserName#, #dealContent#)
</insert>
<delete id="delete">
UPDATE ${hggpSchema}.HGFW007 SET DELETE_FLAG = 1 WHERE FOL_NO = #folNo#
</delete>
<update id="update">
UPDATE ${hggpSchema}.HGFW007
SET
COMPANY_CODE = #companyCode#, <!-- 公司编码 -->
COMPANY_NAME = #companyName#, <!-- 公司名称 -->
FOL_DATE = #folDate#, <!-- 回访日期 -->
DEL_ORDER_NO = #delOrderNo#, <!-- 发货单号 -->
FOL_WAY = #folWay#, <!-- 回访方式 1-电话回访 2-上门回访 -->
CUSTOM_ID = #customId#, <!-- 客户ID -->
CUSTOM_NAME = #customName#, <!-- 客户名称 -->
<include refid="SqlBase.updateRevise"/>
WHERE ID = #id#
</update>
<!-- 行锁 -->
<update id="lock">
UPDATE ${hggpSchema}.HGFW007
SET CREATED_TIME = CREATED_TIME
WHERE 1=1
<include refid="idCondition"/>
</update>
<!-- 修改 -->
<update id="updateDeal">
UPDATE ${hggpSchema}.HGFW007
SET
STATUS = #status#,
DEAL_USER_ID = #dealUserId#,
DEAL_USER_NAME = #dealUserName#,
DEAL_CONTENT = #dealContent#,
<include refid="SqlBase.updateRevise"/>
WHERE FOL_NO = #folNo#
</update>
</sqlMap>
package com.baosight.hggp.hg.fw.utils;
import com.baosight.hggp.hg.fw.domain.HGFW001;
import com.baosight.hggp.hg.fw.domain.HGFW002;
import com.baosight.hggp.hg.fw.domain.HGFW003;
import com.baosight.hggp.hg.fw.domain.HGFW004;
import com.baosight.hggp.hg.fw.domain.HGFW007;
import com.baosight.hggp.hg.fw.tools.HgFwTools;
import com.baosight.hggp.util.ObjectUtils;
import java.util.List;
import java.util.Map;
/**
* @author:songx
* @date:2024/9/24,18:06
*/
public class HgFwUtils {
/**
* @author:songx
* @date:2024/9/24,18:07
*/
public static class HgFw001 {
/**
* 锁并获取数据
*
* @param fFw001s
* @return
*/
public static Map<String, HGFW001> lockAndGet(List<HGFW001> fFw001s) {
List<String> afterSaleNos = ObjectUtils.listEpKey(fFw001s, HGFW001.FIELD_AFTER_SALE_NO);
// 锁
HgFwTools.HgFw001.lock(afterSaleNos);
// 查询数据
return HgFwTools.HgFw001.map(afterSaleNos);
}
/**
* 锁并获取数据
*
* @param fFw001
* @return
*/
public static HGFW001 lockAndGet(HGFW001 fFw001) {
return lockAndGet(fFw001.getAfterSaleNo());
}
/**
* 锁并获取数据
*
* @param afterSaleNo
* @return
*/
public static HGFW001 lockAndGet(String afterSaleNo) {
// 锁
HgFwTools.HgFw001.lock(afterSaleNo);
// 查询数据
return HgFwTools.HgFw001.get(afterSaleNo);
}
}
/**
* @author:songx
* @date:2024/9/24,18:07
*/
public static class HgFw002 {
/**
* 锁并获取数据
*
* @param fFw002s
* @return
*/
public static Map<String, HGFW002> lockAndGet(List<HGFW002> fFw002s) {
List<String> careNos = ObjectUtils.listEpKey(fFw002s, HGFW002.FIELD_CARE_NO);
// 锁
HgFwTools.HgFw002.lock(careNos);
// 查询数据
return HgFwTools.HgFw002.map(careNos);
}
/**
* 锁并获取数据
*
* @param fFw002
* @return
*/
public static HGFW002 lockAndGet(HGFW002 fFw002) {
return lockAndGet(fFw002.getCareNo());
}
/**
* 锁并获取数据
*
* @param careNo
* @return
*/
public static HGFW002 lockAndGet(String careNo) {
// 锁
HgFwTools.HgFw002.lock(careNo);
// 查询数据
return HgFwTools.HgFw002.get(careNo);
}
}
/**
* @author:songx
* @date:2024/9/24,18:07
*/
public static class HgFw003 {
/**
* 锁并获取数据
*
* @param fFw003s
* @return
*/
public static Map<String, HGFW003> lockAndGet(List<HGFW003> fFw003s) {
List<String> complaintNos = ObjectUtils.listEpKey(fFw003s, HGFW003.FIELD_COMPLAINT_NO);
// 锁
HgFwTools.HgFw003.lock(complaintNos);
// 查询数据
return HgFwTools.HgFw003.map(complaintNos);
}
/**
* 锁并获取数据
*
* @param fFw003
* @return
*/
public static HGFW003 lockAndGet(HGFW003 fFw003) {
return lockAndGet(fFw003.getComplaintNo());
}
/**
* 锁并获取数据
*
* @param complaintNo
* @return
*/
public static HGFW003 lockAndGet(String complaintNo) {
// 锁
HgFwTools.HgFw003.lock(complaintNo);
// 查询数据
return HgFwTools.HgFw003.get(complaintNo);
}
}
/**
* @author:songx
* @date:2024/9/24,18:07
*/
public static class HgFw004 {
/**
* 锁并获取数据
*
* @param fFw004s
* @return
*/
public static Map<String, HGFW004> lockAndGet(List<HGFW004> fFw004s) {
List<String> suggests = ObjectUtils.listEpKey(fFw004s, HGFW004.FIELD_SUGGEST_NO);
// 锁
HgFwTools.HgFw004.lock(suggests);
// 查询数据
return HgFwTools.HgFw004.map(suggests);
}
/**
* 锁并获取数据
*
* @param fFw004
* @return
*/
public static HGFW004 lockAndGet(HGFW004 fFw004) {
return lockAndGet(fFw004.getSuggestNo());
}
/**
* 锁并获取数据
*
* @param suggestNo
* @return
*/
public static HGFW004 lockAndGet(String suggestNo) {
// 锁
HgFwTools.HgFw004.lock(suggestNo);
// 查询数据
return HgFwTools.HgFw004.get(suggestNo);
}
}
/**
* @author:songx
* @date:2024/9/24,18:07
*/
public static class HgFw007 {
/**
* 锁并获取数据
*
* @param fFw007s
* @return
*/
public static Map<String, HGFW007> lockAndGet(List<HGFW007> fFw007s) {
List<String> folNos = ObjectUtils.listEpKey(fFw007s, HGFW007.FIELD_FOL_NO);
// 锁
HgFwTools.HgFw007.lock(folNos);
// 查询数据
return HgFwTools.HgFw007.map(folNos);
}
/**
* 锁并获取数据
*
* @param fFw007
* @return
*/
public static HGFW007 lockAndGet(HGFW007 fFw007) {
return lockAndGet(fFw007.getFolNo());
}
/**
* 锁并获取数据
*
* @param folNo
* @return
*/
public static HGFW007 lockAndGet(String folNo) {
// 锁
HgFwTools.HgFw007.lock(folNo);
// 查询数据
return HgFwTools.HgFw007.get(folNo);
}
}
}
......@@ -154,4 +154,12 @@
WHERE ID = #id#
</update>
<select id="getSaleCode" parameterClass="java.util.HashMap" resultClass="java.util.HashMap">
SELECT SALE_OUT_CODE AS "saleOutCode"
FROM ${hggpSchema}.HGKC004
WHERE 1=1
AND DELETE_FLAG = 0
<include refid="HGXSDataAuth.authCondition"/>
</select>
</sqlMap>
package com.baosight.hggp.hg.xt.constant;
/**
* @author:songx
* @date:2024/9/24,17:53
*/
public class HgXtConst {
/**
* HGXT001 定义
*
* @author:songx
* @date:2024/9/24,17:54
*/
public static class HgXt001 {
}
/**
* HGXT001 定义
*
* @author:songx
* @date:2024/9/24,17:54
*/
public static class HgXt002 {
}
}
package com.baosight.hggp.hg.xt.constant;
/**
* @author:songx
* @date:2024/9/24,18:09
*/
public class HgXtSqlConst {
/**
* @author:songx
* @date:2024/8/29,15:54
*/
public static class HgXt011 {
// 锁
public static final String LOCK = "HGXT011.lock";
// 发布
public static final String UPDATE_SUBMIT = "HGXT011.updateSubmit";
}
}
package com.baosight.hggp.hg.xt.service;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.xt.constant.HgXtSqlConst;
import com.baosight.hggp.hg.xt.domain.HGXT011;
import com.baosight.hggp.hg.xt.utils.HgXtUtils;
import com.baosight.hggp.util.AssertUtils;
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.List;
import java.util.Map;
/**
* 公告管理
*
* @author:songx
* @date:2024/9/24,17:47
*/
public class ServiceHGXT011 extends ServiceBase {
/**
* 画面初始化
*
* @param inInfo
* @return
*/
@Override
public EiInfo initLoad(EiInfo inInfo) {
try {
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGXT011().eiMetadata);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询操作.
*/
@Override
public EiInfo query(EiInfo inInfo) {
try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
queryMap.put(HGXT011.FIELD_NOTICE_DATE, DateUtils.formatShort(queryMap.get(HGXT011.FIELD_NOTICE_DATE)));
inInfo = super.query(inInfo, HGXT011.QUERY, new HGXT011());
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
/**
* 删除操作
*
* @param inInfo
* @return
*/
public EiInfo remove(EiInfo inInfo) {
try {
List<HGXT011> fXt011s = MapUtils.toDaoEPBases(inInfo, HGXT011.class);
// db数据
Map<String, HGXT011> dbXt011Map = HgXtUtils.HgXt011.lockAndGet(fXt011s);
// 数据校验
this.checkRemoveData(fXt011s, dbXt011Map);
// 保存数据
this.removeData(fXt011s);
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + fXt011s.size() + "]条数据删除成功!");
} catch (Exception e) {
LogUtils.setMsg(inInfo, e, "删除失败");
}
return inInfo;
}
/**
* 数据校验
*
* @param fXt011s
* @param dbXt011Map
*/
private void checkRemoveData(List<HGXT011> fXt011s, Map<String, HGXT011> dbXt011Map) {
for (HGXT011 fXt011 : fXt011s) {
String noticeNo = fXt011.getNoticeNo();
HGXT011 dbXt011 = dbXt011Map.get(noticeNo);
this.checkData(noticeNo, dbXt011);
}
}
/**
* 数据保存
*
* @param fXt011s
*/
private void removeData(List<HGXT011> fXt011s) {
for (HGXT011 fXt011 : fXt011s) {
fXt011.setDeleteFlag(CommonConstant.YesNo.YES_1);
DaoUtils.update(HGXT011.DELETE, fXt011.toMap());
}
}
/**
* 检查状态
*
* @param inInfo
* @return
*/
public EiInfo checkStatus(EiInfo inInfo) {
try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
String noticeNo = MapUtils.getString(queryMap, HGXT011.FIELD_NOTICE_NO);
HGXT011 dbXt011 = HgXtUtils.HgXt011.lockAndGet(noticeNo);
this.checkData(noticeNo, dbXt011);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "操作失败");
}
return inInfo;
}
/**
* 提交
*
* @param inInfo
* @return
*/
public EiInfo submit(EiInfo inInfo) {
try {
List<HGXT011> fXt011s = MapUtils.toDaoEPBases(inInfo, HGXT011.class);
// db数据
Map<String, HGXT011> dbXt011Map = HgXtUtils.HgXt011.lockAndGet(fXt011s);
// 数据校验
this.checkSubmitData(fXt011s, dbXt011Map);
// 保存数据
this.submitData(fXt011s);
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + fXt011s.size() + "]条数据提交成功!");
} catch (Exception e) {
LogUtils.setMsg(inInfo, e, "处理失败");
}
return inInfo;
}
/**
* 数据校验
*
* @param fXt011s
* @param dbXt011Map
*/
private void checkSubmitData(List<HGXT011> fXt011s, Map<String, HGXT011> dbXt011Map) {
for (HGXT011 fXt011 : fXt011s) {
String noticeNo = fXt011.getNoticeNo();
HGXT011 dbXt011 = dbXt011Map.get(noticeNo);
this.checkData(noticeNo, dbXt011);
}
}
/**
* 数据保存
*
* @param fXt011s
*/
private void submitData(List<HGXT011> fXt011s) {
for (HGXT011 fXt011 : fXt011s) {
fXt011.setStatus(HGConstant.SubmitStatus.S1);
fXt011.setSubmitUserId(UserSessionUtils.getLoginName());
fXt011.setSubmitUserName(UserSessionUtils.getLoginCName());
fXt011.setSubmitTime(DateUtils.shortDateTime());
DaoUtils.update(HgXtSqlConst.HgXt011.UPDATE_SUBMIT, fXt011.toMap());
}
}
/**
* 数据校验
*
* @param noticeNo
* @param dbXt011
*/
private void checkData(String noticeNo, HGXT011 dbXt011) {
AssertUtils.isNull(dbXt011, String.format("公告[%s]不存在", noticeNo));
AssertUtils.isNotEquals(dbXt011.getDeleteFlag(), CommonConstant.YesNo.NO_0,
String.format("公告【%s】不是\"未删除\"状态,不允许操作", noticeNo));
AssertUtils.isNotEquals(dbXt011.getStatus(), HGConstant.SubmitStatus.S0,
String.format("公告【%s】不是\"未提交\"状态,不允许操作", noticeNo));
}
}
package com.baosight.hggp.hg.xt.service;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.utils.Iplat4jUtils;
import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.dm.domain.HGDM099;
import com.baosight.hggp.hg.xt.domain.HGXT011;
import com.baosight.hggp.hg.xt.tools.HgXtTools;
import com.baosight.hggp.hg.xt.utils.HgXtUtils;
import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.EiInfoUtils;
import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.MapUtils;
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 java.util.List;
import java.util.Map;
/**
* 附件清单
*
* @author:songx
* @date:2022/7/11,11:08
*/
public class ServiceHGXT011A extends ServiceEPBase {
/**
* 初始化
*
* @param inInfo
* @return
*/
@Override
public EiInfo initLoad(EiInfo inInfo) {
try {
this.setDetailInfo(inInfo);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGDM099().eiMetadata);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询操作
*
* @param inInfo
* @return
*/
@Override
public EiInfo query(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HGDM099.QUERY, new HGDM099());
} catch (Throwable e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
/**
* 删除
*
* @param inInfo
* @return
*/
public EiInfo remove(EiInfo inInfo) {
try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
String bizId = MapUtils.getString(queryMap, HGDM099.FIELD_BIZ_ID);
HGXT011 dbXt001 = HgXtUtils.HgXt011.lockAndGet(bizId);
this.checkData(bizId, dbXt001);
List<HGDM099> fDm099s = MapUtils.toDaoEPBases(inInfo, HGDM099.class);
for (HGDM099 fDm099 : fDm099s) {
DaoUtils.update(HGDM099.DELETE, fDm099);
if (!fDm099.getDocId().isEmpty()) {
Iplat4jUtils.deleteFileByDocId(fDm099.getDocId());
}
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + fDm099s.size() + "]条数据删除成功!");
} catch (Throwable e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
/**
* 数据校验
*
* @param noticeNo
* @param dbXt001
*/
private void checkData(String noticeNo, HGXT011 dbXt001) {
AssertUtils.isNull(dbXt001, String.format("公告[%s]不存在", noticeNo));
AssertUtils.isNotEquals(dbXt001.getDeleteFlag(), CommonConstant.YesNo.NO_0,
String.format("公告【%s】不是\"未删除\"状态,不允许操作", noticeNo));
AssertUtils.isNotEquals(dbXt001.getStatus(), HGConstant.DealStatus.S0,
String.format("公告【%s】不是\"未提交\"状态,不允许操作", noticeNo));
}
/**
* 设置信息
*
* @param inInfo
*/
public void setDetailInfo(EiInfo inInfo) {
Map queryRow = EiInfoUtils.getFirstRow(inInfo);
String bizId = MapUtils.getString(queryRow, HGDM099.FIELD_BIZ_ID);
if (bizId == null) {
return;
}
EiBlock block = new EiBlock(CommonConstant.Field.DETAIL);
block.addRow(HgXtTools.HgXt011.get(bizId));
block.addBlockMeta(new HGXT011().eiMetadata);
inInfo.setBlock(block);
}
}
package com.baosight.hggp.hg.xt.service;
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.constant.HGConstant;
import com.baosight.hggp.hg.xt.domain.HGXT011;
import com.baosight.hggp.hg.xt.tools.HgXtTools;
import com.baosight.hggp.hg.xt.utils.HgXtUtils;
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 ServiceHGXT011B 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
*/
public EiInfo save(EiInfo inInfo) {
try {
HGXT011 fXt011 = MapUtils.toDaoEPBase(inInfo, HGXT011.class);
fXt011.setNoticeDate(DateUtils.formatShort(fXt011.getNoticeDate()));
fXt011.setExpireDate(DateUtils.formatShort(fXt011.getExpireDate()));
if (StringUtils.isBlank(fXt011.getNoticeNo())) {
this.add(fXt011);
} else {
this.modify(fXt011);
}
// 回填实体信息,移动端更新数据使用
inInfo.set("detail", fXt011);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 新增
*
* @param fXt011
*/
private void add(HGXT011 fXt011) {
fXt011.setNoticeNo(SequenceGenerator.getNextSequence(HGConstant.SequenceId.NOTICE_NO));
fXt011.setStatus(HGConstant.SubmitStatus.S0);
fXt011.setDeleteFlag(CommonConstant.YesNo.NO_0);
DaoUtils.insert(HGXT011.INSERT, fXt011);
}
/**
* 修改数据
*
* @param fXt011
*/
private void modify(HGXT011 fXt011) {
HGXT011 dbXt011 = HgXtUtils.HgXt011.lockAndGet(fXt011);
this.checkData(fXt011, dbXt011);
DaoUtils.update(HGXT011.UPDATE, fXt011);
}
/**
* 设置信息
*
* @param inInfo
*/
public void setBaseInfo(EiInfo inInfo) {
Map queryRow = EiInfoUtils.getFirstRow(inInfo);
String noticeNo = MapUtils.getString(queryRow, HGXT011.FIELD_NOTICE_NO);
if (StringUtils.isBlank(noticeNo)) {
return;
}
EiBlock resultBlock = new EiBlock(EiConstant.resultBlock);
resultBlock.addRow(HgXtTools.HgXt011.get(noticeNo));
resultBlock.addBlockMeta(new HGXT011().eiMetadata);
inInfo.setBlock(resultBlock);
}
/**
* 数据校验
*
* @param fXt011
* @param dbXt011
*/
private void checkData(HGXT011 fXt011, HGXT011 dbXt011) {
String noticeNo = fXt011.getNoticeNo();
AssertUtils.isNull(dbXt011, String.format("公告【%s】不存在", noticeNo));
AssertUtils.isNotEquals(dbXt011.getDeleteFlag(), CommonConstant.YesNo.NO_0,
String.format("公告【%s】不是\"未删除\"状态,不允许操作", noticeNo));
AssertUtils.isNotEquals(dbXt011.getStatus(), HGConstant.SubmitStatus.S0,
String.format("公告【%s】不是\"未提交\"状态,不允许操作", noticeNo));
}
}
<?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="HGXT011">
<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-是 -->
STATUS as "status", <!-- 维修状态 0-未处理 1-已维修 -->
COMPANY_CODE as "companyCode", <!-- 公司编码 -->
COMPANY_NAME as "companyName", <!-- 公司名称 -->
NOTICE_DATE as "noticeDate", <!-- 公告日期 -->
NOTICE_NO as "noticeNo", <!-- 公告号 -->
NOTICE_TYPE as "noticeType", <!-- 公告类型 -->
NOTICE_TITLE as "noticeTitle", <!-- 公告主题 -->
NOTICE_CONTENT as "noticeContent", <!-- 公告内容 -->
EXPIRE_DATE as "expireDate", <!-- 公告有效期 -->
SUBMIT_USER_ID as "submitUserId", <!-- 提交人ID -->
SUBMIT_USER_NAME as "submitUserName", <!-- 提交人名称 -->
SUBMIT_TIME as "submitTime" <!-- 提交时间 -->
</sql>
<sql id="condition">
AND DELETE_FLAG = 0
<include refid="idCondition"/>
<include refid="HGXSDataAuth.authCondition"/>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
CREATED_BY = #createdBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdName">
CREATED_NAME = #createdName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
CREATED_TIME = #createdTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy">
UPDATED_BY = #updatedBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedName">
UPDATED_NAME = #updatedName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime">
UPDATED_TIME = #updatedTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deleteFlag">
DELETE_FLAG = #deleteFlag#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="status">
STATUS = #status#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="noticeDate">
NOTICE_DATE = #noticeDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="noticeType">
NOTICE_TYPE = #noticeType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="noticeTitle">
NOTICE_TITLE = #noticeTitle#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="noticeContent">
NOTICE_CONTENT = #noticeContent#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="expireDate">
EXPIRE_DATE = #expireDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="submitUserId">
SUBMIT_USER_ID = #submitUserId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="submitUserName">
SUBMIT_USER_NAME LIKE CONCAT('%', #submitUserName#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="submitTime">
SUBMIT_TIME = #submitTime#
</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="noticeNo">
NOTICE_NO = #noticeNo#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="noticeNos">
NOTICE_NO IN <iterate close=")" open="(" conjunction="," property="noticeNos">#noticeNos[]#</iterate>
</isNotEmpty>
</sql>
<sql id="orderBy">
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
ID DESC
</isEmpty>
</dynamic>
</sql>
<select id="query" resultClass="com.baosight.hggp.hg.xt.domain.HGXT011">
SELECT
<include refid="column"/>
FROM ${hggpSchema}.HGXT011
WHERE 1=1
<include refid="condition"/>
<include refid="orderBy"/>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hggpSchema}.HGXT011 WHERE 1=1
<include refid="condition"/>
</select>
<insert id="insert">
INSERT INTO ${hggpSchema}.HGXT011 (
ACCOUNT_CODE, <!-- 企业编码 -->
DEP_CODE, <!-- 部门编码 -->
CREATED_BY, <!-- 创建人 -->
CREATED_NAME, <!-- 创建人名称 -->
CREATED_TIME, <!-- 创建时间 -->
UPDATED_BY, <!-- 修改人 -->
UPDATED_NAME, <!-- 修改人名称 -->
UPDATED_TIME, <!-- 修改时间 -->
DELETE_FLAG, <!-- 是否删除 0-否1-是 -->
STATUS, <!-- 维修状态 0-未处理 1-已维修 -->
COMPANY_CODE, <!-- 公司编码 -->
COMPANY_NAME, <!-- 公司名称 -->
NOTICE_DATE, <!-- 公告日期 -->
NOTICE_NO, <!-- 公告号 -->
NOTICE_TYPE, <!-- 公告类型 -->
NOTICE_TITLE, <!-- 公告主题 -->
NOTICE_CONTENT, <!-- 公告内容 -->
EXPIRE_DATE, <!-- 公告有效期 -->
SUBMIT_USER_ID, <!-- 提交人ID -->
SUBMIT_USER_NAME, <!-- 提交人名称 -->
SUBMIT_TIME <!-- 提交时间 -->
) VALUES (
#accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#,
#updatedName#, #updatedTime#, #deleteFlag#, #status#, #companyCode#, #companyName#,
#noticeDate#, #noticeNo#, #noticeType#, #noticeTitle#, #noticeContent#, #expireDate#,
#submitUserId#, #submitUserName#, #submitTime#)
</insert>
<delete id="delete">
UPDATE ${hggpSchema}.HGXT011 SET DELETE_FLAG = 1 WHERE NOTICE_NO = #noticeNo#
</delete>
<update id="update">
UPDATE ${hggpSchema}.HGXT011
SET
COMPANY_CODE = #companyCode#, <!-- 公司编码 -->
COMPANY_NAME = #companyName#, <!-- 公司名称 -->
NOTICE_DATE = #noticeDate#, <!-- 公告日期 -->
NOTICE_TYPE = #noticeType#, <!-- 公告类型 -->
NOTICE_TITLE = #noticeTitle#, <!-- 公告主题 -->
NOTICE_CONTENT = #noticeContent#, <!-- 公告内容 -->
EXPIRE_DATE = #expireDate#, <!-- 公告有效期 -->
<include refid="SqlBase.updateRevise"/>
WHERE ID = #id#
</update>
<!-- 行锁 -->
<update id="lock">
UPDATE ${hggpSchema}.HGXT011
SET CREATED_TIME = CREATED_TIME
WHERE 1=1
<include refid="idCondition"/>
</update>
<!-- 提交 -->
<update id="updateSubmit">
UPDATE ${hggpSchema}.HGXT011
SET
STATUS = #status#,
SUBMIT_USER_ID = #submitUserId#,
SUBMIT_USER_NAME = #submitUserName#,
SUBMIT_TIME = #submitTime#,
<include refid="SqlBase.updateRevise"/>
WHERE NOTICE_NO = #noticeNo#
</update>
</sqlMap>
package com.baosight.hggp.hg.xt.tools;
import com.baosight.hggp.core.dao.DaoBase;
import com.baosight.hggp.hg.xt.constant.HgXtSqlConst;
import com.baosight.hggp.hg.xt.domain.HGXT011;
import com.baosight.hggp.util.AssertUtils;
import org.apache.commons.collections.CollectionUtils;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* @author:songx
* @date:2024/9/24,18:08
*/
public class HgXtTools {
/**
* @author:songx
* @date:2024/9/24,18:08
*/
public static class HgXt011 {
/**
* 锁.
*
* @param noticeNo
*/
public static void lock(String noticeNo) {
AssertUtils.isEmpty(noticeNo, "公告号不能为空!");
Map<String, Object> paramMap = new HashMap<>();
paramMap.put(HGXT011.FIELD_NOTICE_NO, noticeNo);
DaoBase.getInstance().update(HgXtSqlConst.HgXt011.LOCK, paramMap);
}
/**
* 锁.
*
* @param noticeNos
*/
public static void lock(List<String> noticeNos) {
AssertUtils.isEmpty(noticeNos, "公告号不能为空!");
Map<String, Object> paramMap = new HashMap<>();
paramMap.put("noticeNos", noticeNos);
DaoBase.getInstance().update(HgXtSqlConst.HgXt011.LOCK, paramMap);
}
/**
* 查询
*
* @param noticeNo
* @return
*/
public static HGXT011 get(String noticeNo) {
AssertUtils.isEmpty(noticeNo, "公告号不能为空!");
Map<String, Object> paramMap = new HashMap();
paramMap.put(HGXT011.FIELD_NOTICE_NO, noticeNo);
List<HGXT011> results = DaoBase.getInstance().query(HGXT011.QUERY, paramMap);
return CollectionUtils.isEmpty(results) ? null : results.get(0);
}
/**
* 查询
*
* @param noticeNos
* @return
*/
public static List<HGXT011> list(List<String> noticeNos) {
AssertUtils.isEmpty(noticeNos, "售后服务单号不能为空");
Map<String, Object> paramMap = new HashMap();
paramMap.put("noticeNos", noticeNos);
return DaoBase.getInstance().query(HGXT011.QUERY, paramMap);
}
/**
* 查询
*
* @param noticeNos
* @return
*/
public static Map<String, HGXT011> map(List<String> noticeNos) {
List<HGXT011> results = list(noticeNos);
return results.stream().collect(Collectors.toMap(HGXT011::getNoticeNo, item -> item));
}
}
}
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