Commit 31519291 by liuyang

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

parents fad58195 e6d85e06
package com.baosight.hpjx.hp.cg.service;
import com.baosight.hpjx.aspect.annotation.OperationLogAnnotation;
import com.baosight.hpjx.common.DdynamicEnum;
import com.baosight.hpjx.core.constant.CommonConstant;
import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.hp.cg.domain.HPCG004;
import com.baosight.hpjx.hp.constant.HPConstant;
import com.baosight.hpjx.util.CommonMethod;
import com.baosight.hpjx.util.ErrorCodeUtils;
import com.baosight.hpjx.util.LogUtils;
import com.baosight.hpjx.util.StringUtil;
import com.baosight.hpjx.util.contants.ACConstants;
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.exception.PlatException;
import com.baosight.iplat4j.core.resource.I18nMessages;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
*
*/
public class ServiceHPCG004 extends ServiceEPBase {
@Override
public EiInfo initLoad(EiInfo inInfo) {
try {
CommonMethod.initBlock(inInfo, Arrays.asList(
DdynamicEnum.SUPPLIER_RECORD_BLOCK_ID), null, false);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
@Override
public EiInfo query(EiInfo inInfo) {
try {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HPCG004.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
inInfo = super.query(inInfo, HPCG004.QUERY, new HPCG004());
// List sum = dao.query(HPSqlConstant.HPKC001.QUERY_SUM, queryRow);
// inInfo.getBlock(EiConstant.resultBlock).set(EiConstant.COLUMN_TOTAL_SUM, sum.get(0));
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
@OperationLogAnnotation(operModul = "询价管理",operType = "删除",operDesc = "删除操作")
@Override
public EiInfo delete(EiInfo inInfo) {
int i = 0;
try {
HPCG004 hpcg004 = new HPCG004();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
for (i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
hpcg004.fromMap(map);
hpcg004.setDeleteFlag(CommonConstant.YesNo.YES_1);
DaoUtils.update(HPCG004.DELETE_FLAG, hpcg004);
}
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsgByKey("ep.1000", new String[]{String.valueOf(i), I18nMessages.getText("label.delete", "删除")});
} catch (PlatException e) {
e.printStackTrace();
inInfo.setStatus(EiConstant.STATUS_FAILURE);
ErrorCodeUtils.handleDeleteException(inInfo,i,e);
logError("删除失败", e.getMessage());
return inInfo;
}
return inInfo;
}
@OperationLogAnnotation(operModul = "询价管理",operType = "保存",operDesc = "操作")
public EiInfo save(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 写入数据
for (Map resultRow : resultRows) {
HPCG004 hpcg004 = new HPCG004();
hpcg004.fromMap(resultRow);
if (hpcg004.getId() == null || hpcg004.getId() == 0) {
hpcg004.setDeleteFlag(CommonConstant.YesNo.NO_0);
this.add(hpcg004);
} else {
this.modify(hpcg004);
}
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 新增操作
*/
public void add(HPCG004 hpcg004) {
this.setBaseInfo(hpcg004);
//生成采购询价单号
hpcg004.setInquiryNumber(SequenceGenerator.getNextSequence(HPConstant.SequenceId.INQUIRY_NUMBER));
DaoUtils.insert(HPCG004.INSERT, hpcg004);
}
/**
* 设置基础信息
*
* @param hpcg004
*/
private void setBaseInfo(HPCG004 hpcg004) {
// 去除日期字符串中的-
hpcg004.setInquiryDate(StringUtil.removeHorizontalLine(hpcg004.getInquiryDate()));
}
/**
* 修改操作
*/
public void modify(HPCG004 hpcg004) {
DaoUtils.update(HPCG004.UPDATE, hpcg004);
}
@OperationLogAnnotation(operModul = "询价管理",operType = "提交",operDesc = "提交审批操作")
public EiInfo approve(EiInfo inInfo){
int i = 0;
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (Map resultRow : resultRows) {
HPCG004 hpcg004 = new HPCG004();
hpcg004.fromMap(resultRow);
hpcg004.setProApplyStatus(CommonConstant.YesNo.YES_1);
DaoUtils.update(HPCG004.UPDATE_PRO_APPLY_STATUS,hpcg004);
}
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsgByKey("ep.1000", new String[]{String.valueOf(i), I18nMessages.getText("label.approve", "提交")});
} catch (PlatException e) {
e.printStackTrace();
inInfo.setStatus(EiConstant.STATUS_FAILURE);
ErrorCodeUtils.handleDeleteException(inInfo,i,e);
logError("提交失败", e.getMessage());
return inInfo;
}
return inInfo;
}
}
package com.baosight.hpjx.hp.cg.service;
import com.baosight.hpjx.aspect.annotation.OperationLogAnnotation;
import com.baosight.hpjx.core.constant.CommonConstant;
import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.hp.cg.domain.HPCG004;
import com.baosight.hpjx.hp.cg.domain.HPCG004A;
import com.baosight.hpjx.hp.constant.HPConstant;
import com.baosight.hpjx.hp.xt.domain.HPXT002A;
import com.baosight.hpjx.util.ErrorCodeUtils;
import com.baosight.hpjx.util.LogUtils;
import com.baosight.hpjx.util.StringUtil;
import com.baosight.hpjx.util.contants.ACConstants;
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.exception.PlatException;
import com.baosight.iplat4j.core.resource.I18nMessages;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import java.util.List;
import java.util.Map;
/**
*
*/
public class ServiceHPCG004A extends ServiceEPBase {
@Override
public EiInfo initLoad(EiInfo inInfo) {
return inInfo;
}
@Override
public EiInfo query(EiInfo inInfo) {
try {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HPCG004A.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
inInfo = super.query(inInfo, HPCG004A.QUERY, new HPCG004A());
// List sum = dao.query(HPSqlConstant.HPKC001.QUERY_SUM, queryRow);
// inInfo.getBlock(EiConstant.resultBlock).set(EiConstant.COLUMN_TOTAL_SUM, sum.get(0));
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
@OperationLogAnnotation(operModul = "询价管理详情",operType = "删除",operDesc = "删除操作")
@Override
public EiInfo delete(EiInfo inInfo) {
int i = 0;
try {
HPCG004A hpcg004a = new HPCG004A();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
for (i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
hpcg004a.fromMap(map);
hpcg004a.setDeleteFlag(CommonConstant.YesNo.YES_1);
DaoUtils.update(HPCG004A.DELETE_FLAG, hpcg004a);
}
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsgByKey("ep.1000", new String[]{String.valueOf(i), I18nMessages.getText("label.delete", "删除")});
} catch (PlatException e) {
e.printStackTrace();
inInfo.setStatus(EiConstant.STATUS_FAILURE);
ErrorCodeUtils.handleDeleteException(inInfo,i,e);
logError("删除失败", e.getMessage());
return inInfo;
}
return inInfo;
}
@OperationLogAnnotation(operModul = "询价管理详情详情",operType = "保存",operDesc = "操作")
public EiInfo save(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 写入数据
for (Map resultRow : resultRows) {
HPCG004A hpcg004a = new HPCG004A();
hpcg004a.fromMap(resultRow);
if (hpcg004a.getId() == null || hpcg004a.getId() == 0) {
String tHpjg004Id = inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HPCG004A.FIELD_T_HPJG004_ID);
hpcg004a.settHpjg004Id(Long.valueOf(tHpjg004Id));
this.add(hpcg004a);
} else {
this.modify(hpcg004a);
}
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 新增操作
*/
public void add(HPCG004A hpcg004a) {
this.setBaseInfo(hpcg004a);
//生成采购询价单号
DaoUtils.insert(HPCG004A.INSERT, hpcg004a);
}
/**
* 设置基础信息
*
* @param hpcg004a
*/
private void setBaseInfo(HPCG004A hpcg004a) {
// 去除日期字符串中的-
hpcg004a.setDeliveryDate(StringUtil.removeHorizontalLine(hpcg004a.getDeliveryDate()));
}
/**
* 修改操作
*/
public void modify(HPCG004A hpcg004a) {
DaoUtils.update(HPCG004A.UPDATE, hpcg004a);
}
}
<?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-27 14:04:00
Version : 1.0
schema : hpjx
tableName : T_HPCG004
ID BIGINT NOT NULL primarykey,
COMPANY_CODE VARCHAR NOT NULL,
DEP_CODE VARCHAR,
CREATED_BY VARCHAR,
CREATED_NAME VARCHAR,
CREATED_TIME VARCHAR,
UPDATED_BY VARCHAR,
UPDATED_NAME VARCHAR,
UPDATED_TIME VARCHAR,
INQUIRY_DATE VARCHAR,
INQUIRY_NUMBER VARCHAR,
SUPPLIER_NAME VARCHAR,
INQUIRY_TYPE VARCHAR,
INQUIRY_PERSON VARCHAR,
DELETE_FLAG TINYINT,
PRO_APPLY_STATUS TINYINT
-->
<sqlMap namespace="HPCG004">
<sql id="condition">
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
CREATED_BY = #createdBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdName">
CREATED_NAME = #createdName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
CREATED_TIME = #createdTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy">
UPDATED_BY = #updatedBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedName">
UPDATED_NAME = #updatedName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime">
UPDATED_TIME = #updatedTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inquiryDate">
INQUIRY_DATE = #inquiryDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inquiryNumber">
INQUIRY_NUMBER = #inquiryNumber#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="supplierName">
SUPPLIER_NAME = #supplierName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inquiryType">
INQUIRY_TYPE = #inquiryType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inquiryPerson">
INQUIRY_PERSON = #inquiryPerson#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deleteFlag">
DELETE_FLAG = #deleteFlag#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="proApplyStatus">
PRO_APPLY_STATUS = #proApplyStatus#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdDateFrom">
CREATED_TIME &gt;= REPLACE(#createdDateFrom#, '-', '')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdDateTo">
CREATED_TIME &lt;= REPLACE(#createdDateTo#, '-', '')
</isNotEmpty>
</sql>
<select id="query" parameterClass="java.util.HashMap"
resultClass="com.baosight.hpjx.hp.cg.domain.HPCG004">
SELECT
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", <!-- 更新时间 -->
INQUIRY_DATE as "inquiryDate", <!-- 询价日期 -->
INQUIRY_NUMBER as "inquiryNumber", <!-- 询价单号 -->
SUPPLIER_NAME as "supplierName", <!-- 供应商名称 -->
INQUIRY_TYPE as "inquiryType", <!-- 询价单类型 -->
INQUIRY_PERSON as "inquiryPerson", <!-- 询价单申请人 -->
DELETE_FLAG as "deleteFlag", <!-- 是否删除0.否1.是 -->
PRO_APPLY_STATUS as "proApplyStatus" <!-- 申请状态 -->
FROM ${hpjxSchema}.T_HPCG004 WHERE 1=1
<include refid="condition" />
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
ID asc
</isEmpty>
</dynamic>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hpjxSchema}.T_HPCG004 WHERE 1=1
<include refid="condition" />
</select>
<!--
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
CREATED_BY = #createdBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdName">
CREATED_NAME = #createdName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
CREATED_TIME = #createdTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy">
UPDATED_BY = #updatedBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedName">
UPDATED_NAME = #updatedName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime">
UPDATED_TIME = #updatedTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inquiryDate">
INQUIRY_DATE = #inquiryDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inquiryNumber">
INQUIRY_NUMBER = #inquiryNumber#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="supplierName">
SUPPLIER_NAME = #supplierName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inquiryType">
INQUIRY_TYPE = #inquiryType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inquiryPerson">
INQUIRY_PERSON = #inquiryPerson#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deleteFlag">
DELETE_FLAG = #deleteFlag#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="proApplyStatus">
PRO_APPLY_STATUS = #proApplyStatus#
</isNotEmpty>
-->
<insert id="insert">
INSERT INTO ${hpjxSchema}.T_HPCG004 (ID, <!-- 主键id -->
COMPANY_CODE, <!-- 企业编码 预留 -->
DEP_CODE, <!-- 部门编码 -->
CREATED_BY, <!-- 创建人 -->
CREATED_NAME, <!-- 创建人名称 -->
CREATED_TIME, <!-- 创建时间 -->
UPDATED_BY, <!-- 更新人 -->
UPDATED_NAME, <!-- 更新人名称 -->
UPDATED_TIME, <!-- 更新时间 -->
INQUIRY_DATE, <!-- 询价日期 -->
INQUIRY_NUMBER, <!-- 询价单号 -->
SUPPLIER_NAME, <!-- 供应商名称 -->
INQUIRY_TYPE, <!-- 询价单类型 -->
INQUIRY_PERSON, <!-- 询价单申请人 -->
DELETE_FLAG, <!-- 是否删除0.否1.是 -->
PRO_APPLY_STATUS <!-- 申请状态 -->
)
VALUES (#id#, #companyCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #inquiryDate#, #inquiryNumber#, #supplierName#, #inquiryType#, #inquiryPerson#, #deleteFlag#, #proApplyStatus#)
</insert>
<delete id="delete">
DELETE FROM ${hpjxSchema}.T_HPCG004 WHERE
ID = #id#
</delete>
<update id="deleteFlag">
UPDATE ${hpjxSchema}.T_HPCG004
SET
UPDATED_BY = #updatedBy#, <!-- 修改人 -->
UPDATED_NAME = #updatedName#, <!-- 修改人名称 -->
UPDATED_TIME = #updatedTime#, <!-- 修改时间 -->
DELETE_FLAG = #deleteFlag# <!-- 是否删除0:否1.是 -->
WHERE
ID = #id#
</update>
<!--修改提交状态-->
<update id="updateProApplyStatus">
UPDATE ${hpjxSchema}.T_HPCG004
SET
UPDATED_BY = #updatedBy#, <!-- 更新人 -->
UPDATED_NAME = #updatedName#, <!-- 更新人名称 -->
UPDATED_TIME = #updatedTime#, <!-- 更新时间 -->
PRO_APPLY_STATUS = #proApplyStatus# <!-- 提交状态 0-未提交 1-已提交 -->
WHERE
ID = #id#
</update>
<update id="update">
UPDATE ${hpjxSchema}.T_HPCG004
SET
COMPANY_CODE = #companyCode#, <!-- 企业编码 预留 -->
DEP_CODE = #depCode#, <!-- 部门编码 -->
CREATED_BY = #createdBy#, <!-- 创建人 -->
CREATED_NAME = #createdName#, <!-- 创建人名称 -->
CREATED_TIME = #createdTime#, <!-- 创建时间 -->
UPDATED_BY = #updatedBy#, <!-- 更新人 -->
UPDATED_NAME = #updatedName#, <!-- 更新人名称 -->
UPDATED_TIME = #updatedTime#, <!-- 更新时间 -->
INQUIRY_DATE = #inquiryDate#, <!-- 询价日期 -->
INQUIRY_NUMBER = #inquiryNumber#, <!-- 询价单号 -->
SUPPLIER_NAME = #supplierName#, <!-- 供应商名称 -->
INQUIRY_TYPE = #inquiryType#, <!-- 询价单类型 -->
INQUIRY_PERSON = #inquiryPerson#, <!-- 询价单申请人 -->
DELETE_FLAG = #deleteFlag#, <!-- 是否删除0.否1.是 -->
PRO_APPLY_STATUS = #proApplyStatus# <!-- 申请状态 -->
WHERE
ID = #id#
</update>
</sqlMap>
......@@ -99,8 +99,21 @@ public class HPConstant {
public static final String WD_FILE_ID = "WD_FILE_ID";
// 售后单号
public static final String AFTER_SALE_NO = "AFTER_SALE_NO";
//车辆申请单号
public static final String VEHICLE_APPLY_NO = "VEHICLE_APPLY_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 INQUIRY_NUMBER = "INQUIRY_NUMBER";
}
/**
......@@ -146,4 +159,19 @@ public class HPConstant {
// 已处理
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;
}
}
......@@ -4,7 +4,7 @@ package com.baosight.hpjx.hp.fw.constant;
* @author:songx
* @date:2024/9/24,17:53
*/
public class HpFwConstant {
public class HpFwConst {
/**
* HPFW001 定义
......
......@@ -4,7 +4,7 @@ package com.baosight.hpjx.hp.fw.constant;
* @author:songx
* @date:2024/9/24,18:09
*/
public class HpFwSqlConstant {
public class HpFwSqlConst {
/**
* @author:songx
......@@ -30,4 +30,39 @@ public class HpFwSqlConstant {
public static final String UPDATE_DEAL = "HPFW002.updateDeal";
}
/**
* @author:songx
* @date:2024/8/29,15:54
*/
public static class HpFw003 {
// 锁
public static final String LOCK = "HPFW003.lock";
// 修改
public static final String UPDATE_DEAL = "HPFW003.updateDeal";
}
/**
* @author:songx
* @date:2024/8/29,15:54
*/
public static class HpFw004 {
// 锁
public static final String LOCK = "HPFW004.lock";
// 修改
public static final String UPDATE_DEAL = "HPFW004.updateDeal";
}
/**
* @author:songx
* @date:2024/8/29,15:54
*/
public static class HpFw007 {
// 锁
public static final String LOCK = "HPFW007.lock";
// 修改
public static final String UPDATE_DEAL = "HPFW007.updateDeal";
}
}
......@@ -5,7 +5,7 @@ import com.baosight.hpjx.core.constant.CommonConstant;
import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.core.security.UserSessionUtils;
import com.baosight.hpjx.hp.constant.HPConstant;
import com.baosight.hpjx.hp.fw.constant.HpFwSqlConstant;
import com.baosight.hpjx.hp.fw.constant.HpFwSqlConst;
import com.baosight.hpjx.hp.fw.domain.HPFW001;
import com.baosight.hpjx.hp.fw.utils.HpFwUtils;
import com.baosight.hpjx.util.AssertUtils;
......@@ -146,7 +146,7 @@ public class ServiceHPFW001 extends ServiceBase {
// db数据
Map<String, HPFW001> dbFw001Map = HpFwUtils.HpFw001.lockAndGet(fFw001s);
// 数据校验
this.dealCheckData(fFw001s, dbFw001Map);
this.checkDealData(fFw001s, dbFw001Map);
// 保存数据
this.dealData(fFw001s, content);
inInfo = this.query(inInfo);
......@@ -164,7 +164,7 @@ public class ServiceHPFW001 extends ServiceBase {
* @param fFw001s
* @param dbFw001Map
*/
private void dealCheckData(List<HPFW001> fFw001s, Map<String, HPFW001> dbFw001Map) {
private void checkDealData(List<HPFW001> fFw001s, Map<String, HPFW001> dbFw001Map) {
for (HPFW001 fFw001 : fFw001s) {
String afterSaleNo = fFw001.getAfterSaleNo();
HPFW001 dbFw001 = dbFw001Map.get(afterSaleNo);
......@@ -184,7 +184,7 @@ public class ServiceHPFW001 extends ServiceBase {
fFw001.setStatus(HPConstant.dealStatus.S1);
fFw001.setDealUserId(UserSessionUtils.getLoginName());
fFw001.setDealUserName(UserSessionUtils.getLoginCName());
DaoUtils.update(HpFwSqlConstant.HpFw001.UPDATE_DEAL, fFw001.toMap());
DaoUtils.update(HpFwSqlConst.HpFw001.UPDATE_DEAL, fFw001.toMap());
}
}
......@@ -199,6 +199,6 @@ public class ServiceHPFW001 extends ServiceBase {
AssertUtils.isNotEquals(dbFw001.getDeleteFlag(), CommonConstant.YesNo.NO_0,
String.format("售后服务单【%s】不是\"未删除\"状态,不允许操作", afterSaleNo));
AssertUtils.isNotEquals(dbFw001.getStatus(), HPConstant.dealStatus.S0,
String.format("售后服务单【%s】不是\"待回访\"状态,不允许操作", afterSaleNo));
String.format("售后服务单【%s】不是\"待处理\"状态,不允许操作", afterSaleNo));
}
}
......@@ -5,7 +5,6 @@ import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.core.utils.Iplat4jUtils;
import com.baosight.hpjx.hp.constant.HPConstant;
import com.baosight.hpjx.hp.dm.domain.HPDM099;
import com.baosight.hpjx.hp.fw.constant.HpFwConstant;
import com.baosight.hpjx.hp.fw.domain.HPFW001;
import com.baosight.hpjx.hp.fw.tools.HpFwTools;
import com.baosight.hpjx.hp.fw.utils.HpFwUtils;
......
......@@ -5,8 +5,7 @@ import com.baosight.hpjx.core.constant.CommonConstant;
import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.core.security.UserSessionUtils;
import com.baosight.hpjx.hp.constant.HPConstant;
import com.baosight.hpjx.hp.fw.constant.HpFwConstant;
import com.baosight.hpjx.hp.fw.constant.HpFwSqlConstant;
import com.baosight.hpjx.hp.fw.constant.HpFwSqlConst;
import com.baosight.hpjx.hp.fw.domain.HPFW002;
import com.baosight.hpjx.hp.fw.utils.HpFwUtils;
import com.baosight.hpjx.util.AssertUtils;
......@@ -98,9 +97,7 @@ public class ServiceHPFW002 extends ServiceBase {
for (HPFW002 fFw002 : fFw002s) {
String careNo = fFw002.getCareNo();
HPFW002 dbFw002 = dbFw002Map.get(careNo);
AssertUtils.isNull(dbFw002, String.format("客户关怀单[%s]不存在", careNo));
AssertUtils.isNotEquals(HPConstant.dealStatus.S0, dbFw002.getStatus(),
String.format("客户关怀单[%s]状态不是\"待处理\",不允许操作", careNo));
this.checkData(careNo, dbFw002);
}
}
......@@ -117,21 +114,41 @@ public class ServiceHPFW002 extends ServiceBase {
}
/**
* 检查状态
*
* @param inInfo
* @return
*/
public EiInfo checkStatus(EiInfo inInfo) {
try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
String careNo = MapUtils.getString(queryMap, HPFW002.FIELD_CARE_NO);
HPFW002 dbFw002 = HpFwUtils.HpFw002.lockAndGet(careNo);
this.checkData(careNo, dbFw002);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "操作失败");
}
return inInfo;
}
/**
* 处理
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "客户回访", operType = "审核")
public EiInfo check(EiInfo inInfo) {
public EiInfo deal(EiInfo inInfo) {
try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
String content = MapUtils.getString(queryMap, "content");
List<HPFW002> fFw002s = MapUtils.toDaoEPBases(inInfo, HPFW002.class);
// db数据
Map<String, HPFW002> dbFw002Map = HpFwUtils.HpFw002.lockAndGet(fFw002s);
// 数据校验
this.checkCheckData(fFw002s, dbFw002Map);
this.checkDealData(fFw002s, dbFw002Map);
// 保存数据
this.checkData(fFw002s);
this.dealData(fFw002s, content);
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + fFw002s.size() + "]条数据处理成功!");
......@@ -147,13 +164,11 @@ public class ServiceHPFW002 extends ServiceBase {
* @param fFw002s
* @param dbFw002Map
*/
private void checkCheckData(List<HPFW002> fFw002s, Map<String, HPFW002> dbFw002Map) {
private void checkDealData(List<HPFW002> fFw002s, Map<String, HPFW002> dbFw002Map) {
for (HPFW002 fFw002 : fFw002s) {
String careNo = fFw002.getCareNo();
HPFW002 dbFw002 = dbFw002Map.get(careNo);
AssertUtils.isNull(dbFw002, String.format("客户关怀单[%s]不存在", careNo));
AssertUtils.isNotEquals(HPConstant.dealStatus.S0, dbFw002.getStatus(),
String.format("客户关怀单[%s]状态不是\"待处理\",不允许操作", careNo));
this.checkData(careNo, dbFw002);
}
}
......@@ -161,14 +176,29 @@ public class ServiceHPFW002 extends ServiceBase {
* 数据保存
*
* @param fFw002s
* @param content
*/
private void checkData(List<HPFW002> fFw002s) {
private void dealData(List<HPFW002> fFw002s, String content) {
for (HPFW002 fFw002 : fFw002s) {
fFw002.setStatus(HPConstant.dealStatus.S1);
fFw002.setDealUserId(UserSessionUtils.getLoginName());
fFw002.setDealUserName(UserSessionUtils.getLoginCName());
DaoUtils.update(HpFwSqlConstant.HpFw002.UPDATE_DEAL, fFw002.toMap());
fFw002.setDealContent(content);
DaoUtils.update(HpFwSqlConst.HpFw002.UPDATE_DEAL, fFw002.toMap());
}
}
/**
* 数据校验
*
* @param careNo
* @param dbFw002
*/
private void checkData(String careNo, HPFW002 dbFw002) {
AssertUtils.isNull(dbFw002, String.format("客户关怀单[%s]不存在", careNo));
AssertUtils.isNotEquals(dbFw002.getDeleteFlag(), CommonConstant.YesNo.NO_0,
String.format("客户关怀单【%s】不是\"未删除\"状态,不允许操作", careNo));
AssertUtils.isNotEquals(dbFw002.getStatus(), HPConstant.dealStatus.S0,
String.format("客户关怀单【%s】不是\"待处理\"状态,不允许操作", careNo));
}
}
package com.baosight.hpjx.hp.fw.service;
import com.baosight.hpjx.core.constant.CommonConstant;
import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.core.utils.Iplat4jUtils;
import com.baosight.hpjx.hp.constant.HPConstant;
import com.baosight.hpjx.hp.dm.domain.HPDM099;
import com.baosight.hpjx.hp.fw.domain.HPFW001;
import com.baosight.hpjx.hp.fw.domain.HPFW002;
import com.baosight.hpjx.hp.fw.tools.HpFwTools;
import com.baosight.hpjx.hp.fw.utils.HpFwUtils;
import com.baosight.hpjx.util.AssertUtils;
import com.baosight.hpjx.util.EiInfoUtils;
import com.baosight.hpjx.util.LogUtils;
import com.baosight.hpjx.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 ServiceHPFW002A extends ServiceEPBase {
/**
* 初始化
*
* @param inInfo
* @return
*/
@Override
public EiInfo initLoad(EiInfo inInfo) {
try {
this.setDetailInfo(inInfo);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HPDM099().eiMetadata);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询操作
*
* @param inInfo
* @return
*/
@Override
public EiInfo query(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HPDM099.QUERY, new HPDM099());
} 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, HPDM099.FIELD_BIZ_ID);
HPFW002 dbFw002 = HpFwUtils.HpFw002.lockAndGet(bizId);
this.checkData(bizId, dbFw002);
List<HPDM099> fDm099s = MapUtils.toDaoEPBases(inInfo, HPDM099.class);
for (HPDM099 fDm099 : fDm099s) {
DaoUtils.update(HPDM099.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, HPFW002 dbFw002) {
AssertUtils.isNull(dbFw002, String.format("客户关怀单[%s]不存在", careNo));
AssertUtils.isNotEquals(dbFw002.getDeleteFlag(), CommonConstant.YesNo.NO_0,
String.format("客户关怀单【%s】不是\"未删除\"状态,不允许操作", careNo));
AssertUtils.isNotEquals(dbFw002.getStatus(), HPConstant.dealStatus.S0,
String.format("客户关怀单【%s】不是\"待回访\"状态,不允许操作", careNo));
}
/**
* 设置信息
*
* @param inInfo
*/
public void setDetailInfo(EiInfo inInfo) {
Map queryRow = EiInfoUtils.getFirstRow(inInfo);
String bizId = MapUtils.getString(queryRow, HPDM099.FIELD_BIZ_ID);
if (bizId == null) {
return;
}
EiBlock block = new EiBlock(CommonConstant.Field.DETAIL);
block.addRow(HpFwTools.HpFw002.get(bizId));
block.addBlockMeta(new HPFW002().eiMetadata);
inInfo.setBlock(block);
}
}
package com.baosight.hpjx.hp.fw.service;
import com.baosight.hpjx.core.constant.CommonConstant;
import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.core.security.UserSessionUtils;
import com.baosight.hpjx.hp.constant.HPConstant;
import com.baosight.hpjx.hp.fw.constant.HpFwSqlConst;
import com.baosight.hpjx.hp.fw.domain.HPFW003;
import com.baosight.hpjx.hp.fw.utils.HpFwUtils;
import com.baosight.hpjx.util.AssertUtils;
import com.baosight.hpjx.util.DateUtils;
import com.baosight.hpjx.util.EiInfoUtils;
import com.baosight.hpjx.util.LogUtils;
import com.baosight.hpjx.util.MapUtils;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.service.impl.ServiceBase;
import java.util.List;
import java.util.Map;
/**
* 客户投诉
*
* @author:songx
* @date:2024/9/24,17:47
*/
public class ServiceHPFW003 extends ServiceBase {
/**
* 画面初始化
*
* @param inInfo
* @return
*/
@Override
public EiInfo initLoad(EiInfo inInfo) {
try {
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HPFW003().eiMetadata);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询操作.
*/
@Override
public EiInfo query(EiInfo inInfo) {
try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
queryMap.put(HPFW003.FIELD_COMPLAINT_DATE,
DateUtils.formatShort(queryMap.get(HPFW003.FIELD_COMPLAINT_DATE)));
inInfo = super.query(inInfo, HPFW003.QUERY, new HPFW003());
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
/**
* 删除操作
*
* @param inInfo
* @return
*/
public EiInfo remove(EiInfo inInfo) {
try {
List<HPFW003> fFw003s = MapUtils.toDaoEPBases(inInfo, HPFW003.class);
// db数据
Map<String, HPFW003> dbFw003Map = HpFwUtils.HpFw003.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<HPFW003> fFw003s, Map<String, HPFW003> dbFw003Map) {
for (HPFW003 fFw003 : fFw003s) {
String complaintNo = fFw003.getComplaintNo();
HPFW003 dbFw003 = dbFw003Map.get(complaintNo);
this.checkData(complaintNo, dbFw003);
}
}
/**
* 数据保存
*
* @param fFw003s
*/
private void removeData(List<HPFW003> fFw003s) {
for (HPFW003 fFw003 : fFw003s) {
fFw003.setDeleteFlag(CommonConstant.YesNo.YES_1);
DaoUtils.update(HPFW003.DELETE, fFw003.toMap());
}
}
/**
* 检查状态
*
* @param inInfo
* @return
*/
public EiInfo checkStatus(EiInfo inInfo) {
try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
String complaintNo = MapUtils.getString(queryMap, HPFW003.FIELD_COMPLAINT_NO);
HPFW003 dbFw003 = HpFwUtils.HpFw003.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<HPFW003> fFw003s = MapUtils.toDaoEPBases(inInfo, HPFW003.class);
// db数据
Map<String, HPFW003> dbFw003Map = HpFwUtils.HpFw003.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<HPFW003> fFw003s, Map<String, HPFW003> dbFw003Map) {
for (HPFW003 fFw003 : fFw003s) {
String complaintNo = fFw003.getComplaintNo();
HPFW003 dbFw003 = dbFw003Map.get(complaintNo);
this.checkData(complaintNo, dbFw003);
}
}
/**
* 数据保存
*
* @param fFw003s
* @param content
*/
private void dealData(List<HPFW003> fFw003s, String content) {
for (HPFW003 fFw003 : fFw003s) {
fFw003.setStatus(HPConstant.dealStatus.S1);
fFw003.setDealUserId(UserSessionUtils.getLoginName());
fFw003.setDealUserName(UserSessionUtils.getLoginCName());
fFw003.setDealContent(content);
DaoUtils.update(HpFwSqlConst.HpFw003.UPDATE_DEAL, fFw003.toMap());
}
}
/**
* 数据校验
*
* @param careNo
* @param dbFw003
*/
private void checkData(String careNo, HPFW003 dbFw003) {
AssertUtils.isNull(dbFw003, String.format("投诉单[%s]不存在", careNo));
AssertUtils.isNotEquals(dbFw003.getDeleteFlag(), CommonConstant.YesNo.NO_0,
String.format("投诉单【%s】不是\"未删除\"状态,不允许操作", careNo));
AssertUtils.isNotEquals(dbFw003.getStatus(), HPConstant.dealStatus.S0,
String.format("投诉单【%s】不是\"待处理\"状态,不允许操作", careNo));
}
}
package com.baosight.hpjx.hp.fw.service;
import com.baosight.hpjx.core.constant.CommonConstant;
import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.core.utils.Iplat4jUtils;
import com.baosight.hpjx.hp.constant.HPConstant;
import com.baosight.hpjx.hp.dm.domain.HPDM099;
import com.baosight.hpjx.hp.fw.domain.HPFW003;
import com.baosight.hpjx.hp.fw.tools.HpFwTools;
import com.baosight.hpjx.hp.fw.utils.HpFwUtils;
import com.baosight.hpjx.util.AssertUtils;
import com.baosight.hpjx.util.EiInfoUtils;
import com.baosight.hpjx.util.LogUtils;
import com.baosight.hpjx.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 ServiceHPFW003A extends ServiceEPBase {
/**
* 初始化
*
* @param inInfo
* @return
*/
@Override
public EiInfo initLoad(EiInfo inInfo) {
try {
this.setDetailInfo(inInfo);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HPDM099().eiMetadata);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询操作
*
* @param inInfo
* @return
*/
@Override
public EiInfo query(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HPDM099.QUERY, new HPDM099());
} 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, HPDM099.FIELD_BIZ_ID);
HPFW003 dbFw003 = HpFwUtils.HpFw003.lockAndGet(bizId);
this.checkData(bizId, dbFw003);
List<HPDM099> fDm099s = MapUtils.toDaoEPBases(inInfo, HPDM099.class);
for (HPDM099 fDm099 : fDm099s) {
DaoUtils.update(HPDM099.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, HPFW003 dbFw003) {
AssertUtils.isNull(dbFw003, String.format("投诉单[%s]不存在", complaintNo));
AssertUtils.isNotEquals(dbFw003.getDeleteFlag(), CommonConstant.YesNo.NO_0,
String.format("投诉单【%s】不是\"未删除\"状态,不允许操作", complaintNo));
AssertUtils.isNotEquals(dbFw003.getStatus(), HPConstant.dealStatus.S0,
String.format("投诉单【%s】不是\"未处理\"状态,不允许操作", complaintNo));
}
/**
* 设置信息
*
* @param inInfo
*/
public void setDetailInfo(EiInfo inInfo) {
Map queryRow = EiInfoUtils.getFirstRow(inInfo);
String bizId = MapUtils.getString(queryRow, HPDM099.FIELD_BIZ_ID);
if (bizId == null) {
return;
}
EiBlock block = new EiBlock(CommonConstant.Field.DETAIL);
block.addRow(HpFwTools.HpFw003.get(bizId));
block.addBlockMeta(new HPFW003().eiMetadata);
inInfo.setBlock(block);
}
}
package com.baosight.hpjx.hp.fw.service;
import com.baosight.hpjx.aspect.annotation.OperationLogAnnotation;
import com.baosight.hpjx.common.DdynamicEnum;
import com.baosight.hpjx.core.constant.CommonConstant;
import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.hp.constant.HPConstant;
import com.baosight.hpjx.hp.fw.domain.HPFW003;
import com.baosight.hpjx.hp.fw.tools.HpFwTools;
import com.baosight.hpjx.hp.fw.utils.HpFwUtils;
import com.baosight.hpjx.util.AssertUtils;
import com.baosight.hpjx.util.CommonMethod;
import com.baosight.hpjx.util.DateUtils;
import com.baosight.hpjx.util.EiInfoUtils;
import com.baosight.hpjx.util.LogUtils;
import com.baosight.hpjx.util.MapUtils;
import com.baosight.hpjx.util.StringUtils;
import com.baosight.iplat4j.core.ei.EiBlock;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import java.util.Arrays;
import java.util.Map;
/**
* 新增修改
*
* @author:songx
* @date:2022/7/11,11:08
*/
public class ServiceHPFW003B 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 {
HPFW003 fFw003 = MapUtils.toDaoEPBase(inInfo, HPFW003.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.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 新增
*
* @param fFw003
*/
private void add(HPFW003 fFw003) {
fFw003.setComplaintNo(SequenceGenerator.getNextSequence(HPConstant.SequenceId.COMPLAINT_NO));
fFw003.setStatus(HPConstant.dealStatus.S0);
fFw003.setDeleteFlag(CommonConstant.YesNo.NO_0);
DaoUtils.insert(HPFW003.INSERT, fFw003);
}
/**
* 修改数据
*
* @param fFw003
*/
private void modify(HPFW003 fFw003) {
HPFW003 dbFw003 = HpFwUtils.HpFw003.lockAndGet(fFw003);
this.checkData(fFw003, dbFw003);
DaoUtils.update(HPFW003.UPDATE, fFw003);
}
/**
* 设置信息
*
* @param inInfo
*/
public void setBaseInfo(EiInfo inInfo) {
Map queryRow = EiInfoUtils.getFirstRow(inInfo);
String complaintNo = MapUtils.getString(queryRow, HPFW003.FIELD_COMPLAINT_NO);
if (StringUtils.isBlank(complaintNo)) {
return;
}
EiBlock resultBlock = new EiBlock(EiConstant.resultBlock);
resultBlock.addRow(HpFwTools.HpFw003.get(complaintNo));
resultBlock.addBlockMeta(new HPFW003().eiMetadata);
inInfo.setBlock(resultBlock);
}
/**
* 数据校验
*
* @param fFw003
* @param dbFw003
*/
private void checkData(HPFW003 fFw003, HPFW003 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(), HPConstant.dealStatus.S0,
String.format("投诉单【%s】不是\"未处理\"状态,不允许操作", complaintNo));
}
}
package com.baosight.hpjx.hp.fw.service;
import com.baosight.hpjx.core.constant.CommonConstant;
import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.core.security.UserSessionUtils;
import com.baosight.hpjx.hp.constant.HPConstant;
import com.baosight.hpjx.hp.fw.constant.HpFwSqlConst;
import com.baosight.hpjx.hp.fw.domain.HPFW004;
import com.baosight.hpjx.hp.fw.utils.HpFwUtils;
import com.baosight.hpjx.util.AssertUtils;
import com.baosight.hpjx.util.DateUtils;
import com.baosight.hpjx.util.EiInfoUtils;
import com.baosight.hpjx.util.LogUtils;
import com.baosight.hpjx.util.MapUtils;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.service.impl.ServiceBase;
import java.util.List;
import java.util.Map;
/**
* 客户建议
*
* @author:songx
* @date:2024/9/24,17:47
*/
public class ServiceHPFW004 extends ServiceBase {
/**
* 画面初始化
*
* @param inInfo
* @return
*/
@Override
public EiInfo initLoad(EiInfo inInfo) {
try {
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HPFW004().eiMetadata);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询操作.
*/
@Override
public EiInfo query(EiInfo inInfo) {
try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
queryMap.put(HPFW004.FIELD_SUGGEST_DATE,
DateUtils.formatShort(queryMap.get(HPFW004.FIELD_SUGGEST_DATE)));
inInfo = super.query(inInfo, HPFW004.QUERY, new HPFW004());
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
/**
* 删除操作
*
* @param inInfo
* @return
*/
public EiInfo remove(EiInfo inInfo) {
try {
List<HPFW004> fFw004s = MapUtils.toDaoEPBases(inInfo, HPFW004.class);
// db数据
Map<String, HPFW004> dbFw004Map = HpFwUtils.HpFw004.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<HPFW004> fFw004s, Map<String, HPFW004> dbFw004Map) {
for (HPFW004 fFw004 : fFw004s) {
String suggestNo = fFw004.getSuggestNo();
HPFW004 dbFw004 = dbFw004Map.get(suggestNo);
this.checkData(suggestNo, dbFw004);
}
}
/**
* 数据保存
*
* @param fFw004s
*/
private void removeData(List<HPFW004> fFw004s) {
for (HPFW004 fFw004 : fFw004s) {
fFw004.setDeleteFlag(CommonConstant.YesNo.YES_1);
DaoUtils.update(HPFW004.DELETE, fFw004.toMap());
}
}
/**
* 检查状态
*
* @param inInfo
* @return
*/
public EiInfo checkStatus(EiInfo inInfo) {
try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
String suggestNo = MapUtils.getString(queryMap, HPFW004.FIELD_SUGGEST_NO);
HPFW004 dbFw004 = HpFwUtils.HpFw004.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<HPFW004> fFw004s = MapUtils.toDaoEPBases(inInfo, HPFW004.class);
// db数据
Map<String, HPFW004> dbFw004Map = HpFwUtils.HpFw004.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<HPFW004> fFw004s, Map<String, HPFW004> dbFw004Map) {
for (HPFW004 fFw004 : fFw004s) {
String suggestNo = fFw004.getSuggestNo();
HPFW004 dbFw004 = dbFw004Map.get(suggestNo);
this.checkData(suggestNo, dbFw004);
}
}
/**
* 数据保存
*
* @param fFw004s
* @param content
*/
private void dealData(List<HPFW004> fFw004s, String content) {
for (HPFW004 fFw004 : fFw004s) {
fFw004.setStatus(HPConstant.dealStatus.S1);
fFw004.setDealUserId(UserSessionUtils.getLoginName());
fFw004.setDealUserName(UserSessionUtils.getLoginCName());
fFw004.setDealContent(content);
DaoUtils.update(HpFwSqlConst.HpFw004.UPDATE_DEAL, fFw004.toMap());
}
}
/**
* 数据校验
*
* @param suggestNo
* @param dbFw004
*/
private void checkData(String suggestNo, HPFW004 dbFw004) {
AssertUtils.isNull(dbFw004, String.format("建议单[%s]不存在", suggestNo));
AssertUtils.isNotEquals(dbFw004.getDeleteFlag(), CommonConstant.YesNo.NO_0,
String.format("建议单【%s】不是\"未删除\"状态,不允许操作", suggestNo));
AssertUtils.isNotEquals(dbFw004.getStatus(), HPConstant.dealStatus.S0,
String.format("建议单【%s】不是\"待处理\"状态,不允许操作", suggestNo));
}
}
package com.baosight.hpjx.hp.fw.service;
import com.baosight.hpjx.core.constant.CommonConstant;
import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.core.utils.Iplat4jUtils;
import com.baosight.hpjx.hp.constant.HPConstant;
import com.baosight.hpjx.hp.dm.domain.HPDM099;
import com.baosight.hpjx.hp.fw.domain.HPFW004;
import com.baosight.hpjx.hp.fw.tools.HpFwTools;
import com.baosight.hpjx.hp.fw.utils.HpFwUtils;
import com.baosight.hpjx.util.AssertUtils;
import com.baosight.hpjx.util.EiInfoUtils;
import com.baosight.hpjx.util.LogUtils;
import com.baosight.hpjx.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 ServiceHPFW004A extends ServiceEPBase {
/**
* 初始化
*
* @param inInfo
* @return
*/
@Override
public EiInfo initLoad(EiInfo inInfo) {
try {
this.setDetailInfo(inInfo);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HPDM099().eiMetadata);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询操作
*
* @param inInfo
* @return
*/
@Override
public EiInfo query(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HPDM099.QUERY, new HPDM099());
} 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, HPDM099.FIELD_BIZ_ID);
HPFW004 dbFw004 = HpFwUtils.HpFw004.lockAndGet(bizId);
this.checkData(bizId, dbFw004);
List<HPDM099> fDm099s = MapUtils.toDaoEPBases(inInfo, HPDM099.class);
for (HPDM099 fDm099 : fDm099s) {
DaoUtils.update(HPDM099.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, HPFW004 dbFw004) {
AssertUtils.isNull(dbFw004, String.format("建议单[%s]不存在", complaintNo));
AssertUtils.isNotEquals(dbFw004.getDeleteFlag(), CommonConstant.YesNo.NO_0,
String.format("建议单【%s】不是\"未删除\"状态,不允许操作", complaintNo));
AssertUtils.isNotEquals(dbFw004.getStatus(), HPConstant.dealStatus.S0,
String.format("建议单【%s】不是\"未处理\"状态,不允许操作", complaintNo));
}
/**
* 设置信息
*
* @param inInfo
*/
public void setDetailInfo(EiInfo inInfo) {
Map queryRow = EiInfoUtils.getFirstRow(inInfo);
String bizId = MapUtils.getString(queryRow, HPDM099.FIELD_BIZ_ID);
if (bizId == null) {
return;
}
EiBlock block = new EiBlock(CommonConstant.Field.DETAIL);
block.addRow(HpFwTools.HpFw004.get(bizId));
block.addBlockMeta(new HPFW004().eiMetadata);
inInfo.setBlock(block);
}
}
package com.baosight.hpjx.hp.fw.service;
import com.baosight.hpjx.common.DdynamicEnum;
import com.baosight.hpjx.core.constant.CommonConstant;
import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.hp.constant.HPConstant;
import com.baosight.hpjx.hp.fw.domain.HPFW004;
import com.baosight.hpjx.hp.fw.tools.HpFwTools;
import com.baosight.hpjx.hp.fw.utils.HpFwUtils;
import com.baosight.hpjx.util.AssertUtils;
import com.baosight.hpjx.util.CommonMethod;
import com.baosight.hpjx.util.DateUtils;
import com.baosight.hpjx.util.EiInfoUtils;
import com.baosight.hpjx.util.LogUtils;
import com.baosight.hpjx.util.MapUtils;
import com.baosight.hpjx.util.StringUtils;
import com.baosight.iplat4j.core.ei.EiBlock;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import java.util.Arrays;
import java.util.Map;
/**
* 新增修改
*
* @author:songx
* @date:2022/7/11,11:08
*/
public class ServiceHPFW004B 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 {
HPFW004 fFw004 = MapUtils.toDaoEPBase(inInfo, HPFW004.class);
fFw004.setSuggestDate(DateUtils.formatShort(fFw004.getSuggestDate()));
if (StringUtils.isBlank(fFw004.getSuggestNo())) {
this.add(fFw004);
} else {
this.modify(fFw004);
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 新增
*
* @param fFw004
*/
private void add(HPFW004 fFw004) {
fFw004.setSuggestNo(SequenceGenerator.getNextSequence(HPConstant.SequenceId.SUGGEST_NO));
fFw004.setStatus(HPConstant.dealStatus.S0);
fFw004.setDeleteFlag(CommonConstant.YesNo.NO_0);
DaoUtils.insert(HPFW004.INSERT, fFw004);
}
/**
* 修改数据
*
* @param fFw004
*/
private void modify(HPFW004 fFw004) {
HPFW004 dbFw004 = HpFwUtils.HpFw004.lockAndGet(fFw004);
this.checkData(fFw004, dbFw004);
DaoUtils.update(HPFW004.UPDATE, fFw004);
}
/**
* 设置信息
*
* @param inInfo
*/
public void setBaseInfo(EiInfo inInfo) {
Map queryRow = EiInfoUtils.getFirstRow(inInfo);
String suggestNo = MapUtils.getString(queryRow, HPFW004.FIELD_SUGGEST_NO);
if (StringUtils.isBlank(suggestNo)) {
return;
}
EiBlock resultBlock = new EiBlock(EiConstant.resultBlock);
resultBlock.addRow(HpFwTools.HpFw004.get(suggestNo));
resultBlock.addBlockMeta(new HPFW004().eiMetadata);
inInfo.setBlock(resultBlock);
}
/**
* 数据校验
*
* @param fFw004
* @param dbFw004
*/
private void checkData(HPFW004 fFw004, HPFW004 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(), HPConstant.dealStatus.S0,
String.format("建议单【%s】不是\"未处理\"状态,不允许操作", suggestNo));
}
}
package com.baosight.hpjx.hp.fw.service;
import com.baosight.hpjx.aspect.annotation.OperationLogAnnotation;
import com.baosight.hpjx.core.constant.CommonConstant;
import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.core.security.UserSessionUtils;
import com.baosight.hpjx.hp.constant.HPConstant;
import com.baosight.hpjx.hp.fw.constant.HpFwSqlConst;
import com.baosight.hpjx.hp.fw.domain.HPFW007;
import com.baosight.hpjx.hp.fw.utils.HpFwUtils;
import com.baosight.hpjx.util.AssertUtils;
import com.baosight.hpjx.util.DateUtils;
import com.baosight.hpjx.util.EiInfoUtils;
import com.baosight.hpjx.util.LogUtils;
import com.baosight.hpjx.util.MapUtils;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.service.impl.ServiceBase;
import java.util.List;
import java.util.Map;
/**
* 客户回访
*
* @author:songx
* @date:2024/9/24,17:47
*/
public class ServiceHPFW007 extends ServiceBase {
/**
* 画面初始化
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "售后维修", operType = "查询", operDesc = "初始化")
public EiInfo initLoad(EiInfo inInfo) {
try {
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HPFW007().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(HPFW007.FIELD_FOL_DATE, DateUtils.formatShort(queryMap.get(HPFW007.FIELD_FOL_DATE)));
inInfo = super.query(inInfo, HPFW007.QUERY, new HPFW007());
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
/**
* 删除操作
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "客户回访", operType = "删除")
public EiInfo remove(EiInfo inInfo) {
try {
List<HPFW007> fFw007s = MapUtils.toDaoEPBases(inInfo, HPFW007.class);
// db数据
Map<String, HPFW007> dbFw007Map = HpFwUtils.HpFw007.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<HPFW007> fFw007s, Map<String, HPFW007> dbFw007Map) {
for (HPFW007 fFw007 : fFw007s) {
String folNo = fFw007.getFolNo();
HPFW007 dbFw007 = dbFw007Map.get(folNo);
this.checkData(folNo, dbFw007);
}
}
/**
* 数据保存
*
* @param fFw007s
*/
private void removeData(List<HPFW007> fFw007s) {
for (HPFW007 fFw007 : fFw007s) {
fFw007.setDeleteFlag(CommonConstant.YesNo.YES_1);
DaoUtils.update(HPFW007.DELETE, fFw007.toMap());
}
}
/**
* 检查状态
*
* @param inInfo
* @return
*/
public EiInfo checkStatus(EiInfo inInfo) {
try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
String folNo = MapUtils.getString(queryMap, HPFW007.FIELD_FOL_NO);
HPFW007 dbFw007 = HpFwUtils.HpFw007.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<HPFW007> fFw007s = MapUtils.toDaoEPBases(inInfo, HPFW007.class);
// db数据
Map<String, HPFW007> dbFw007Map = HpFwUtils.HpFw007.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<HPFW007> fFw007s, Map<String, HPFW007> dbFw007Map) {
for (HPFW007 fFw007 : fFw007s) {
String folNo = fFw007.getFolNo();
HPFW007 dbFw007 = dbFw007Map.get(folNo);
this.checkData(folNo, dbFw007);
}
}
/**
* 数据保存
*
* @param fFw007s
* @param content
*/
private void dealData(List<HPFW007> fFw007s, String content) {
for (HPFW007 fFw007 : fFw007s) {
fFw007.setStatus(HPConstant.dealStatus.S1);
fFw007.setDealUserId(UserSessionUtils.getLoginName());
fFw007.setDealUserName(UserSessionUtils.getLoginCName());
fFw007.setDealContent(content);
DaoUtils.update(HpFwSqlConst.HpFw007.UPDATE_DEAL, fFw007.toMap());
}
}
/**
* 数据校验
*
* @param folNo
* @param dbFw007
*/
private void checkData(String folNo, HPFW007 dbFw007) {
AssertUtils.isNull(dbFw007, String.format("回访单[%s]不存在", folNo));
AssertUtils.isNotEquals(dbFw007.getDeleteFlag(), CommonConstant.YesNo.NO_0,
String.format("回访单【%s】不是\"未删除\"状态,不允许操作", folNo));
AssertUtils.isNotEquals(dbFw007.getStatus(), HPConstant.dealStatus.S0,
String.format("回访单【%s】不是\"待回访\"状态,不允许操作", folNo));
}
}
package com.baosight.hpjx.hp.fw.service;
import com.baosight.hpjx.core.constant.CommonConstant;
import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.core.utils.Iplat4jUtils;
import com.baosight.hpjx.hp.constant.HPConstant;
import com.baosight.hpjx.hp.dm.domain.HPDM099;
import com.baosight.hpjx.hp.fw.domain.HPFW007;
import com.baosight.hpjx.hp.fw.tools.HpFwTools;
import com.baosight.hpjx.hp.fw.utils.HpFwUtils;
import com.baosight.hpjx.util.AssertUtils;
import com.baosight.hpjx.util.EiInfoUtils;
import com.baosight.hpjx.util.LogUtils;
import com.baosight.hpjx.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 ServiceHPFW007A extends ServiceEPBase {
/**
* 初始化
*
* @param inInfo
* @return
*/
@Override
public EiInfo initLoad(EiInfo inInfo) {
try {
this.setDetailInfo(inInfo);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HPDM099().eiMetadata);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询操作
*
* @param inInfo
* @return
*/
@Override
public EiInfo query(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HPDM099.QUERY, new HPDM099());
} 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, HPDM099.FIELD_BIZ_ID);
HPFW007 dbFw007 = HpFwUtils.HpFw007.lockAndGet(bizId);
this.checkData(bizId, dbFw007);
List<HPDM099> fDm099s = MapUtils.toDaoEPBases(inInfo, HPDM099.class);
for (HPDM099 fDm099 : fDm099s) {
DaoUtils.update(HPDM099.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, HPFW007 dbFw007) {
AssertUtils.isNull(dbFw007, String.format("回访单[%s]不存在", folNo));
AssertUtils.isNotEquals(dbFw007.getDeleteFlag(), CommonConstant.YesNo.NO_0,
String.format("回访单【%s】不是\"未删除\"状态,不允许操作", folNo));
AssertUtils.isNotEquals(dbFw007.getStatus(), HPConstant.dealStatus.S0,
String.format("回访单【%s】不是\"待回访\"状态,不允许操作", folNo));
}
/**
* 设置信息
*
* @param inInfo
*/
public void setDetailInfo(EiInfo inInfo) {
Map queryRow = EiInfoUtils.getFirstRow(inInfo);
String bizId = MapUtils.getString(queryRow, HPDM099.FIELD_BIZ_ID);
if (bizId == null) {
return;
}
EiBlock block = new EiBlock(CommonConstant.Field.DETAIL);
block.addRow(HpFwTools.HpFw007.get(bizId));
block.addBlockMeta(new HPFW007().eiMetadata);
inInfo.setBlock(block);
}
}
package com.baosight.hpjx.hp.fw.service;
import com.baosight.hpjx.aspect.annotation.OperationLogAnnotation;
import com.baosight.hpjx.common.DdynamicEnum;
import com.baosight.hpjx.core.constant.CommonConstant;
import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.hp.constant.HPConstant;
import com.baosight.hpjx.hp.fw.domain.HPFW007;
import com.baosight.hpjx.hp.fw.tools.HpFwTools;
import com.baosight.hpjx.hp.fw.utils.HpFwUtils;
import com.baosight.hpjx.util.AssertUtils;
import com.baosight.hpjx.util.CommonMethod;
import com.baosight.hpjx.util.DateUtils;
import com.baosight.hpjx.util.EiInfoUtils;
import com.baosight.hpjx.util.LogUtils;
import com.baosight.hpjx.util.MapUtils;
import com.baosight.hpjx.util.StringUtils;
import com.baosight.iplat4j.core.ei.EiBlock;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import java.util.Arrays;
import java.util.Map;
/**
* 新增修改
*
* @author:songx
* @date:2022/7/11,11:08
*/
public class ServiceHPFW007B 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 {
HPFW007 fFw007 = MapUtils.toDaoEPBase(inInfo, HPFW007.class);
fFw007.setFolDate(DateUtils.formatShort(fFw007.getFolDate()));
if (StringUtils.isBlank(fFw007.getFolNo())) {
this.add(fFw007);
} else {
this.modify(fFw007);
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 新增
*
* @param fFw007
*/
private void add(HPFW007 fFw007) {
fFw007.setFolNo(SequenceGenerator.getNextSequence(HPConstant.SequenceId.FOL_NO));
fFw007.setStatus(HPConstant.dealStatus.S0);
fFw007.setDeleteFlag(CommonConstant.YesNo.NO_0);
DaoUtils.insert(HPFW007.INSERT, fFw007);
}
/**
* 修改数据
*
* @param fFw007
*/
private void modify(HPFW007 fFw007) {
HPFW007 dbFw007 = HpFwUtils.HpFw007.lockAndGet(fFw007);
this.checkData(fFw007, dbFw007);
DaoUtils.update(HPFW007.UPDATE, fFw007);
}
/**
* 设置信息
*
* @param inInfo
*/
public void setBaseInfo(EiInfo inInfo) {
Map queryRow = EiInfoUtils.getFirstRow(inInfo);
String folNo = MapUtils.getString(queryRow, HPFW007.FIELD_FOL_NO);
if (StringUtils.isBlank(folNo)) {
return;
}
EiBlock resultBlock = new EiBlock(EiConstant.resultBlock);
resultBlock.addRow(HpFwTools.HpFw007.get(folNo));
resultBlock.addBlockMeta(new HPFW007().eiMetadata);
inInfo.setBlock(resultBlock);
}
/**
* 数据校验
*
* @param fFw007
* @param dbFw002
*/
private void checkData(HPFW007 fFw007, HPFW007 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(), HPConstant.dealStatus.S0,
String.format("回访单【%s】不是\"待回访\"状态,不允许操作", folNo));
}
}
......@@ -18,6 +18,7 @@
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 -->
......@@ -133,14 +134,15 @@
AFTER_SALE_NO, <!-- 售后单号 -->
AFTER_SALE_TYPE, <!-- 售后方式 -->
URGENCY, <!-- 紧急程度 -->
AFTER_SALE_CONTENT, <!-- 售后内容 -->
CUSTOM_ID, <!-- 客户ID -->
CUSTOM_NAME, <!-- 客户名称 -->
DEAL_USER_ID, <!-- 处理人ID -->
DEAL_USER_NAME <!-- 处理人名称 -->
) VALUES (
#companyCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#,
#updatedTime#, #deleteFlag#, #status#, #afterSaleDate#, #afterSaleNo#, #afterSaleType#, #urgency#, #customId#,
#customName#, #dealUserId#, #dealUserName#)
#updatedTime#, #deleteFlag#, #status#, #afterSaleDate#, #afterSaleNo#, #afterSaleType#, #urgency#,
#afterSaleContent#, #customId#, #customName#, #dealUserId#, #dealUserName#)
</insert>
<delete id="delete">
......@@ -153,6 +155,7 @@
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"/>
......
......@@ -18,10 +18,12 @@
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_USER_NAME as "dealUserName", <!-- 执行人名称 -->
DEAL_CONTENT as "dealContent" <!-- 客户反馈 -->
</sql>
<sql id="condition">
......@@ -132,13 +134,14 @@
CARE_NO, <!-- 关怀单号 -->
CARE_WAY, <!-- 关怀方式 -->
CARE_TYPE, <!-- 关怀类型 -->
CARE_CONTENT, <!-- 关怀内容 -->
CUSTOM_ID, <!-- 客户ID -->
CUSTOM_NAME, <!-- 客户名称 -->
DEAL_USER_ID, <!-- 执行人ID -->
DEAL_USER_NAME <!-- 执行人名称 -->
) VALUES (
#companyCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#,
#updatedTime#, #deleteFlag#, #status#, #careDate#, #careNo#, #careWay#, #careType#,
#updatedTime#, #deleteFlag#, #status#, #careDate#, #careNo#, #careWay#, #careType#, #careContent#,
#customId#, #customName#, #dealUserId#, #dealUserName#)
</insert>
......@@ -153,6 +156,7 @@
CARE_NO = #careNo#, <!-- 关怀单号 -->
CARE_WAY = #careWay#, <!-- 关怀方式 -->
CARE_TYPE = #careType#, <!-- 关怀类型 -->
CARE_CONTENT = #careContent#, <!-- 关怀内容 -->
CUSTOM_ID = #customId#, <!-- 客户ID -->
CUSTOM_NAME = #customName#, <!-- 客户名称 -->
<include refid="SqlBase.updateRevise"/>
......@@ -174,6 +178,7 @@
STATUS = #status#,
DEAL_USER_ID = #dealUserId#, <!-- 处理人ID -->
DEAL_USER_NAME = #dealUserName#, <!-- 处理人名称 -->
DEAL_CONTENT = #dealContent#, <!-- 处理内容 -->
<include refid="SqlBase.updateRevise"/>
WHERE CARE_NO = #careNo#
</update>
......
<?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="HPFW003">
<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-是 -->
COMPLAINT_DATE as "complaintDate", <!-- 投诉日期 -->
COMPLAINT_NO as "complaintNo", <!-- 投诉单号 -->
STATUS as "status", <!-- 状态 -->
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"/>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
CREATED_BY = #createdBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdName">
CREATED_NAME = #createdName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
CREATED_TIME = #createdTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy">
UPDATED_BY = #updatedBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedName">
UPDATED_NAME = #updatedName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime">
UPDATED_TIME = #updatedTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="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.hpjx.hp.fw.domain.HPFW003">
SELECT
<include refid="column"/>
FROM ${hpjxSchema}.T_HPFW003
WHERE 1=1
<include refid="condition"/>
<include refid="orderBy"/>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hpjxSchema}.T_HPFW003 WHERE 1=1
<include refid="condition"/>
</select>
<insert id="insert">
INSERT INTO ${hpjxSchema}.T_HPFW003 (
COMPANY_CODE, <!-- 公司编码 -->
DEP_CODE, <!-- 部门编码 -->
CREATED_BY, <!-- 创建人 -->
CREATED_NAME, <!-- 创建人名称 -->
CREATED_TIME, <!-- 创建时间 -->
UPDATED_BY, <!-- 修改人 -->
UPDATED_NAME, <!-- 修改人名称 -->
UPDATED_TIME, <!-- 修改时间 -->
DELETE_FLAG, <!-- 是否删除 0-否1-是 -->
COMPLAINT_DATE, <!-- 投诉日期 -->
COMPLAINT_NO, <!-- 投诉单号 -->
STATUS, <!-- 状态 -->
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 (
#companyCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#,
#updatedName#, #updatedTime#, #deleteFlag#, #complaintDate#, #complaintNo#, #status#,
#customId#, #customName#, #complaintWay#, #complaintType#, #complaintContent#,
#complaintUserId#, #complaintUserName#, #acceptUserId#, #acceptUserName#,
#lastDate#, #dealContent#, #dealUserId#, #dealUserName#)
</insert>
<delete id="delete">
UPDATE ${hpjxSchema}.T_HPFW003 SET DELETE_FLAG = 1 WHERE COMPLAINT_NO = #complaintNo#
</delete>
<update id="update">
UPDATE ${hpjxSchema}.T_HPFW003
SET
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 ${hpjxSchema}.T_HPFW003
SET CREATED_TIME = CREATED_TIME
WHERE 1=1
<include refid="idCondition"/>
</update>
<!-- 修改 -->
<update id="updateDeal">
UPDATE ${hpjxSchema}.T_HPFW003
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="HPFW004">
<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", <!-- 状态 -->
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_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"/>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
CREATED_BY = #createdBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdName">
CREATED_NAME = #createdName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
CREATED_TIME = #createdTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy">
UPDATED_BY = #updatedBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedName">
UPDATED_NAME = #updatedName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime">
UPDATED_TIME = #updatedTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="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.hpjx.hp.fw.domain.HPFW004">
SELECT
<include refid="column"/>
FROM ${hpjxSchema}.T_HPFW004
WHERE 1=1
<include refid="condition"/>
<include refid="orderBy"/>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hpjxSchema}.T_HPFW004 WHERE 1=1
<include refid="condition"/>
</select>
<insert id="insert">
INSERT INTO ${hpjxSchema}.T_HPFW004 (
COMPANY_CODE, <!-- 公司编码 -->
DEP_CODE, <!-- 部门编码 -->
CREATED_BY, <!-- 创建人 -->
CREATED_NAME, <!-- 创建人名称 -->
CREATED_TIME, <!-- 创建时间 -->
UPDATED_BY, <!-- 修改人 -->
UPDATED_NAME, <!-- 修改人名称 -->
UPDATED_TIME, <!-- 修改时间 -->
DELETE_FLAG, <!-- 是否删除 0-否1-是 -->
STATUS, <!-- 状态 -->
SUGGEST_DATE, <!-- 建议日期 -->
SUGGEST_NO, <!-- 建议单号 -->
CUSTOM_ID, <!-- 客户ID -->
CUSTOM_NAME, <!-- 客户名称 -->
SUGGEST_WAY, <!-- 建议方式 -->
SUGGEST_TYPE, <!-- 建议类型 -->
SUGGEST_CONTENT, <!-- 建议内容 -->
DEAL_CONTENT, <!-- 处理结果 -->
DEAL_USER_ID, <!-- 处理人ID -->
DEAL_USER_NAME <!-- 处理人名称 -->
) VALUES (
#companyCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#,
#updatedTime#, #deleteFlag#, #status#, #suggestDate#, #suggestNo#, #customId#, #customName#,
#suggestWay#, #suggestType#, #suggestContent#, #dealContent#, #dealUserId#, #dealUserName#
)
</insert>
<delete id="delete">
UPDATE ${hpjxSchema}.T_HPFW004 SET DELETE_FLAG = 1 WHERE SUGGEST_NO = #suggestNo#
</delete>
<update id="update">
UPDATE ${hpjxSchema}.T_HPFW004
SET
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 ${hpjxSchema}.T_HPFW004
SET CREATED_TIME = CREATED_TIME
WHERE 1=1
<include refid="idCondition"/>
</update>
<!-- 修改 -->
<update id="updateDeal">
UPDATE ${hpjxSchema}.T_HPFW004
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="HPFW007">
<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-是 -->
FOL_DATE as "folDate", <!-- 回访日期 -->
FOL_NO as "folNo", <!-- 回访单号 -->
DEL_ORDER_NO as "delOrderNo", <!-- 发货单号 -->
FOL_WAY as "folWay", <!-- 回访方式 1-电话回访 2-上门回访 -->
STATUS as "status", <!-- 回访状态 0-未回访 1-已回访 -->
CUSTOM_ID as "customId", <!-- 客户ID -->
CUSTOM_NAME as "customName", <!-- 客户名称 -->
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"/>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
CREATED_BY = #createdBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdName">
CREATED_NAME = #createdName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
CREATED_TIME = #createdTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy">
UPDATED_BY = #updatedBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedName">
UPDATED_NAME = #updatedName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime">
UPDATED_TIME = #updatedTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="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.hpjx.hp.fw.domain.HPFW007">
SELECT
<include refid="column"/>
FROM ${hpjxSchema}.T_HPFW007 WHERE 1=1
<include refid="condition"/>
<include refid="orderBy"/>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hpjxSchema}.T_HPFW007 WHERE 1=1
<include refid="condition"/>
</select>
<insert id="insert">
INSERT INTO ${hpjxSchema}.T_HPFW007 (
COMPANY_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-已回访 -->
CUSTOM_ID, <!-- 客户ID -->
CUSTOM_NAME, <!-- 客户名称 -->
DEAL_CONTENT, <!-- 回访内容 -->
DEAL_USER_ID, <!-- 回访人ID -->
DEAL_USER_NAME <!-- 回访人名称 -->
) VALUES (
#companyCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#,
#updatedName#, #updatedTime#, #deleteFlag#, #folDate#, #folNo#, #delOrderNo#,
#folWay#, #status#, #customId#, #customName#, #dealContent#, #dealUserId#,
#dealUserName#
)
</insert>
<delete id="delete">
UPDATE ${hpjxSchema}.T_HPFW007 SET DELETE_FLAG = 1 WHERE FOL_NO = #folNo#
</delete>
<update id="update">
UPDATE ${hpjxSchema}.T_HPFW007
SET
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 ${hpjxSchema}.T_HPFW007
SET CREATED_TIME = CREATED_TIME
WHERE 1=1
<include refid="idCondition"/>
</update>
<!-- 修改 -->
<update id="updateDeal">
UPDATE ${hpjxSchema}.T_HPFW007
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.hpjx.hp.fw.tools;
import com.baosight.hpjx.core.dao.DaoBase;
import com.baosight.hpjx.hp.fw.constant.HpFwSqlConstant;
import com.baosight.hpjx.hp.fw.constant.HpFwSqlConst;
import com.baosight.hpjx.hp.fw.domain.HPFW001;
import com.baosight.hpjx.hp.fw.domain.HPFW002;
import com.baosight.hpjx.hp.fw.domain.HPFW003;
import com.baosight.hpjx.hp.fw.domain.HPFW004;
import com.baosight.hpjx.hp.fw.domain.HPFW007;
import com.baosight.hpjx.util.AssertUtils;
import org.apache.commons.collections.CollectionUtils;
......@@ -33,7 +36,7 @@ public class HpFwTools {
AssertUtils.isEmpty(afterSaleNo, "售后单号不能为空!");
Map<String, Object> paramMap = new HashMap<>();
paramMap.put(HPFW001.FIELD_AFTER_SALE_NO, afterSaleNo);
DaoBase.getInstance().update(HpFwSqlConstant.HpFw001.LOCK, paramMap);
DaoBase.getInstance().update(HpFwSqlConst.HpFw001.LOCK, paramMap);
}
/**
......@@ -45,7 +48,7 @@ public class HpFwTools {
AssertUtils.isEmpty(afterSaleNos, "售后单号不能为空!");
Map<String, Object> paramMap = new HashMap<>();
paramMap.put("afterSaleNos", afterSaleNos);
DaoBase.getInstance().update(HpFwSqlConstant.HpFw001.LOCK, paramMap);
DaoBase.getInstance().update(HpFwSqlConst.HpFw001.LOCK, paramMap);
}
/**
......@@ -103,7 +106,7 @@ public class HpFwTools {
AssertUtils.isEmpty(careNo, "关怀单号不能为空!");
Map<String, Object> paramMap = new HashMap<>();
paramMap.put(HPFW002.FIELD_CARE_NO, careNo);
DaoBase.getInstance().update(HpFwSqlConstant.HpFw002.LOCK, paramMap);
DaoBase.getInstance().update(HpFwSqlConst.HpFw002.LOCK, paramMap);
}
/**
......@@ -115,7 +118,7 @@ public class HpFwTools {
AssertUtils.isEmpty(careNos, "关怀单号不能为空!");
Map<String, Object> paramMap = new HashMap<>();
paramMap.put("careNos", careNos);
DaoBase.getInstance().update(HpFwSqlConstant.HpFw002.LOCK, paramMap);
DaoBase.getInstance().update(HpFwSqlConst.HpFw002.LOCK, paramMap);
}
/**
......@@ -158,4 +161,214 @@ public class HpFwTools {
}
/**
* @author:songx
* @date:2024/9/24,18:08
*/
public static class HpFw003 {
/**
* 锁.
*
* @param complaintNo
*/
public static void lock(String complaintNo) {
AssertUtils.isEmpty(complaintNo, "投诉单号不能为空!");
Map<String, Object> paramMap = new HashMap<>();
paramMap.put(HPFW003.FIELD_COMPLAINT_NO, complaintNo);
DaoBase.getInstance().update(HpFwSqlConst.HpFw003.LOCK, paramMap);
}
/**
* 锁.
*
* @param complaintNos
*/
public static void lock(List<String> complaintNos) {
AssertUtils.isEmpty(complaintNos, "投诉单号不能为空!");
Map<String, Object> paramMap = new HashMap<>();
paramMap.put("complaintNos", complaintNos);
DaoBase.getInstance().update(HpFwSqlConst.HpFw003.LOCK, paramMap);
}
/**
* 查询
*
* @param complaintNo
* @return
*/
public static HPFW003 get(String complaintNo) {
AssertUtils.isEmpty(complaintNo, "投诉单号不能为空!");
Map<String, Object> paramMap = new HashMap();
paramMap.put(HPFW003.FIELD_COMPLAINT_NO, complaintNo);
List<HPFW003> results = DaoBase.getInstance().query(HPFW003.QUERY, paramMap);
return CollectionUtils.isEmpty(results) ? null : results.get(0);
}
/**
* 查询
*
* @param complaintNos
* @return
*/
public static List<HPFW003> list(List<String> complaintNos) {
AssertUtils.isEmpty(complaintNos, "投诉单号不能为空");
Map<String, Object> paramMap = new HashMap();
paramMap.put("complaintNos", complaintNos);
return DaoBase.getInstance().query(HPFW003.QUERY, paramMap);
}
/**
* 查询
*
* @param complaintNos
* @return
*/
public static Map<String, HPFW003> map(List<String> complaintNos) {
List<HPFW003> results = list(complaintNos);
return results.stream().collect(Collectors.toMap(HPFW003::getComplaintNo, item -> item));
}
}
/**
* @author:songx
* @date:2024/9/24,18:08
*/
public static class HpFw004 {
/**
* 锁.
*
* @param suggestNo
*/
public static void lock(String suggestNo) {
AssertUtils.isEmpty(suggestNo, "建议单号不能为空!");
Map<String, Object> paramMap = new HashMap<>();
paramMap.put(HPFW004.FIELD_SUGGEST_NO, suggestNo);
DaoBase.getInstance().update(HpFwSqlConst.HpFw004.LOCK, paramMap);
}
/**
* 锁.
*
* @param suggestNos
*/
public static void lock(List<String> suggestNos) {
AssertUtils.isEmpty(suggestNos, "建议号不能为空!");
Map<String, Object> paramMap = new HashMap<>();
paramMap.put("suggestNos", suggestNos);
DaoBase.getInstance().update(HpFwSqlConst.HpFw004.LOCK, paramMap);
}
/**
* 查询
*
* @param suggestNo
* @return
*/
public static HPFW004 get(String suggestNo) {
AssertUtils.isEmpty(suggestNo, "建议单号不能为空!");
Map<String, Object> paramMap = new HashMap();
paramMap.put(HPFW004.FIELD_SUGGEST_NO, suggestNo);
List<HPFW004> results = DaoBase.getInstance().query(HPFW004.QUERY, paramMap);
return CollectionUtils.isEmpty(results) ? null : results.get(0);
}
/**
* 查询
*
* @param suggestNos
* @return
*/
public static List<HPFW004> list(List<String> suggestNos) {
AssertUtils.isEmpty(suggestNos, "建议单号不能为空");
Map<String, Object> paramMap = new HashMap();
paramMap.put("suggestNos", suggestNos);
return DaoBase.getInstance().query(HPFW004.QUERY, paramMap);
}
/**
* 查询
*
* @param suggestNos
* @return
*/
public static Map<String, HPFW004> map(List<String> suggestNos) {
List<HPFW004> results = list(suggestNos);
return results.stream().collect(Collectors.toMap(HPFW004::getSuggestNo, item -> item));
}
}
/**
* @author:songx
* @date:2024/9/24,18:08
*/
public static class HpFw007 {
/**
* 锁.
*
* @param folNo
*/
public static void lock(String folNo) {
AssertUtils.isEmpty(folNo, "关怀单号不能为空!");
Map<String, Object> paramMap = new HashMap<>();
paramMap.put(HPFW007.FIELD_FOL_NO, folNo);
DaoBase.getInstance().update(HpFwSqlConst.HpFw007.LOCK, paramMap);
}
/**
* 锁.
*
* @param folNos
*/
public static void lock(List<String> folNos) {
AssertUtils.isEmpty(folNos, "回访单号不能为空!");
Map<String, Object> paramMap = new HashMap<>();
paramMap.put("folNos", folNos);
DaoBase.getInstance().update(HpFwSqlConst.HpFw007.LOCK, paramMap);
}
/**
* 查询
*
* @param folNo
* @return
*/
public static HPFW007 get(String folNo) {
AssertUtils.isEmpty(folNo, "回访单号不能为空!");
Map<String, Object> paramMap = new HashMap();
paramMap.put(HPFW007.FIELD_FOL_NO, folNo);
List<HPFW007> results = DaoBase.getInstance().query(HPFW007.QUERY, paramMap);
return CollectionUtils.isEmpty(results) ? null : results.get(0);
}
/**
* 查询
*
* @param folNos
* @return
*/
public static List<HPFW007> list(List<String> folNos) {
AssertUtils.isEmpty(folNos, "回访单号不能为空");
Map<String, Object> paramMap = new HashMap();
paramMap.put("folNos", folNos);
return DaoBase.getInstance().query(HPFW007.QUERY, paramMap);
}
/**
* 查询
*
* @param folNos
* @return
*/
public static Map<String, HPFW007> map(List<String> folNos) {
List<HPFW007> results = list(folNos);
return results.stream().collect(Collectors.toMap(HPFW007::getFolNo, item -> item));
}
}
}
......@@ -2,6 +2,9 @@ package com.baosight.hpjx.hp.fw.utils;
import com.baosight.hpjx.hp.fw.domain.HPFW001;
import com.baosight.hpjx.hp.fw.domain.HPFW002;
import com.baosight.hpjx.hp.fw.domain.HPFW003;
import com.baosight.hpjx.hp.fw.domain.HPFW004;
import com.baosight.hpjx.hp.fw.domain.HPFW007;
import com.baosight.hpjx.hp.fw.tools.HpFwTools;
import com.baosight.hpjx.util.ObjectUtils;
......@@ -101,4 +104,136 @@ public class HpFwUtils {
return HpFwTools.HpFw002.get(careNo);
}
}
/**
* @author:songx
* @date:2024/9/24,18:07
*/
public static class HpFw003 {
/**
* 锁并获取数据
*
* @param fFw003s
* @return
*/
public static Map<String, HPFW003> lockAndGet(List<HPFW003> fFw003s) {
List<String> complaintNos = ObjectUtils.listEpKey(fFw003s, HPFW003.FIELD_COMPLAINT_NO);
// 锁
HpFwTools.HpFw003.lock(complaintNos);
// 查询数据
return HpFwTools.HpFw003.map(complaintNos);
}
/**
* 锁并获取数据
*
* @param fFw003
* @return
*/
public static HPFW003 lockAndGet(HPFW003 fFw003) {
return lockAndGet(fFw003.getComplaintNo());
}
/**
* 锁并获取数据
*
* @param complaintNo
* @return
*/
public static HPFW003 lockAndGet(String complaintNo) {
// 锁
HpFwTools.HpFw003.lock(complaintNo);
// 查询数据
return HpFwTools.HpFw003.get(complaintNo);
}
}
/**
* @author:songx
* @date:2024/9/24,18:07
*/
public static class HpFw004 {
/**
* 锁并获取数据
*
* @param fFw004s
* @return
*/
public static Map<String, HPFW004> lockAndGet(List<HPFW004> fFw004s) {
List<String> suggests = ObjectUtils.listEpKey(fFw004s, HPFW004.FIELD_SUGGEST_NO);
// 锁
HpFwTools.HpFw004.lock(suggests);
// 查询数据
return HpFwTools.HpFw004.map(suggests);
}
/**
* 锁并获取数据
*
* @param fFw004
* @return
*/
public static HPFW004 lockAndGet(HPFW004 fFw004) {
return lockAndGet(fFw004.getSuggestNo());
}
/**
* 锁并获取数据
*
* @param suggestNo
* @return
*/
public static HPFW004 lockAndGet(String suggestNo) {
// 锁
HpFwTools.HpFw004.lock(suggestNo);
// 查询数据
return HpFwTools.HpFw004.get(suggestNo);
}
}
/**
* @author:songx
* @date:2024/9/24,18:07
*/
public static class HpFw007 {
/**
* 锁并获取数据
*
* @param fFw007s
* @return
*/
public static Map<String, HPFW007> lockAndGet(List<HPFW007> fFw007s) {
List<String> folNos = ObjectUtils.listEpKey(fFw007s, HPFW007.FIELD_FOL_NO);
// 锁
HpFwTools.HpFw007.lock(folNos);
// 查询数据
return HpFwTools.HpFw007.map(folNos);
}
/**
* 锁并获取数据
*
* @param fFw007
* @return
*/
public static HPFW007 lockAndGet(HPFW007 fFw007) {
return lockAndGet(fFw007.getFolNo());
}
/**
* 锁并获取数据
*
* @param folNo
* @return
*/
public static HPFW007 lockAndGet(String folNo) {
// 锁
HpFwTools.HpFw007.lock(folNo);
// 查询数据
return HpFwTools.HpFw007.get(folNo);
}
}
}
......@@ -4,12 +4,9 @@ import com.baosight.hpjx.aspect.annotation.OperationLogAnnotation;
import com.baosight.hpjx.common.DdynamicEnum;
import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.core.security.UserSessionUtils;
import com.baosight.hpjx.hp.constant.HPConstant;
import com.baosight.hpjx.hp.sc.domain.HPSC001;
import com.baosight.hpjx.hp.xs.domain.HPXS007;
import com.baosight.hpjx.util.CommonMethod;
import com.baosight.hpjx.util.DateUtils;
import com.baosight.hpjx.util.EiInfoUtils;
import com.baosight.hpjx.util.LogUtils;
import com.baosight.hpjx.util.contants.ACConstants;
import com.baosight.iplat4j.core.ei.EiBlock;
......@@ -17,17 +14,15 @@ 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 com.baosight.iplat4j.core.service.soa.XLocalManager;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import java.util.*;
/**
*
* @author:songx
* @date:2024/9/26,14:32
*/
public class ServiceHPXS007 extends ServiceBase {
/**
* 画面初始化.
*/
......@@ -44,7 +39,6 @@ public class ServiceHPXS007 extends ServiceBase {
return inInfo;
}
/**
* 查询操作.
*/
......@@ -55,7 +49,6 @@ public class ServiceHPXS007 extends ServiceBase {
DateUtils.formatShort(inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HPXS007.FIELD_FOL_DATE)));
EiInfo outInfo = super.query(inInfo, HPXS007.QUERY, new HPXS007());
return outInfo;
}
/**
......@@ -79,8 +72,7 @@ public class ServiceHPXS007 extends ServiceBase {
this.modify(hpsc007);
}
}
//inInfo = this.query(inInfo);
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据保存成功!");
} catch (Exception e) {
......@@ -96,7 +88,7 @@ public class ServiceHPXS007 extends ServiceBase {
* @param hpsc007
* @throws Exception
*/
private void add(HPXS007 hpsc007) throws Exception {
private void add(HPXS007 hpsc007) {
DaoUtils.insert(HPXS007.INSERT, hpsc007);
}
......
package com.baosight.hpjx.hp.xt.constant;
/**
* @author:songx
* @date:2024/9/24,17:53
*/
public class HpXtConst {
/**
* HPFW001 定义
*
* @author:songx
* @date:2024/9/24,17:54
*/
public static class HpFw001 {
}
/**
* HPFW001 定义
*
* @author:songx
* @date:2024/9/24,17:54
*/
public static class HpFw002 {
}
}
package com.baosight.hpjx.hp.xt.constant;
/**
* @author:songx
* @date:2024/9/24,18:09
*/
public class HpXtSqlConst {
/**
* @author:songx
* @date:2024/8/29,15:54
*/
public static class HpXt011 {
// 锁
public static final String LOCK = "HPXT011.lock";
// 发布
public static final String UPDATE_SUBMIT = "HPXT011.updateSubmit";
}
}
package com.baosight.hpjx.hp.xt.service;
import com.baosight.hpjx.aspect.annotation.OperationLogAnnotation;
import com.baosight.hpjx.common.DdynamicEnum;
import com.baosight.hpjx.common.InventTypeEnum;
import com.baosight.hpjx.core.constant.CommonConstant;
import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.hp.cg.domain.HPCG001;
import com.baosight.hpjx.hp.cg.domain.HPCG002;
import com.baosight.hpjx.hp.cg.domain.HPCG002A;
import com.baosight.hpjx.hp.constant.HPConstant;
import com.baosight.hpjx.hp.kc.domain.HPKC010;
import com.baosight.hpjx.hp.pz.domain.HPPZ006;
import com.baosight.hpjx.hp.pz.tools.HPPZTools;
import com.baosight.hpjx.hp.sb.domain.HPSB003;
import com.baosight.hpjx.hp.xt.domain.HPXT001;
import com.baosight.hpjx.util.*;
import com.baosight.hpjx.util.contants.ACConstants;
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.exception.PlatException;
import com.baosight.iplat4j.core.resource.I18nMessages;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import lombok.val;
import org.apache.commons.collections.CollectionUtils;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
*
*/
public class ServiceHPXT001 extends ServiceEPBase {
@Override
public EiInfo initLoad(EiInfo inInfo) {
return inInfo;
}
@Override
public EiInfo query(EiInfo inInfo) {
try {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HPXT001.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
inInfo = super.query(inInfo, HPXT001.QUERY, new HPXT001());
// List sum = dao.query(HPSqlConstant.HPKC001.QUERY_SUM, queryRow);
// inInfo.getBlock(EiConstant.resultBlock).set(EiConstant.COLUMN_TOTAL_SUM, sum.get(0));
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
@OperationLogAnnotation(operModul = "车辆申请",operType = "删除",operDesc = "删除操作")
@Override
public EiInfo delete(EiInfo inInfo) {
int i = 0;
try {
HPXT001 hpxt001 = new HPXT001();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
for (i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
hpxt001.fromMap(map);
hpxt001.setDeleteFlag(CommonConstant.YesNo.YES_1);
DaoUtils.update(HPXT001.DELETE_FLAG, hpxt001);
}
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsgByKey("ep.1000", new String[]{String.valueOf(i), I18nMessages.getText("label.delete", "删除")});
} catch (PlatException e) {
e.printStackTrace();
inInfo.setStatus(EiConstant.STATUS_FAILURE);
ErrorCodeUtils.handleDeleteException(inInfo,i,e);
logError("删除失败", e.getMessage());
return inInfo;
}
return inInfo;
}
@OperationLogAnnotation(operModul = "车辆申请",operType = "保存",operDesc = "操作")
public EiInfo save(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 写入数据
for (Map resultRow : resultRows) {
HPXT001 hpxt001 = new HPXT001();
hpxt001.fromMap(resultRow);
if (hpxt001.getId() == null || hpxt001.getId() == 0) {
this.add(hpxt001);
} else {
this.modify(hpxt001);
}
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 新增操作
*/
public void add(HPXT001 hpxt001) {
this.setBaseInfo(hpxt001);
//生成车辆申请单号
hpxt001.setApplyNo(SequenceGenerator.getNextSequence(HPConstant.SequenceId.VEHICLE_APPLY_NO));
DaoUtils.insert(HPXT001.INSERT, hpxt001);
}
/**
* 设置基础信息
*
* @param hpxt001
*/
private void setBaseInfo(HPXT001 hpxt001) {
// 去除日期字符串中的-
hpxt001.setApplyDate(StringUtil.removeHorizontalLine(hpxt001.getApplyDate()));
hpxt001.setStartTime(StringUtil.removeHorizontalLine(hpxt001.getStartTime()));
hpxt001.setEndTime(StringUtil.removeHorizontalLine(hpxt001.getEndTime()));
}
/**
* 修改操作
*/
public void modify(HPXT001 hpxt001) {
DaoUtils.update(HPXT001.UPDATE, hpxt001);
}
@OperationLogAnnotation(operModul = "车辆申请",operType = "提交",operDesc = "提交审批操作")
public EiInfo approve(EiInfo inInfo){
int i = 0;
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (Map resultRow : resultRows) {
HPXT001 hpxt001 = new HPXT001();
hpxt001.fromMap(resultRow);
hpxt001.setProApplyStatus(CommonConstant.YesNo.YES_1);
DaoUtils.update(HPXT001.UPDATE_PRO_APPLY_STATUS,hpxt001);
}
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsgByKey("ep.1000", new String[]{String.valueOf(i), I18nMessages.getText("label.approve", "提交")});
} catch (PlatException e) {
e.printStackTrace();
inInfo.setStatus(EiConstant.STATUS_FAILURE);
ErrorCodeUtils.handleDeleteException(inInfo,i,e);
logError("提交失败", e.getMessage());
return inInfo;
}
return inInfo;
}
@OperationLogAnnotation(operModul = "车辆申请",operType = "返还",operDesc = "返还操作")
public EiInfo returnStatus(EiInfo inInfo){
try {
String id = String.valueOf(inInfo.getAttr().get("id"));
HPXT001 hpxt001 = new HPXT001();
hpxt001.setId(Long.parseLong(id));
hpxt001.setStatus(CommonConstant.YesNo.YES_1);
DaoUtils.update(HPXT001.UPDATE_STATUS, hpxt001);
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
} catch (PlatException e) {
e.printStackTrace();
inInfo.setStatus(EiConstant.STATUS_FAILURE);
logError("返还失败", e.getMessage());
return inInfo;
}
return inInfo;
}
}
package com.baosight.hpjx.hp.xt.service;
import com.baosight.hpjx.aspect.annotation.OperationLogAnnotation;
import com.baosight.hpjx.core.constant.CommonConstant;
import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.hp.ds.domain.HPDS002;
import com.baosight.hpjx.hp.xt.domain.HPXT099;
import com.baosight.hpjx.util.FileUtils;
import com.baosight.hpjx.util.LogUtils;
import com.baosight.iplat4j.core.ProjectInfo;
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.ServiceEPBase;
import com.baosight.iplat4j.core.service.soa.XServiceManager;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @author:songx
* @date:2024/1/25,15:25
*/
public class ServiceHPXT001A extends ServiceEPBase {
/**
* 画面初始化
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "附件清单",operType = "查询",operDesc = "车辆管理-附件清单A-初始化")
public EiInfo initLoad(EiInfo inInfo) {
try {
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HPXT099().eiMetadata);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询操作
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "附件清单",operType = "查询",operDesc = "车辆管理-附件清单A-查询")
@Override
public EiInfo query(EiInfo inInfo) {
try {
// 项目环境
String projectEnv = ProjectInfo.getProjectEnv();
if (CommonConstant.ProjectEnv.RUN.equalsIgnoreCase(projectEnv)) {
inInfo = super.query(inInfo, "HPXT099.queryRun", new HPXT099());
} else {
inInfo = super.query(inInfo, "HPXT099.queryDev", new HPXT099());
}
} catch (Throwable e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
}
package com.baosight.hpjx.hp.xt.service;
import com.baosight.hpjx.aspect.annotation.OperationLogAnnotation;
import com.baosight.hpjx.core.constant.CommonConstant;
import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.hp.xt.domain.HPXT002;
import com.baosight.hpjx.util.ErrorCodeUtils;
import com.baosight.hpjx.util.LogUtils;
import com.baosight.hpjx.util.StringUtil;
import com.baosight.hpjx.util.contants.ACConstants;
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.exception.PlatException;
import com.baosight.iplat4j.core.resource.I18nMessages;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import java.util.List;
import java.util.Map;
/**
*
*/
public class ServiceHPXT002 extends ServiceEPBase {
@Override
public EiInfo initLoad(EiInfo inInfo) {
return inInfo;
}
@Override
public EiInfo query(EiInfo inInfo) {
try {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HPXT002.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
inInfo = super.query(inInfo, HPXT002.QUERY, new HPXT002());
// List sum = dao.query(HPSqlConstant.HPKC001.QUERY_SUM, queryRow);
// inInfo.getBlock(EiConstant.resultBlock).set(EiConstant.COLUMN_TOTAL_SUM, sum.get(0));
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
@OperationLogAnnotation(operModul = "车辆保险",operType = "删除",operDesc = "删除操作")
@Override
public EiInfo delete(EiInfo inInfo) {
int i = 0;
try {
HPXT002 hpxt002 = new HPXT002();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
for (i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
hpxt002.fromMap(map);
hpxt002.setDeleteFlag(CommonConstant.YesNo.YES_1);
DaoUtils.update(HPXT002.DELETE_FLAG, hpxt002);
}
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsgByKey("ep.1000", new String[]{String.valueOf(i), I18nMessages.getText("label.delete", "删除")});
} catch (PlatException e) {
e.printStackTrace();
inInfo.setStatus(EiConstant.STATUS_FAILURE);
ErrorCodeUtils.handleDeleteException(inInfo,i,e);
logError("删除失败", e.getMessage());
return inInfo;
}
return inInfo;
}
@OperationLogAnnotation(operModul = "车辆保险",operType = "保存",operDesc = "操作")
public EiInfo save(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 写入数据
for (Map resultRow : resultRows) {
HPXT002 hpxt002 = new HPXT002();
hpxt002.fromMap(resultRow);
if (hpxt002.getId() == null || hpxt002.getId() == 0) {
this.add(hpxt002);
} else {
this.modify(hpxt002);
}
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 新增操作
*/
public void add(HPXT002 hpxt002) {
this.setBaseInfo(hpxt002);
DaoUtils.insert(HPXT002.INSERT, hpxt002);
}
/**
* 设置基础信息
*
* @param hpxt002
*/
private void setBaseInfo(HPXT002 hpxt002) {
// 去除日期字符串中的-
hpxt002.setApplyDate(StringUtil.removeHorizontalLine(hpxt002.getApplyDate()));
hpxt002.setApplyStatus(CommonConstant.YesNo.NO_0);
}
/**
* 修改操作
*/
public void modify(HPXT002 hpxt002) {
DaoUtils.update(HPXT002.UPDATE, hpxt002);
}
}
package com.baosight.hpjx.hp.xt.service;
import com.baosight.hpjx.aspect.annotation.OperationLogAnnotation;
import com.baosight.hpjx.core.constant.CommonConstant;
import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.hp.xt.domain.HPXT002A;
import com.baosight.hpjx.util.ErrorCodeUtils;
import com.baosight.hpjx.util.LogUtils;
import com.baosight.hpjx.util.StringUtil;
import com.baosight.hpjx.util.contants.ACConstants;
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.exception.PlatException;
import com.baosight.iplat4j.core.resource.I18nMessages;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import java.util.List;
import java.util.Map;
/**
*
*/
public class ServiceHPXT002A extends ServiceEPBase {
@Override
public EiInfo initLoad(EiInfo inInfo) {
return inInfo;
}
@Override
public EiInfo query(EiInfo inInfo) {
try {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HPXT002A.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
inInfo = super.query(inInfo, HPXT002A.QUERY, new HPXT002A());
// List sum = dao.query(HPSqlConstant.HPKC001.QUERY_SUM, queryRow);
// inInfo.getBlock(EiConstant.resultBlock).set(EiConstant.COLUMN_TOTAL_SUM, sum.get(0));
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
@OperationLogAnnotation(operModul = "车辆保险详情",operType = "删除",operDesc = "删除操作")
@Override
public EiInfo delete(EiInfo inInfo) {
int i = 0;
try {
HPXT002A hpxt002A = new HPXT002A();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
for (i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
hpxt002A.fromMap(map);
hpxt002A.setDeleteFlag(CommonConstant.YesNo.YES_1);
DaoUtils.update(HPXT002A.DELETE_FLAG, hpxt002A);
}
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsgByKey("ep.1000", new String[]{String.valueOf(i), I18nMessages.getText("label.delete", "删除")});
} catch (PlatException e) {
e.printStackTrace();
inInfo.setStatus(EiConstant.STATUS_FAILURE);
ErrorCodeUtils.handleDeleteException(inInfo,i,e);
logError("删除失败", e.getMessage());
return inInfo;
}
return inInfo;
}
@OperationLogAnnotation(operModul = "车辆保险详情",operType = "保存",operDesc = "操作")
public EiInfo save(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 写入数据
for (Map resultRow : resultRows) {
HPXT002A hpxt002A = new HPXT002A();
hpxt002A.fromMap(resultRow);
if (hpxt002A.getId() == null || hpxt002A.getId() == 0) {
String hpxt002Id = inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HPXT002A.FIELD_T_HPXT002_ID);
hpxt002A.settHpxt002Id(Long.valueOf(hpxt002Id));
this.add(hpxt002A);
} else {
this.modify(hpxt002A);
}
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 新增操作
*/
public void add(HPXT002A hpxt002A) {
this.setBaseInfo(hpxt002A);
DaoUtils.insert(HPXT002A.INSERT, hpxt002A);
}
/**
* 设置基础信息
*
* @param hpxt002A
*/
private void setBaseInfo(HPXT002A hpxt002A) {
// 去除日期字符串中的-
hpxt002A.setInsuranceStartDate(StringUtil.removeHorizontalLine(hpxt002A.getInsuranceStartDate()));
hpxt002A.setInsuranceEndDate(StringUtil.removeHorizontalLine(hpxt002A.getInsuranceEndDate()));
}
/**
* 修改操作
*/
public void modify(HPXT002A hpxt002A) {
DaoUtils.update(HPXT002A.UPDATE, hpxt002A);
}
}
package com.baosight.hpjx.hp.xt.service;
import com.baosight.hpjx.core.constant.CommonConstant;
import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.core.security.UserSessionUtils;
import com.baosight.hpjx.hp.constant.HPConstant;
import com.baosight.hpjx.hp.xt.constant.HpXtSqlConst;
import com.baosight.hpjx.hp.xt.domain.HPXT011;
import com.baosight.hpjx.hp.xt.utils.HpXtUtils;
import com.baosight.hpjx.util.AssertUtils;
import com.baosight.hpjx.util.DateUtils;
import com.baosight.hpjx.util.EiInfoUtils;
import com.baosight.hpjx.util.LogUtils;
import com.baosight.hpjx.util.MapUtils;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.service.impl.ServiceBase;
import java.util.List;
import java.util.Map;
/**
* 公告管理
*
* @author:songx
* @date:2024/9/24,17:47
*/
public class ServiceHPXT011 extends ServiceBase {
/**
* 画面初始化
*
* @param inInfo
* @return
*/
@Override
public EiInfo initLoad(EiInfo inInfo) {
try {
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HPXT011().eiMetadata);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询操作.
*/
@Override
public EiInfo query(EiInfo inInfo) {
try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
queryMap.put(HPXT011.FIELD_NOTICE_DATE, DateUtils.formatShort(queryMap.get(HPXT011.FIELD_NOTICE_DATE)));
inInfo = super.query(inInfo, HPXT011.QUERY, new HPXT011());
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
/**
* 删除操作
*
* @param inInfo
* @return
*/
public EiInfo remove(EiInfo inInfo) {
try {
List<HPXT011> fXt011s = MapUtils.toDaoEPBases(inInfo, HPXT011.class);
// db数据
Map<String, HPXT011> dbXt011Map = HpXtUtils.HpXt011.lockAndGet(fXt011s);
// 数据校验
this.checkRemoveData(fXt011s, dbXt011Map);
// 保存数据
this.removeData(fXt011s);
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + fXt011s.size() + "]条数据删除成功!");
} catch (Exception e) {
LogUtils.setMsg(inInfo, e, "删除失败");
}
return inInfo;
}
/**
* 数据校验
*
* @param fXt011s
* @param dbXt011Map
*/
private void checkRemoveData(List<HPXT011> fXt011s, Map<String, HPXT011> dbXt011Map) {
for (HPXT011 fXt011 : fXt011s) {
String noticeNo = fXt011.getNoticeNo();
HPXT011 dbXt011 = dbXt011Map.get(noticeNo);
this.checkData(noticeNo, dbXt011);
}
}
/**
* 数据保存
*
* @param fXt011s
*/
private void removeData(List<HPXT011> fXt011s) {
for (HPXT011 fXt011 : fXt011s) {
fXt011.setDeleteFlag(CommonConstant.YesNo.YES_1);
DaoUtils.update(HPXT011.DELETE, fXt011.toMap());
}
}
/**
* 检查状态
*
* @param inInfo
* @return
*/
public EiInfo checkStatus(EiInfo inInfo) {
try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
String noticeNo = MapUtils.getString(queryMap, HPXT011.FIELD_NOTICE_NO);
HPXT011 dbXt011 = HpXtUtils.HpXt011.lockAndGet(noticeNo);
this.checkData(noticeNo, dbXt011);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "操作失败");
}
return inInfo;
}
/**
* 提交
*
* @param inInfo
* @return
*/
public EiInfo submit(EiInfo inInfo) {
try {
List<HPXT011> fXt011s = MapUtils.toDaoEPBases(inInfo, HPXT011.class);
// db数据
Map<String, HPXT011> dbXt011Map = HpXtUtils.HpXt011.lockAndGet(fXt011s);
// 数据校验
this.checkSubmitData(fXt011s, dbXt011Map);
// 保存数据
this.submitData(fXt011s);
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + fXt011s.size() + "]条数据提交成功!");
} catch (Exception e) {
LogUtils.setMsg(inInfo, e, "处理失败");
}
return inInfo;
}
/**
* 数据校验
*
* @param fXt011s
* @param dbXt011Map
*/
private void checkSubmitData(List<HPXT011> fXt011s, Map<String, HPXT011> dbXt011Map) {
for (HPXT011 fXt011 : fXt011s) {
String noticeNo = fXt011.getNoticeNo();
HPXT011 dbXt011 = dbXt011Map.get(noticeNo);
this.checkData(noticeNo, dbXt011);
}
}
/**
* 数据保存
*
* @param fXt011s
*/
private void submitData(List<HPXT011> fXt011s) {
for (HPXT011 fXt011 : fXt011s) {
fXt011.setStatus(HPConstant.submitStatus.S1);
fXt011.setSubmitUserId(UserSessionUtils.getLoginName());
fXt011.setSubmitUserName(UserSessionUtils.getLoginCName());
fXt011.setSubmitTime(DateUtils.shortDateTime());
DaoUtils.update(HpXtSqlConst.HpXt011.UPDATE_SUBMIT, fXt011.toMap());
}
}
/**
* 数据校验
*
* @param noticeNo
* @param dbXt011
*/
private void checkData(String noticeNo, HPXT011 dbXt011) {
AssertUtils.isNull(dbXt011, String.format("公告[%s]不存在", noticeNo));
AssertUtils.isNotEquals(dbXt011.getDeleteFlag(), CommonConstant.YesNo.NO_0,
String.format("公告【%s】不是\"未删除\"状态,不允许操作", noticeNo));
AssertUtils.isNotEquals(dbXt011.getStatus(), HPConstant.dealStatus.S0,
String.format("公告【%s】不是\"未提交\"状态,不允许操作", noticeNo));
}
}
package com.baosight.hpjx.hp.xt.service;
import com.baosight.hpjx.core.constant.CommonConstant;
import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.core.utils.Iplat4jUtils;
import com.baosight.hpjx.hp.constant.HPConstant;
import com.baosight.hpjx.hp.dm.domain.HPDM099;
import com.baosight.hpjx.hp.fw.domain.HPFW001;
import com.baosight.hpjx.hp.xt.domain.HPXT011;
import com.baosight.hpjx.hp.xt.tools.HpXtTools;
import com.baosight.hpjx.hp.xt.utils.HpXtUtils;
import com.baosight.hpjx.util.AssertUtils;
import com.baosight.hpjx.util.EiInfoUtils;
import com.baosight.hpjx.util.LogUtils;
import com.baosight.hpjx.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 ServiceHPXT011A extends ServiceEPBase {
/**
* 初始化
*
* @param inInfo
* @return
*/
@Override
public EiInfo initLoad(EiInfo inInfo) {
try {
this.setDetailInfo(inInfo);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HPDM099().eiMetadata);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询操作
*
* @param inInfo
* @return
*/
@Override
public EiInfo query(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HPDM099.QUERY, new HPDM099());
} 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, HPDM099.FIELD_BIZ_ID);
HPXT011 dbXt001 = HpXtUtils.HpXt011.lockAndGet(bizId);
this.checkData(bizId, dbXt001);
List<HPDM099> fDm099s = MapUtils.toDaoEPBases(inInfo, HPDM099.class);
for (HPDM099 fDm099 : fDm099s) {
DaoUtils.update(HPDM099.DELETE, fDm099);
if (!fDm099.getDocId().isEmpty()) {
Iplat4jUtils.deleteFileByDocId(fDm099.getDocId());
}
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + fDm099s.size() + "]条数据删除成功!");
} catch (Throwable e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
/**
* 数据校验
*
* @param noticeNo
* @param dbXt001
*/
private void checkData(String noticeNo, HPXT011 dbXt001) {
AssertUtils.isNull(dbXt001, String.format("公告[%s]不存在", noticeNo));
AssertUtils.isNotEquals(dbXt001.getDeleteFlag(), CommonConstant.YesNo.NO_0,
String.format("公告【%s】不是\"未删除\"状态,不允许操作", noticeNo));
AssertUtils.isNotEquals(dbXt001.getStatus(), HPConstant.dealStatus.S0,
String.format("公告【%s】不是\"未提交\"状态,不允许操作", noticeNo));
}
/**
* 设置信息
*
* @param inInfo
*/
public void setDetailInfo(EiInfo inInfo) {
Map queryRow = EiInfoUtils.getFirstRow(inInfo);
String bizId = MapUtils.getString(queryRow, HPDM099.FIELD_BIZ_ID);
if (bizId == null) {
return;
}
EiBlock block = new EiBlock(CommonConstant.Field.DETAIL);
block.addRow(HpXtTools.HpXt011.get(bizId));
block.addBlockMeta(new HPFW001().eiMetadata);
inInfo.setBlock(block);
}
}
package com.baosight.hpjx.hp.xt.service;
import com.baosight.hpjx.common.DdynamicEnum;
import com.baosight.hpjx.core.constant.CommonConstant;
import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.hp.constant.HPConstant;
import com.baosight.hpjx.hp.xt.domain.HPXT011;
import com.baosight.hpjx.hp.xt.tools.HpXtTools;
import com.baosight.hpjx.hp.xt.utils.HpXtUtils;
import com.baosight.hpjx.util.AssertUtils;
import com.baosight.hpjx.util.CommonMethod;
import com.baosight.hpjx.util.DateUtils;
import com.baosight.hpjx.util.EiInfoUtils;
import com.baosight.hpjx.util.LogUtils;
import com.baosight.hpjx.util.MapUtils;
import com.baosight.hpjx.util.StringUtils;
import com.baosight.iplat4j.core.ei.EiBlock;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import java.util.Arrays;
import java.util.Map;
/**
* 新增修改
*
* @author:songx
* @date:2022/7/11,11:08
*/
public class ServiceHPXT011B 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 {
HPXT011 fXt001 = MapUtils.toDaoEPBase(inInfo, HPXT011.class);
fXt001.setNoticeDate(DateUtils.formatShort(fXt001.getNoticeDate()));
fXt001.setExpireDate(DateUtils.formatShort(fXt001.getExpireDate()));
if (StringUtils.isBlank(fXt001.getNoticeNo())) {
this.add(fXt001);
} else {
this.modify(fXt001);
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 新增
*
* @param fXt001
*/
private void add(HPXT011 fXt001) {
fXt001.setNoticeNo(SequenceGenerator.getNextSequence(HPConstant.SequenceId.NOTICE_NO));
fXt001.setStatus(HPConstant.submitStatus.S0);
fXt001.setDeleteFlag(CommonConstant.YesNo.NO_0);
DaoUtils.insert(HPXT011.INSERT, fXt001);
}
/**
* 修改数据
*
* @param fXt001
*/
private void modify(HPXT011 fXt001) {
HPXT011 dbXt001 = HpXtUtils.HpXt011.lockAndGet(fXt001);
this.checkData(fXt001, dbXt001);
DaoUtils.update(HPXT011.UPDATE, fXt001);
}
/**
* 设置信息
*
* @param inInfo
*/
public void setBaseInfo(EiInfo inInfo) {
Map queryRow = EiInfoUtils.getFirstRow(inInfo);
String noticeNo = MapUtils.getString(queryRow, HPXT011.FIELD_NOTICE_NO);
if (StringUtils.isBlank(noticeNo)) {
return;
}
EiBlock resultBlock = new EiBlock(EiConstant.resultBlock);
resultBlock.addRow(HpXtTools.HpXt011.get(noticeNo));
resultBlock.addBlockMeta(new HPXT011().eiMetadata);
inInfo.setBlock(resultBlock);
}
/**
* 数据校验
*
* @param fXt001
* @param dbXt001
*/
private void checkData(HPXT011 fXt001, HPXT011 dbXt001) {
String noticeNo = fXt001.getNoticeNo();
AssertUtils.isNull(dbXt001, String.format("公告【%s】不存在", noticeNo));
AssertUtils.isNotEquals(dbXt001.getDeleteFlag(), CommonConstant.YesNo.NO_0,
String.format("公告【%s】不是\"未删除\"状态,不允许操作", noticeNo));
AssertUtils.isNotEquals(dbXt001.getStatus(), HPConstant.dealStatus.S0,
String.format("公告【%s】不是\"未提交\"状态,不允许操作", noticeNo));
}
}
package com.baosight.hpjx.hp.xt.service;
import com.baosight.hpjx.aspect.annotation.OperationLogAnnotation;
import com.baosight.hpjx.core.constant.CommonConstant;
import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.hp.ds.domain.HPDS002;
import com.baosight.hpjx.hp.xt.domain.HPXT099;
import com.baosight.hpjx.util.FileUtils;
import com.baosight.hpjx.util.LogUtils;
import com.baosight.iplat4j.core.ProjectInfo;
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.ServiceEPBase;
import com.baosight.iplat4j.core.service.soa.XServiceManager;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
*
*
*/
public class ServiceHPXT099 extends ServiceEPBase {
/**
* 画面初始化
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "附件清单",operType = "查询",operDesc = "车辆管理-附件清单A-初始化")
public EiInfo initLoad(EiInfo inInfo) {
try {
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HPXT099().eiMetadata);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
@OperationLogAnnotation(operModul = "附件清单",operType = "查询",operDesc = "车辆管理-附件清单A-查询")
@Override
public EiInfo query(EiInfo inInfo) {
try {
// 项目环境
String projectEnv = ProjectInfo.getProjectEnv();
if (CommonConstant.ProjectEnv.RUN.equalsIgnoreCase(projectEnv)) {
inInfo = super.query(inInfo, "HPXT099.queryRun", new HPXT099());
} else {
inInfo = super.query(inInfo, "HPXT099.queryDev", new HPXT099());
}
} catch (Throwable e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
/**
* 新增操作
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "附件清单",operType = "新增",operDesc = "车辆管理-附件清单A-新增操作")
@Override
public EiInfo insert(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (int i = 0; i < resultRows.size(); i++) {
HPXT099 hpxt099 = new HPXT099();
hpxt099.fromMap(resultRows.get(i));
DaoUtils.insert(HPXT099.INSERT, hpxt099);
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据新增成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "新增失败");
}
return inInfo;
}
/**
* 删除操作
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "附件清单",operType = "删除",operDesc = "车辆管理-附件清单A-删除操作")
public EiInfo delete(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (int i = 0; i < resultRows.size(); i++) {
HPXT099 hpxt099 = new HPXT099();
hpxt099.fromMap(resultRows.get(i));
DaoUtils.update(HPXT099.DELETE, hpxt099);
if (!hpxt099.getDocId().isEmpty()) {
this.delectDoc(hpxt099.getDocId());
}
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据删除成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "删除失败");
}
return inInfo;
}
/**
* 删除文件
* @param docId 文件ID
*/
@OperationLogAnnotation(operModul = "附件清单",operType = "删除",operDesc = "删除附件文件")
public void delectDoc(String docId){
Map<String,Object> map = new HashMap<>();
map.put("docId",docId);
List<HPDS002> list = this.dao.query(HPDS002.QUERY,map);
if (list.size() > 0) {
String realPath = list.get(0).getRealPath();
// 项目环境
String projectEnv = ProjectInfo.getProjectEnv();
if (projectEnv.equals(CommonConstant.ProjectEnv.RUN)) {
EiInfo queryInfo = new EiInfo();
queryInfo.set(HPXT099.FIELD_DOC_ID,list.get(0).getDocId());
//获取文档信息
queryInfo.set(EiConstant.serviceId,"S_EU_0102");
EiInfo docInfo = XServiceManager.call(queryInfo);
//数据库
Map docInfoMap = docInfo.getMap("docMap");
if (docInfoMap.size() > 0) {
EiInfo eiInfo = new EiInfo();
eiInfo.set("data",docInfoMap.get("url")+"-"+0);
eiInfo.set(EiConstant.serviceId,"S_EU_0105");
//调用接口
EiInfo outInfo = XServiceManager.call(eiInfo);
if(outInfo.getStatus() == EiConstant.STATUS_FAILURE){
LogUtils.setDetailMsg(outInfo, new Throwable(), "查询部件类型失败");
outInfo.setMsg("失败");
}
}
}else {
FileUtils.deleteFile(realPath);
}
this.dao.delete(HPDS002.DELETE,map);
}
}
}
<?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-26 13:10:36
Version : 1.0
schema : world
tableName : T_HPXT002
ID BIGINT NOT NULL primarykey,
COMPANY_CODE VARCHAR NOT NULL,
DEP_CODE VARCHAR,
CREATED_BY VARCHAR,
CREATED_NAME VARCHAR,
CREATED_TIME VARCHAR,
UPDATED_BY VARCHAR,
UPDATED_NAME VARCHAR,
UPDATED_TIME VARCHAR,
APPLY_DATE VARCHAR,
APPLY_NO VARCHAR,
APPLY_PERSONNEL VARCHAR,
LICENSE_PLATE_CODE VARCHAR,
DELETE_FLAG TINYINT,
APPLY_STATUS TINYINT
-->
<sqlMap namespace="HPXT002">
<sql id="condition">
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
CREATED_BY = #createdBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdName">
CREATED_NAME = #createdName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
CREATED_TIME = #createdTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy">
UPDATED_BY = #updatedBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedName">
UPDATED_NAME = #updatedName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime">
UPDATED_TIME = #updatedTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="applyDate">
APPLY_DATE = #applyDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="applyNo">
APPLY_NO = #applyNo#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="applyPersonnel">
APPLY_PERSONNEL LIKE '%' || #applyPersonnel# || '%'
</isNotEmpty>
<isNotEmpty prepend=" AND " property="licensePlateCode">
LICENSE_PLATE_CODE LIKE '%' || #licensePlateCode# || '%'
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deleteFlag">
DELETE_FLAG = #deleteFlag#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="applyStatus">
APPLY_STATUS = #applyStatus#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdDateFrom">
CREATED_TIME &gt;= REPLACE(#createdDateFrom#, '-', '')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdDateTo">
CREATED_TIME &lt;= REPLACE(#createdDateTo#, '-', '')
</isNotEmpty>
</sql>
<select id="query" parameterClass="java.util.HashMap"
resultClass="com.baosight.hpjx.hp.xt.domain.HPXT002">
SELECT
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", <!-- 更新时间 -->
APPLY_DATE as "applyDate", <!-- 申请日期 -->
APPLY_NO as "applyNo", <!-- 保险单号 -->
APPLY_PERSONNEL as "applyPersonnel", <!-- 申请人 -->
LICENSE_PLATE_CODE as "licensePlateCode", <!-- 车牌号 -->
DELETE_FLAG as "deleteFlag", <!-- 是否删除0.否1.是 -->
APPLY_STATUS as "applyStatus" <!-- 申请状态 -->
FROM ${hpjxSchema}.T_HPXT002 WHERE 1=1
<include refid="condition" />
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
ID asc
</isEmpty>
</dynamic>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hpjxSchema}.T_HPXT002 WHERE 1=1
<include refid="condition" />
</select>
<!--
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
CREATED_BY = #createdBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdName">
CREATED_NAME = #createdName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
CREATED_TIME = #createdTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy">
UPDATED_BY = #updatedBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedName">
UPDATED_NAME = #updatedName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime">
UPDATED_TIME = #updatedTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="applyDate">
APPLY_DATE = #applyDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="applyNo">
APPLY_NO = #applyNo#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="applyPersonnel">
APPLY_PERSONNEL = #applyPersonnel#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="licensePlateCode">
LICENSE_PLATE_CODE = #licensePlateCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deleteFlag">
DELETE_FLAG = #deleteFlag#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="applyStatus">
APPLY_STATUS = #applyStatus#
</isNotEmpty>
-->
<insert id="insert">
INSERT INTO ${hpjxSchema}.T_HPXT002 (ID, <!-- 主键id -->
COMPANY_CODE, <!-- 企业编码 预留 -->
DEP_CODE, <!-- 部门编码 -->
CREATED_BY, <!-- 创建人 -->
CREATED_NAME, <!-- 创建人名称 -->
CREATED_TIME, <!-- 创建时间 -->
UPDATED_BY, <!-- 更新人 -->
UPDATED_NAME, <!-- 更新人名称 -->
UPDATED_TIME, <!-- 更新时间 -->
APPLY_DATE, <!-- 申请日期 -->
APPLY_NO, <!-- 保险单号 -->
APPLY_PERSONNEL, <!-- 申请人 -->
LICENSE_PLATE_CODE, <!-- 车牌号 -->
DELETE_FLAG, <!-- 是否删除0.否1.是 -->
APPLY_STATUS <!-- 申请状态 -->
)
VALUES (#id#, #companyCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #applyDate#, #applyNo#, #applyPersonnel#, #licensePlateCode#, #deleteFlag#, #applyStatus#)
</insert>
<delete id="delete">
DELETE FROM ${hpjxSchema}.T_HPXT002 WHERE
ID = #id#
</delete>
<update id="deleteFlag">
UPDATE ${hpjxSchema}.T_HPXT002
SET
UPDATED_BY = #updatedBy#, <!-- 修改人 -->
UPDATED_NAME = #updatedName#, <!-- 修改人名称 -->
UPDATED_TIME = #updatedTime#, <!-- 修改时间 -->
DELETE_FLAG = #deleteFlag# <!-- 是否删除0:否1.是 -->
WHERE
ID = #id#
</update>
<update id="update">
UPDATE ${hpjxSchema}.T_HPXT002
SET
COMPANY_CODE = #companyCode#, <!-- 企业编码 预留 -->
DEP_CODE = #depCode#, <!-- 部门编码 -->
CREATED_BY = #createdBy#, <!-- 创建人 -->
CREATED_NAME = #createdName#, <!-- 创建人名称 -->
CREATED_TIME = #createdTime#, <!-- 创建时间 -->
UPDATED_BY = #updatedBy#, <!-- 更新人 -->
UPDATED_NAME = #updatedName#, <!-- 更新人名称 -->
UPDATED_TIME = #updatedTime#, <!-- 更新时间 -->
APPLY_DATE = #applyDate#, <!-- 申请日期 -->
APPLY_NO = #applyNo#, <!-- 保险单号 -->
APPLY_PERSONNEL = #applyPersonnel#, <!-- 申请人 -->
LICENSE_PLATE_CODE = #licensePlateCode#, <!-- 车牌号 -->
DELETE_FLAG = #deleteFlag#, <!-- 是否删除0.否1.是 -->
APPLY_STATUS = #applyStatus# <!-- 申请状态 -->
WHERE
ID = #id#
</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-26 13:10:39
Version : 1.0
schema : world
tableName : T_HPXT002A
ID BIGINT NOT NULL primarykey,
COMPANY_CODE VARCHAR NOT NULL,
DEP_CODE VARCHAR,
CREATED_BY VARCHAR,
CREATED_NAME VARCHAR,
CREATED_TIME VARCHAR,
UPDATED_BY VARCHAR,
UPDATED_NAME VARCHAR,
UPDATED_TIME VARCHAR,
LICENSE_PLATE_CODE VARCHAR,
INSURANCE_TYPE VARCHAR,
INSURANCE_COMPANY VARCHAR,
INSURANCE_START_DATE VARCHAR,
INSURANCE_END_DATE VARCHAR,
INSURANCE_AMOUNT DECIMAL,
DELETE_FLAG TINYINT
-->
<sqlMap namespace="HPXT002A">
<sql id="condition">
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
CREATED_BY = #createdBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdName">
CREATED_NAME = #createdName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
CREATED_TIME = #createdTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy">
UPDATED_BY = #updatedBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedName">
UPDATED_NAME = #updatedName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime">
UPDATED_TIME = #updatedTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="licensePlateCode">
LICENSE_PLATE_CODE = #licensePlateCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="insuranceType">
INSURANCE_TYPE = #insuranceType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="insuranceCompany">
INSURANCE_COMPANY = #insuranceCompany#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="insuranceStartDate">
INSURANCE_START_DATE = #insuranceStartDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="insuranceEndDate">
INSURANCE_END_DATE = #insuranceEndDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="insuranceAmount">
INSURANCE_AMOUNT = #insuranceAmount#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deleteFlag">
DELETE_FLAG = #deleteFlag#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="tHpxt002Id">
T_HPXT002_ID = #tHpxt002Id#
</isNotEmpty>
</sql>
<select id="query" parameterClass="java.util.HashMap"
resultClass="com.baosight.hpjx.hp.xt.domain.HPXT002A">
SELECT
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", <!-- 更新时间 -->
LICENSE_PLATE_CODE as "licensePlateCode", <!-- 车牌号 -->
INSURANCE_TYPE as "insuranceType", <!-- 车险险种 -->
INSURANCE_COMPANY as "insuranceCompany", <!-- 保险公司 -->
INSURANCE_START_DATE as "insuranceStartDate", <!-- 投保时间 -->
INSURANCE_END_DATE as "insuranceEndDate", <!-- 结束时间 -->
INSURANCE_AMOUNT as "insuranceAmount", <!-- 保险金额 -->
DELETE_FLAG as "deleteFlag", <!-- 是否删除0.否1.是 -->
T_HPXT002_ID as "tHpxt002Id"
FROM ${hpjxSchema}.T_HPXT002A WHERE 1=1
<include refid="condition" />
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
ID asc
</isEmpty>
</dynamic>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hpjxSchema}.T_HPXT002A WHERE 1=1
<include refid="condition" />
</select>
<!--
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
CREATED_BY = #createdBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdName">
CREATED_NAME = #createdName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
CREATED_TIME = #createdTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy">
UPDATED_BY = #updatedBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedName">
UPDATED_NAME = #updatedName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime">
UPDATED_TIME = #updatedTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="licensePlateCode">
LICENSE_PLATE_CODE = #licensePlateCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="insuranceType">
INSURANCE_TYPE = #insuranceType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="insuranceCompany">
INSURANCE_COMPANY = #insuranceCompany#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="insuranceStartDate">
INSURANCE_START_DATE = #insuranceStartDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="insuranceEndDate">
INSURANCE_END_DATE = #insuranceEndDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="insuranceAmount">
INSURANCE_AMOUNT = #insuranceAmount#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deleteFlag">
DELETE_FLAG = #deleteFlag#
</isNotEmpty>
-->
<insert id="insert">
INSERT INTO ${hpjxSchema}.T_HPXT002A (ID, <!-- 主键id -->
COMPANY_CODE, <!-- 企业编码 预留 -->
DEP_CODE, <!-- 部门编码 -->
CREATED_BY, <!-- 创建人 -->
CREATED_NAME, <!-- 创建人名称 -->
CREATED_TIME, <!-- 创建时间 -->
UPDATED_BY, <!-- 更新人 -->
UPDATED_NAME, <!-- 更新人名称 -->
UPDATED_TIME, <!-- 更新时间 -->
LICENSE_PLATE_CODE, <!-- 车牌号 -->
INSURANCE_TYPE, <!-- 车险险种 -->
INSURANCE_COMPANY, <!-- 保险公司 -->
INSURANCE_START_DATE, <!-- 投保时间 -->
INSURANCE_END_DATE, <!-- 结束时间 -->
INSURANCE_AMOUNT, <!-- 保险金额 -->
DELETE_FLAG, <!-- 是否删除0.否1.是 -->
T_HPXT002_ID
)
VALUES (#id#, #companyCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #licensePlateCode#, #insuranceType#, #insuranceCompany#, #insuranceStartDate#, #insuranceEndDate#, #insuranceAmount#, #deleteFlag#, #tHpxt002Id# )
</insert>
<delete id="delete">
DELETE FROM ${hpjxSchema}.T_HPXT002A WHERE
ID = #id#
</delete>
<update id="deleteFlag">
UPDATE ${hpjxSchema}.T_HPXT002A
SET
UPDATED_BY = #updatedBy#, <!-- 修改人 -->
UPDATED_NAME = #updatedName#, <!-- 修改人名称 -->
UPDATED_TIME = #updatedTime#, <!-- 修改时间 -->
DELETE_FLAG = #deleteFlag# <!-- 是否删除0:否1.是 -->
WHERE
ID = #id#
</update>
<update id="update">
UPDATE ${hpjxSchema}.T_HPXT002A
SET
COMPANY_CODE = #companyCode#, <!-- 企业编码 预留 -->
DEP_CODE = #depCode#, <!-- 部门编码 -->
CREATED_BY = #createdBy#, <!-- 创建人 -->
CREATED_NAME = #createdName#, <!-- 创建人名称 -->
CREATED_TIME = #createdTime#, <!-- 创建时间 -->
UPDATED_BY = #updatedBy#, <!-- 更新人 -->
UPDATED_NAME = #updatedName#, <!-- 更新人名称 -->
UPDATED_TIME = #updatedTime#, <!-- 更新时间 -->
LICENSE_PLATE_CODE = #licensePlateCode#, <!-- 车牌号 -->
INSURANCE_TYPE = #insuranceType#, <!-- 车险险种 -->
INSURANCE_COMPANY = #insuranceCompany#, <!-- 保险公司 -->
INSURANCE_START_DATE = #insuranceStartDate#, <!-- 投保时间 -->
INSURANCE_END_DATE = #insuranceEndDate#, <!-- 结束时间 -->
INSURANCE_AMOUNT = #insuranceAmount#, <!-- 保险金额 -->
DELETE_FLAG = #deleteFlag# <!-- 是否删除0.否1.是 -->
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