Commit 4ba4233d by liuyang

Merge branch 'dev' of http://git.pseer.com:8800/platform/hg-smart into dev-ly

parents 0149540c 109d1516
......@@ -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"),
;
......
......@@ -49,6 +49,11 @@ public class HGConstant {
public static final String HPKC008_NUMBER = "HPKC008_NUMBER";
// 巡检单号
public static final String HPZL001_NUMBER = "HPZL001_NUMBER";
// 巡检单号
public static final String SCLL_QUALITY_NO = "SCLL_QUALITY_NO";
// 委外入库质检单
public static final String WWRK_QUALITY_NO = "WWRK_QUALITY_NO";
//采购入库单号
public static final String HPKC001_NUMBER = "HPKC001_NUMBER";
// 生产领料单号
......@@ -138,10 +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";
// 委外单号
public static final String CONTRACT_CODE = "CONTRACT_CODE";
......@@ -434,4 +453,32 @@ public class HGConstant {
public static final Integer S_2 = 2;
}
/**
* 处理状态
*
* @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;
}
}
......@@ -320,18 +320,6 @@ public class HGSqlConstant {
}
/**
* HGKC008 SQL 定义
*
* @author:songx
* @date:2024/1/20,16:45
*/
public class HGKC008 {
// 查询
public static final String QUERY_SUM = "HGKC008.querySum";
}
/**
* HGKC002 SQL 定义
*
* @author:songx
......
package com.baosight.hggp.hg.dm.service;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.constant.S3Constant;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.utils.Iplat4jUtils;
import com.baosight.hggp.hg.dm.domain.HGDM099;
import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.MapUtils;
import com.baosight.iplat4j.core.ei.EiConstant;
......@@ -62,6 +62,9 @@ public class ServiceHGDM099 extends ServiceEPBase {
public EiInfo upload(EiInfo inInfo) {
try {
HGDM099 fDm099 = MapUtils.toDaoEPBase(inInfo, HGDM099.class);
AssertUtils.isEmpty(fDm099.getBizId(), "业务ID不能为空");
AssertUtils.isEmpty(fDm099.getBizType(), "业务类型不能为空");
AssertUtils.isEmpty(fDm099.getDocId(), "文件ID不能为空");
fDm099.setDeleteFlag(CommonConstant.YesNo.NO_0);
DaoUtils.insert(HGDM099.INSERT, fDm099);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
......
package com.baosight.hggp.hg.dm.utils;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.utils.Iplat4jUtils;
import com.baosight.hggp.hg.dm.domain.HGDM099;
import com.baosight.hggp.util.MapUtils;
import com.baosight.iplat4j.core.ei.EiInfo;
import java.util.List;
/**
* @author:songx
* @date:2024/9/29,14:21
*/
public class HgDmUtils {
/**
* HGDM099 定义
*
* @author:songx
* @date:2024/9/29,14:21
*/
public static class HgDm099 {
/**
* 删除附件
*
* @param inInfo
*/
public static int delete(EiInfo inInfo) {
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());
}
}
return fDm099s.size();
}
}
}
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);
}
}
}
package com.baosight.hggp.hg.kc.constant;
/**
* @author:songx
* @date:2024/9/29,10:01
*/
public class HgKcConst {
/**
* HGKC008 定义
*
* @author:songx
* @date:2024/1/20,16:45
*/
public static class HgKc008 {
/**
* 提交状态
*
* @author:songx
* @date:2024/5/15,15:18
*/
public static class Status {
// 未提交
public static final Integer S0 = 0;
// 已提交
public static final Integer S1 = 1;
// 质检中
public static final Integer S2 = 2;
// 已出库
public static final Integer S3 = 3;
}
}
/**
* HGKC014 定义
*
* @author:songx
* @date:2024/1/20,16:45
*/
public static class HgKc014 {
/**
* 提交状态
*
* @author:songx
* @date:2024/5/15,15:18
*/
public static class Status {
// 未提交
public static final Integer S0 = 0;
// 已提交
public static final Integer S1 = 1;
// 质检中
public static final Integer S2 = 2;
// 已入库
public static final Integer S3 = 3;
}
}
}
package com.baosight.hggp.hg.kc.constant;
/**
* @author:songx
* @date:2024/9/29,9:54
*/
public class HgKcSqlConst {
/**
* HGKC008 SQL 定义
*
* @author:songx
* @date:2024/1/20,16:45
*/
public class HgKc008 {
// 锁
public static final String LOCK = "HGKC008.lock";
// 修改状态
public static final String UPDATE_STATUS = "HGKC008.updateStatus";
// 查询
public static final String QUERY_SUM = "HGKC008.querySum";
// 修改
public static final String UPDATE_RECEIVE_TYPE = "HGKC008.updateReceiveType";
}
/**
* HGKC008A SQL 定义
*
* @author:songx
* @date:2024/1/20,16:45
*/
public class HgKc008A {
// 锁
public static final String LOCK = "HGKC008A.lock";
// 修改状态
public static final String UPDATE_STATUS = "HGKC008A.updateStatus";
// 质检查询
public static final String QUERY_QC = "HGKC008A.queryQc";
// 批量删除
public static final String BATCH_DELETE = "HGKC008A.batchDelete";
}
/**
* HGKC014 SQL 定义
*
* @author:songx
* @date:2024/1/20,16:45
*/
public class HgKc014 {
// 锁
public static final String LOCK = "HGKC014.lock";
// 修改状态
public static final String UPDATE_STATUS = "HGKC014.updateStatus";
// 修改
public static final String UPDATE_RECEIVE_TYPE = "HGKC014.updateReceiveType";
}
/**
* HGKC014A SQL 定义
*
* @author:songx
* @date:2024/1/20,16:45
*/
public class HgKc014A {
// 锁
public static final String LOCK = "HGKC014A.lock";
// 修改状态
public static final String UPDATE_STATUS = "HGKC014A.updateStatus";
// 修改状态
public static final String UPDATE_STATUS_BY_PARENT = "HGKC014A.updateStatusByParent";
// 批量删除
public static final String BATCH_DELETE = "HGKC014A.batchDelete";
// 实际入库数量
public static final String UPDATE_ACTUAL_QTY = "HGKC014A.updateActualQty";
}
}
......@@ -75,7 +75,6 @@ public class HGKC008 extends DaoEPBase {
public static final String DELETE = "HGKC008.delete";
public static final String BATCH_DELETE = "HGKC008.batchDelete";;
public static final String UPDATE_STATUS = "HGKC008.updateStatus";;
public static final String UPDATE_RECEIVE_TYPE = "HGKC008.updateReceiveType";;
private Long id = new Long(0); /* 主键id*/
private String accountCode = " "; /* 账套*/
......
package com.baosight.hggp.hg.kc.domain;
import com.baosight.hggp.util.DateUtils;
import com.baosight.iplat4j.core.util.NumberUtils;
import com.baosight.iplat4j.core.ei.EiColumn;
import com.baosight.iplat4j.core.data.DaoEPBase;
import com.baosight.iplat4j.core.ei.EiColumn;
import com.baosight.iplat4j.core.util.NumberUtils;
import com.baosight.iplat4j.core.util.StringUtils;
import java.util.HashMap;
import java.util.Map;
import com.baosight.iplat4j.core.util.StringUtils;
/**
* Project: <br>
......@@ -16,7 +16,7 @@ import com.baosight.iplat4j.core.util.StringUtils;
* Copyrigth:Baosight Software LTD.co Copyright (c) 2019. <br>
*
* @version 1.0
* @history 2024-09-29 14:12:44 create
* @history 2024-09-30 13:25:30 create
*/
public class HGKC014 extends DaoEPBase {
......@@ -482,7 +482,7 @@ public class HGKC014 extends DaoEPBase {
setDeleteFlag(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_DELETE_FLAG)), deleteFlag));
setCompanyCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_COMPANY_CODE)), companyCode));
setCompanyName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_COMPANY_NAME)), companyName));
setDepositDate(StringUtils.defaultIfEmpty(StringUtils.toString(DateUtils.formatShort(map.get(FIELD_DEPOSIT_DATE))), depositDate));
setDepositDate(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DEPOSIT_DATE)), depositDate));
setDepositCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DEPOSIT_CODE)), depositCode));
setWhCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_WH_CODE)), whCode));
setWhName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_WH_NAME)), whName));
......
package com.baosight.hggp.hg.kc.domain;
import com.baosight.iplat4j.core.data.DaoEPBase;
import com.baosight.iplat4j.core.ei.EiColumn;
import com.baosight.iplat4j.core.util.NumberUtils;
import com.baosight.iplat4j.core.util.StringUtils;
import java.math.BigDecimal;
import com.baosight.iplat4j.core.ei.EiColumn;
import com.baosight.iplat4j.core.data.DaoEPBase;
import java.util.HashMap;
import java.util.Map;
import com.baosight.iplat4j.core.util.StringUtils;
/**
* Project: <br>
......@@ -16,7 +17,7 @@ import com.baosight.iplat4j.core.util.StringUtils;
* Copyrigth:Baosight Software LTD.co Copyright (c) 2019. <br>
*
* @version 1.0
* @history 2024-09-29 14:12:44 create
* @history 2024-09-30 13:25:33 create
*/
public class HGKC014A extends DaoEPBase {
......@@ -32,6 +33,7 @@ public class HGKC014A extends DaoEPBase {
public static final String FIELD_UPDATED_NAME = "updatedName"; /* 修改人名称*/
public static final String FIELD_UPDATED_TIME = "updatedTime"; /* 修改时间*/
public static final String FIELD_DELETE_FLAG = "deleteFlag"; /* 是否删除 0-否1-是*/
public static final String FIELD_STATUS = "status"; /* 状态*/
public static final String FIELD_COMPANY_CODE = "companyCode"; /* 公司编码*/
public static final String FIELD_COMPANY_NAME = "companyName"; /* 公司名称*/
public static final String FIELD_WH_CODE = "whCode"; /* 仓库编码*/
......@@ -62,6 +64,7 @@ public class HGKC014A extends DaoEPBase {
public static final String COL_UPDATED_NAME = "UPDATED_NAME"; /* 修改人名称*/
public static final String COL_UPDATED_TIME = "UPDATED_TIME"; /* 修改时间*/
public static final String COL_DELETE_FLAG = "DELETE_FLAG"; /* 是否删除 0-否1-是*/
public static final String COL_STATUS = "STATUS"; /* 状态*/
public static final String COL_COMPANY_CODE = "COMPANY_CODE"; /* 公司编码*/
public static final String COL_COMPANY_NAME = "COMPANY_NAME"; /* 公司名称*/
public static final String COL_PARENT_ID = "PARENT_ID"; /* 委托ID*/
......@@ -89,7 +92,8 @@ public class HGKC014A extends DaoEPBase {
private String updatedBy = " "; /* 修改人*/
private String updatedName = " "; /* 修改人名称*/
private String updatedTime = " "; /* 修改时间*/
private Integer deleteFlag = 0; /* 是否删除 0-否1-是*/
private Integer deleteFlag = new Integer(0); /* 是否删除 0-否1-是*/
private Integer status = new Integer(0); /* 状态*/
private String companyCode = " "; /* 公司编码*/
private String companyName = " "; /* 公司名称*/
private String whCode = " "; /* 仓库编码*/
......@@ -157,6 +161,10 @@ public class HGKC014A extends DaoEPBase {
eiColumn.setDescName("是否删除 0-否1-是");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_STATUS);
eiColumn.setDescName("状态");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_COMPANY_CODE);
eiColumn.setDescName("公司编码");
eiMetadata.addMeta(eiColumn);
......@@ -649,6 +657,15 @@ public class HGKC014A extends DaoEPBase {
this.actualQty = actualQty;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public Long getPcsId() {
return pcsId;
}
......@@ -693,6 +710,7 @@ public class HGKC014A extends DaoEPBase {
setDepositWeight(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_DEPOSIT_WEIGHT)), depositWeight));
setDeliverQty(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_DELIVER_QTY)), deliverQty));
setActualQty(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_ACTUAL_QTY)), actualQty));
setStatus(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_STATUS)), status));
setPcsId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_PCS_ID)), pcsId));
}
......@@ -731,6 +749,7 @@ public class HGKC014A extends DaoEPBase {
map.put(FIELD_DEPOSIT_WEIGHT, StringUtils.toString(depositWeight, eiMetadata.getMeta(FIELD_DEPOSIT_WEIGHT)));
map.put(FIELD_DELIVER_QTY, StringUtils.toString(deliverQty, eiMetadata.getMeta(FIELD_DELIVER_QTY)));
map.put(FIELD_ACTUAL_QTY, StringUtils.toString(actualQty, eiMetadata.getMeta(FIELD_ACTUAL_QTY)));
map.put(FIELD_STATUS, StringUtils.toString(status, eiMetadata.getMeta(FIELD_STATUS)));
map.put(FIELD_PCS_ID, StringUtils.toString(pcsId, eiMetadata.getMeta(FIELD_PCS_ID)));
return map;
......
......@@ -6,6 +6,7 @@ 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.cw.tools.HGCWTools;
import com.baosight.hggp.hg.kc.constant.HgKcConst;
import com.baosight.hggp.hg.kc.domain.HGKC008;
import com.baosight.hggp.hg.kc.domain.HGKC008A;
import com.baosight.hggp.hg.kc.tools.HGKCTools;
......@@ -117,7 +118,7 @@ public class ServiceHGKC008 extends ServiceBase {
HGKCTools.HgKc008A.updateWhCodeByReceiveId(fKc008);
} else {
//生成生产领料编号
fKc008.setApplyCode(SequenceGenerator.getNextSequence(HGConstant.SequenceId.RECEIVE_CODE));
fKc008.setApplyCode(SequenceGenerator.getNextSequence(HGConstant.SequenceId.SC_APPLY_CODE));
fKc008.setStatus(HGConstant.ProductStatus.WTJ);
DaoUtils.insert(HGKC008.INSERT, fKc008);
}
......@@ -196,15 +197,16 @@ public class ServiceHGKC008 extends ServiceBase {
}
List<HGKC008A> hgkc008AList = HGKCTools.HgKc008A.getHgkc008aList(hgkc008.getId());
if(!CollectionUtils.isEmpty(hgkc008AList)){
for(HGKC008A hgkc008A : hgkc008AList){
for (HGKC008A hgkc008A : hgkc008AList) {
// 更新明细状态
HGKCTools.HgKc008A.updateStatus(hgkc008A.getApplyLineCode(), HgKcConst.HgKc008.Status.S1);
//领料如果是正数则为出库,需要减少库存,如果是退回则要加库存
BigDecimal qty = hgkc008A.getInvQty().multiply(new BigDecimal(-1));
BigDecimal invUnitWeight = hgkc008A.getInvUnitWeight().multiply(new BigDecimal(-1));
BigDecimal invWeight = hgkc008A.getInvWeight().multiply(new BigDecimal(-1));
//增加库存
HGKCUtils.HgKc010.updateInv(hgkc008A.getCompanyCode(),hgkc008A.getWhCode(),
hgkc008A.getInventCode(),qty,
invUnitWeight,invWeight);
HGKCUtils.HgKc010.updateInv(hgkc008A.getCompanyCode(), hgkc008A.getWhCode(),
hgkc008A.getInventCode(), qty, invUnitWeight, invWeight);
}
}
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
......
......@@ -24,6 +24,7 @@ import com.baosight.hggp.util.contants.ACConstants;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.service.impl.ServiceBase;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import java.math.BigDecimal;
import java.util.Arrays;
......@@ -123,6 +124,9 @@ public class ServiceHGKC008B extends ServiceBase {
Long id = fKc010B.getId();
HGKC010 dbKc010 = dbKc010Map.get(id);
HGKC008A newKc008A = BeanUtils.copy(dbKc010, HGKC008A.class);
newKc008A.setApplyCode(dbKc008.getApplyCode());
newKc008A.setApplyLineCode(SequenceGenerator.getNextSequence(HGConstant.SequenceId.SC_APPLY_LINE_CODE,
new String[]{dbKc008.getApplyCode()}));
newKc008A.setProjCode(dbKc008.getProjCode());
newKc008A.setProjName(dbKc008.getProjName());
newKc008A.setCompanyCode(dbKc008.getCompanyCode());
......
......@@ -6,6 +6,7 @@ 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.kc.constant.HgKcConst;
import com.baosight.hggp.hg.kc.constant.HgKcSqlConstant;
import com.baosight.hggp.hg.kc.domain.HGKC014;
import com.baosight.hggp.hg.kc.domain.HGKC014A;
......@@ -13,8 +14,13 @@ import com.baosight.hggp.hg.kc.tools.HGKCTools;
import com.baosight.hggp.hg.sc.domain.HGSC010A;
import com.baosight.hggp.hg.sc.tools.HGSCTools;
import com.baosight.hggp.hg.xs.domain.Company;
import com.baosight.hggp.util.*;
import com.baosight.iplat4j.core.ei.EiBlock;
import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.EiInfoUtils;
import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.MapUtils;
import com.baosight.hggp.util.ObjectUtils;
import com.baosight.hggp.util.StringUtil;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException;
......@@ -23,7 +29,10 @@ import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import org.apache.commons.lang.StringUtils;
import java.util.*;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.stream.Collectors;
/**
......@@ -73,14 +82,14 @@ public class ServiceHGKC014 extends ServiceEPBase {
try {
List<HGKC014> hgkc014List = MapUtils.toDaoEPBases(inInfo, HGKC014.class);
List<Long> ids = ObjectUtils.listEpKey(hgkc014List, HGKC014.FIELD_ID);
List<HGKC014A> hgkc014As = HGKCTools.HgKc014a.getByParentId(ids);
List<HGKC014A> hgkc014As = HGKCTools.HgKc014A.getByParentId(ids);
List<String> contractCodes = ObjectUtils.listEpKey(hgkc014As, HGKC014A.FIELD_CONTRACT_CODE);
List<HGSC010A> hgsc010As = HGSCTools.Hgsc010a.getByContractCode(contractCodes);
for (HGKC014 hgkc014: hgkc014List) {
AssertUtils.isTrue(hgkc014.getStatus().equals(CommonConstant.YesNo.YES_1), "当前委外任务已提交,不允许删除!");
if (Objects.nonNull(hgkc014As)){
List<HGKC014A> hgkc014AList = hgkc014As.stream().filter(hgkc014A -> hgkc014A.getParentId().equals(hgkc014.getId())).collect(Collectors.toList());
HGKCTools.HgKc014a.deleteByParentId(hgkc014AList, hgsc010As);
HGKCTools.HgKc014A.deleteByParentId(hgkc014AList, hgsc010As);
}
DaoUtils.update(HGKC014.DELETE, hgkc014);
}
......@@ -173,14 +182,16 @@ public class ServiceHGKC014 extends ServiceEPBase {
try {
List<HGKC014> resultMaps = MapUtils.toDaoEPBases(inInfo, HGKC014.class);
List<Long> ids = ObjectUtils.listEpKey(resultMaps, HGKC014.FIELD_ID);
List<HGKC014A> hgkc014AList = HGKCTools.HgKc014a.getByParentId(ids);
List<HGKC014A> hgkc014AList = HGKCTools.HgKc014A.getByParentId(ids);
AssertUtils.isTrue(Objects.isNull(hgkc014AList), "请先添加入库明细");
for (HGKC014 hgkc014: resultMaps) {
List<HGKC014A> hgkc14As = hgkc014AList.stream().filter(item -> item.getParentId().equals(hgkc014.getId())).collect(Collectors.toList());
AssertUtils.isTrue(hgkc14As.size()<= 0, "请先添加入库明细");
hgkc014.setStatus(CommonConstant.YesNo.YES_1);
for (HGKC014 hgkc014 : resultMaps) {
List<HGKC014A> hgkc14As = hgkc014AList.stream()
.filter(item -> item.getParentId().equals(hgkc014.getId())).collect(Collectors.toList());
AssertUtils.isTrue(hgkc14As.size() <= 0, "请先添加入库明细");
hgkc014.setStatus(HgKcConst.HgKc014.Status.S1);
DaoUtils.update(HgKcSqlConstant.HgKc014.UPDATE_STATUS, hgkc014);
// 更新明细状态
HGKCTools.HgKc014A.updateStatusByParent(hgkc014.getId(), HgKcConst.HgKc014.Status.S1);
}
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsgByKey("ep.1000", new String[]{String.valueOf(resultMaps.size()), I18nMessages.getText("label.update", "提交")});
......
......@@ -116,7 +116,7 @@ public class ServiceHGKC014A extends ServiceEPBase {
List<String> contractCodes = ObjectUtils.listEpKey(hgkc014List, HGKC014A.FIELD_CONTRACT_CODE);
List<HGSC010A> hgsc010As = HGSCTools.Hgsc010a.getByContractCode(contractCodes);
HGKCTools.HgKc014a.deleteByParentId(hgkc014List, hgsc010As);
HGKCTools.HgKc014A.deleteByParentId(hgkc014List, hgsc010As);
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsgByKey("ep.1000", new String[]{String.valueOf(i), I18nMessages.getText("label.delete", "删除")});
......
......@@ -74,7 +74,7 @@ public class ServiceHGKC014B extends ServiceEPBase {
Map paramMap = EiInfoUtils.getFirstRow(inInfo);
List<Map> resultMaps = inInfo.getBlock(EiConstant.resultBlock).getRows();
//List<String> contractCodes = ObjectUtils.listKey(resultMaps, HGKC014A.FIELD_CONTRACT_CODE);
List<HGKC014A> hgkc014AList = HGKCTools.HgKc014a.getByParentId((Arrays.asList(Long.parseLong(paramMap.get("parentId").toString()))));
List<HGKC014A> hgkc014AList = HGKCTools.HgKc014A.getByParentId((Arrays.asList(Long.parseLong(paramMap.get("parentId").toString()))));
for (Map resultMap: resultMaps) {
HGSC010A hgsc010a = new HGSC010A();
hgsc010a.fromMap(resultMap);
......
......@@ -28,10 +28,8 @@
</sql>
<sql id="condition">
<include refid="idCondition"/>
<include refid="HGXSDataAuth.authCondition"/>
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="accountCode">
ACCOUNT_CODE = #accountCode#
</isNotEmpty>
......@@ -68,9 +66,6 @@
<isNotEmpty prepend=" AND " property="receiptDate">
date_format(RECEIPT_DATE,'%Y-%m-%d') = #receiptDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="applyCode">
APPLY_CODE like CONCAT('%',#applyCode#,'%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="whCode">
WH_CODE = #whCode#
</isNotEmpty>
......@@ -101,6 +96,21 @@
</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="applyCode">
APPLY_CODE = #applyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="applyCodes">
APPLY_CODE IN <iterate close=")" open="(" conjunction="," property="applyCodes">#applyCodes[]#</iterate>
</isNotEmpty>
</sql>
<sql id="orderBy">
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
......@@ -180,21 +190,9 @@
<delete id="batchDelete">
DELETE FROM ${hggpSchema}.HGKC008 WHERE
id IN
<iterate close=")" open="(" conjunction="," property="ids">#ids[]#</iterate>
id IN <iterate close=")" open="(" conjunction="," property="ids">#ids[]#</iterate>
</delete>
<update id="updateStatus">
UPDATE ${hggpSchema}.HGKC008
SET
UPDATED_BY = #updatedBy#, <!-- 更新人 -->
UPDATED_NAME = #updatedName#, <!-- 更新人名称 -->
UPDATED_TIME = #updatedTime#, <!-- 更新时间 -->
STATUS = #status# <!-- 状态 0未提交,1已提交 -->
WHERE
ID = #id#
</update>
<update id="updateReceiveType">
UPDATE ${hggpSchema}.HGKC008
SET
......@@ -257,4 +255,22 @@
</dynamic>
</select>
<!-- 行锁 -->
<update id="lock">
UPDATE ${hggpSchema}.HGKC008
SET CREATED_TIME = CREATED_TIME
WHERE 1=1
<include refid="idCondition"/>
</update>
<!-- 修改状态 -->
<update id="updateStatus">
UPDATE ${hggpSchema}.HGKC008
SET
STATUS = #status#,
<include refid="SqlBase.updateRevise"/>
WHERE 1=1
<include refid="idCondition"/>
</update>
</sqlMap>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN" "http://ibatis.apache.org/dtd/sql-map-2.dtd"> <!-- table information
Generate time : 2024-09-29 14:12:44
Version : 1.0
schema : hggp
tableName : HGKC014
ID BIGINT NOT NULL primarykey,
ACCOUNT_CODE VARCHAR,
DEP_CODE VARCHAR,
CREATED_BY VARCHAR,
CREATED_NAME VARCHAR,
CREATED_TIME VARCHAR,
UPDATED_BY VARCHAR,
UPDATED_NAME VARCHAR,
UPDATED_TIME VARCHAR,
DELETE_FLAG TINYINT,
COMPANY_CODE VARCHAR,
COMPANY_NAME VARCHAR,
DEPOSIT_DATE VARCHAR,
DEPOSIT_CODE VARCHAR,
WH_CODE VARCHAR,
WH_NAME VARCHAR,
USER_ID VARCHAR,
STATUS TINYINT
-->
<!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://www.ibatis.com/dtd/sql-map-2.dtd">
<sqlMap namespace="HGKC014">
<sql id="condition">
<include refid="idCondition"/>
<include refid="HGXSDataAuth.authCondition"/>
<isNotEmpty prepend=" AND " property="id">
ID = #id#
......@@ -66,9 +44,6 @@
<isNotEmpty prepend=" AND " property="depositDate">
DEPOSIT_DATE = #depositDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depositCode">
DEPOSIT_CODE LIKE CONCAT('%',#depositCode#,'%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="whCode">
WH_CODE = #whCode#
</isNotEmpty>
......@@ -81,13 +56,24 @@
<isNotEmpty prepend=" AND " property="status">
STATUS = #status#
</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="depositCode">
DEPOSIT_CODE = #depositCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depositCodes">
DEPOSIT_CODE IN <iterate close=")" open="(" conjunction="," property="depositCodes">#depositCodes[]#</iterate>
</isNotEmpty>
</sql>
<select id="query" parameterClass="java.util.HashMap"
resultClass="com.baosight.hggp.hg.kc.domain.HGKC014">
<select id="query" resultClass="com.baosight.hggp.hg.kc.domain.HGKC014">
SELECT
ID as "id", <!-- ID -->
ACCOUNT_CODE as "accountCode", <!-- 账套 -->
......@@ -125,63 +111,6 @@
<include refid="condition" />
</select>
<!--
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="accountCode">
ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
CREATED_BY = #createdBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdName">
CREATED_NAME = #createdName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
CREATED_TIME = #createdTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy">
UPDATED_BY = #updatedBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedName">
UPDATED_NAME = #updatedName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime">
UPDATED_TIME = #updatedTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deleteFlag">
DELETE_FLAG = #deleteFlag#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyName">
COMPANY_NAME = #companyName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depositDate">
DEPOSIT_DATE = #depositDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depositCode">
DEPOSIT_CODE = #depositCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="whCode">
WH_CODE = #whCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="whName">
WH_NAME = #whName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="userId">
USER_ID = #userId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="status">
STATUS = #status#
</isNotEmpty>
-->
<insert id="insert">
INSERT INTO ${hggpSchema}.HGKC014 (ID, <!-- ID -->
ACCOUNT_CODE, <!-- 账套 -->
......@@ -251,4 +180,22 @@
ID = #id#
</update>
<!-- 行锁 -->
<update id="lock">
UPDATE ${hggpSchema}.HGKC014
SET CREATED_TIME = CREATED_TIME
WHERE 1=1
<include refid="idCondition"/>
</update>
<!-- 修改状态 -->
<update id="updateStatus">
UPDATE ${hggpSchema}.HGKC014
SET
STATUS = #status#,
<include refid="SqlBase.updateRevise"/>
WHERE 1=1
<include refid="idCondition"/>
</update>
</sqlMap>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN" "http://ibatis.apache.org/dtd/sql-map-2.dtd"> <!-- table information
Generate time : 2024-09-29 14:12:44
Version : 1.0
schema : hggp
tableName : HGKC014A
ID BIGINT NOT NULL primarykey,
ACCOUNT_CODE VARCHAR,
DEP_CODE VARCHAR,
CREATED_BY VARCHAR,
CREATED_NAME VARCHAR,
CREATED_TIME VARCHAR,
UPDATED_BY VARCHAR,
UPDATED_NAME VARCHAR,
UPDATED_TIME VARCHAR,
DELETE_FLAG TINYINT,
COMPANY_CODE VARCHAR,
COMPANY_NAME VARCHAR,
PARENT_ID BIGINT NOT NULL,
CONTRACT_CODE VARCHAR,
INVENT_TYPE TINYINT,
PRODUCT_CODE VARCHAR,
PRODUCT_NAME VARCHAR,
SPEC VARCHAR,
UNIT VARCHAR,
DEPOSIT_QTY DECIMAL,
DEPOSIT_WEIGHT DECIMAL
-->
<!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://www.ibatis.com/dtd/sql-map-2.dtd">
<sqlMap namespace="HGKC014A">
<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", <!-- 状态 -->
COMPANY_CODE as "companyCode", <!-- 公司编码 -->
COMPANY_NAME as "companyName", <!-- 公司名称 -->
WH_CODE as "whCode", <!-- 仓库编码 -->
WH_NAME as "whName", <!-- 仓库名称 -->
PARENT_ID as "parentId", <!-- 委托ID -->
CONTRACT_CODE as "contractCode", <!-- 委托单号 -->
DEPOSIT_CODE as "depositCode", <!-- 委托入库单号 -->
INVENT_TYPE as "inventType", <!-- 存货类型 -->
PRODUCT_CODE as "productCode", <!-- 成品编码 -->
PRODUCT_NAME as "productName", <!-- 成品名称 -->
SPEC_ID as "specId",
SPEC as "spec", <!-- 规格 -->
UNIT as "unit", <!-- 单位 -->
DEPOSIT_QTY as "depositQty", <!-- 入库数量 -->
DEPOSIT_UNIT_WEIGHT as "depositUnitWeight", <!-- 入库单重 -->
DEPOSIT_WEIGHT as "depositWeight", <!-- 入库重量 -->
DELIVER_QTY as "deliverQty",
ACTUAL_QTY as "actualQty",
PCS_ID as "pcsId"
</sql>
<sql id="condition">
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<include refid="idCondition"/>
<isNotEmpty prepend=" AND " property="accountCode">
ACCOUNT_CODE = #accountCode#
</isNotEmpty>
......@@ -59,6 +64,9 @@
<isNotEmpty prepend=" AND " property="deleteFlag">
DELETE_FLAG = #deleteFlag#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="status">
STATUS = #status#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
......@@ -87,7 +95,7 @@
PRODUCT_CODE = #productCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="productName">
PRODUCT_NAME = #productName#
PRODUCT_NAME LIKE CONCAT('%', #productName#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="specId">
SPEC_ID = #specId#
......@@ -115,38 +123,18 @@
</isNotEmpty>
</sql>
<select id="query" parameterClass="java.util.HashMap"
resultClass="com.baosight.hggp.hg.kc.domain.HGKC014A">
<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>
</sql>
<select id="query" resultClass="com.baosight.hggp.hg.kc.domain.HGKC014A">
SELECT
ID as "id", <!-- ID -->
ACCOUNT_CODE as "accountCode", <!-- 账套 -->
DEP_CODE as "depCode", <!-- 部门编码 -->
CREATED_BY as "createdBy", <!-- 创建人 -->
CREATED_NAME as "createdName", <!-- 创建人名称 -->
CREATED_TIME as "createdTime", <!-- 创建时间 -->
UPDATED_BY as "updatedBy", <!-- 修改人 -->
UPDATED_NAME as "updatedName", <!-- 修改人名称 -->
UPDATED_TIME as "updatedTime", <!-- 修改时间 -->
DELETE_FLAG as "deleteFlag", <!-- 是否删除 0-否1-是 -->
COMPANY_CODE as "companyCode", <!-- 公司编码 -->
COMPANY_NAME as "companyName", <!-- 公司名称 -->
WH_CODE as "whCode", <!-- 仓库编码 -->
WH_NAME as "whName", <!-- 仓库名称 -->
PARENT_ID as "parentId", <!-- 委托ID -->
CONTRACT_CODE as "contractCode", <!-- 委托单号 -->
DEPOSIT_CODE as "depositCode", <!-- 委托入库单号 -->
INVENT_TYPE as "inventType", <!-- 存货类型 -->
PRODUCT_CODE as "productCode", <!-- 成品编码 -->
PRODUCT_NAME as "productName", <!-- 成品名称 -->
SPEC_ID as "specId",
SPEC as "spec", <!-- 规格 -->
UNIT as "unit", <!-- 单位 -->
DEPOSIT_QTY as "depositQty", <!-- 入库数量 -->
DEPOSIT_UNIT_WEIGHT as "depositUnitWeight", <!-- 入库单重 -->
DEPOSIT_WEIGHT as "depositWeight", <!-- 入库重量 -->
DELIVER_QTY as "deliverQty",
ACTUAL_QTY as "actualQty",
PCS_ID as "pcsId"
<include refid="column"/>
FROM ${hggpSchema}.HGKC014A WHERE 1=1
<include refid="condition" />
<dynamic prepend="ORDER BY">
......@@ -165,72 +153,6 @@
<include refid="condition" />
</select>
<!--
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="accountCode">
ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
CREATED_BY = #createdBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdName">
CREATED_NAME = #createdName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
CREATED_TIME = #createdTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy">
UPDATED_BY = #updatedBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedName">
UPDATED_NAME = #updatedName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime">
UPDATED_TIME = #updatedTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deleteFlag">
DELETE_FLAG = #deleteFlag#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyName">
COMPANY_NAME = #companyName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="parentId">
PARENT_ID = #parentId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="contractCode">
CONTRACT_CODE = #contractCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventType">
INVENT_TYPE = #inventType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="productCode">
PRODUCT_CODE = #productCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="productName">
PRODUCT_NAME = #productName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="spec">
SPEC = #spec#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="unit">
UNIT = #unit#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depositQty">
DEPOSIT_QTY = #depositQty#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depositWeight">
DEPOSIT_WEIGHT = #depositWeight#
</isNotEmpty>
-->
<insert id="insert">
INSERT INTO ${hggpSchema}.HGKC014A (ID, <!-- ID -->
ACCOUNT_CODE, <!-- 账套 -->
......@@ -242,6 +164,7 @@
UPDATED_NAME, <!-- 修改人名称 -->
UPDATED_TIME, <!-- 修改时间 -->
DELETE_FLAG, <!-- 是否删除 0-否1-是 -->
STATUS,
COMPANY_CODE, <!-- 公司编码 -->
COMPANY_NAME, <!-- 公司名称 -->
WH_CODE, <!-- 公司编码 -->
......@@ -263,7 +186,7 @@
PCS_ID
)
VALUES (#id#, #accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#,
#updatedTime#, #deleteFlag#, #companyCode#, #companyName#, #whCode#, #whName#, #parentId#, #contractCode#,
#updatedTime#, #deleteFlag#, #status#, #companyCode#, #companyName#, #whCode#, #whName#, #parentId#, #contractCode#,
#depositCode#,#inventType#, #productCode#, #productName#, #specId#, #spec#, #unit#, #depositQty#, #depositUnitWeight#, #depositWeight#,
#deliverQty#, #actualQty#, #pcsId#)
</insert>
......@@ -309,4 +232,42 @@
ID = #id#
</update>
<!-- 行锁 -->
<update id="lock">
UPDATE ${hggpSchema}.HGKC014A
SET CREATED_TIME = CREATED_TIME
WHERE 1=1
<include refid="idCondition"/>
</update>
<!-- 修改状态 -->
<update id="updateStatus">
UPDATE ${hggpSchema}.HGKC014A
SET
STATUS = #status#,
<include refid="SqlBase.updateRevise"/>
WHERE 1=1
<include refid="idCondition"/>
</update>
<!-- 修改状态 -->
<update id="updateStatusByParent">
UPDATE ${hggpSchema}.HGKC014A
SET
STATUS = #status#,
<include refid="SqlBase.updateRevise"/>
WHERE PARENT_ID = #parentId#
</update>
<!-- 实际入库数量 -->
<update id="updateActualQty">
UPDATE ${hggpSchema}.HGKC014A
SET
STATUS = #status#,
ACTUAL_QTY = #actualQty#,
DELIVER_QTY = #deliverQty#,
<include refid="SqlBase.updateRevise"/>
WHERE ID = #id#
</update>
</sqlMap>
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