Commit d7a6bef7 by wancheng

售后退货

parent 10909d84
...@@ -267,6 +267,12 @@ public enum DdynamicEnum { ...@@ -267,6 +267,12 @@ public enum DdynamicEnum {
USER_ID1_BLOCK_ID("user_id1_block_id","userId","userName","factoryCode","groupCode", "HPSC008.queryUserId"), USER_ID1_BLOCK_ID("user_id1_block_id","userId","userName","factoryCode","groupCode", "HPSC008.queryUserId"),
/** /**
* 模块:维修人员
* 用途:用户查询
* 编写:w
*/
REP_USER_ID_BLOCK_ID("rep_user_id_block_id","userId","userName", "HPXS006.queryUserId"),
/**
* 模块:系统管理 * 模块:系统管理
* 用途:生产组查询 * 用途:生产组查询
* 编写:ly * 编写:ly
......
...@@ -58,7 +58,8 @@ public class HPConstant { ...@@ -58,7 +58,8 @@ public class HPConstant {
public static final String HPSC005_PROD_NO = "HPSC005_PROD_NO"; public static final String HPSC005_PROD_NO = "HPSC005_PROD_NO";
//生产任务订单 //生产任务订单
public static final String PROD_TASK_NO = "PROD_TASK_NO"; public static final String PROD_TASK_NO = "PROD_TASK_NO";
//售后维修单号
public static final String HPXS006_PROD_NO = "HPXS006_NUMBER";
} }
/** /**
......
/**
* Generate time : 2024-04-18 8:37:45
* Version : 1.0
*/
package com.baosight.hpjx.hp.xs.domain;
import com.baosight.iplat4j.core.util.NumberUtils;
import com.baosight.iplat4j.core.ei.EiColumn;
import com.baosight.iplat4j.core.data.DaoEPBase;
import java.util.HashMap;
import java.util.Map;
import com.baosight.iplat4j.core.util.StringUtils;
/**
* THpxs006
*
*/
public class HPXS006 extends DaoEPBase {
private Long id = 0L; /* ID*/
private String companyCode = " "; /* 公司编码*/
private String depCode = " "; /* 部门编码*/
private String createdBy = " "; /* 创建人*/
private String createdName = " "; /* 创建人名称*/
private String createdTime = " "; /* 创建时间*/
private String updatedBy = " "; /* 修改人*/
private String updatedName = " "; /* 修改人名称*/
private String updatedTime = " "; /* 修改时间*/
private Integer deleteFlag; /* 是否删除 0-否1-是*/
private String repDate = " "; /* 维修日期*/
private String repOrderNo = " "; /* 维修单号*/
private String repCustomId = " "; /* 客户人员*/
private String repUserId = " "; /* 维修人员*/
private Integer repStatus; /* 维修状态 0-待维修 1-已维修*/
public static final String FIELD_REP_DATE = "repDate";
public static final String QUERY = "HPXS006.query";
public static final String COUNT = "HPXS006.count";
public static final String INSERT = "HPXS006.insert";
public static final String UPDATE = "HPXS006.update";
public static final String DELETE = "HPXS006.delete";
public static final String CHECK = "HPXS006.check";
/**
* initialize the metadata
*/
public void initMetaData() {
EiColumn eiColumn;
eiColumn = new EiColumn("id");
eiColumn.setPrimaryKey(true);
eiColumn.setDescName("ID");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("companyCode");
eiColumn.setDescName("公司编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("depCode");
eiColumn.setDescName("部门编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("createdBy");
eiColumn.setDescName("创建人");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("createdName");
eiColumn.setDescName("创建人名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("createdTime");
eiColumn.setDescName("创建时间");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("updatedBy");
eiColumn.setDescName("修改人");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("updatedName");
eiColumn.setDescName("修改人名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("updatedTime");
eiColumn.setDescName("修改时间");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("deleteFlag");
eiColumn.setDescName("是否删除 0-否1-是");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("repDate");
eiColumn.setDescName("维修日期");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("repOrderNo");
eiColumn.setDescName("维修单号");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("repCustomId");
eiColumn.setDescName("客户人员");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("repUserId");
eiColumn.setDescName("维修人员");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("repStatus");
eiColumn.setDescName("维修状态 0-待维修 1-已维修");
eiMetadata.addMeta(eiColumn);
}
/**
* the constructor
*/
public HPXS006() {
initMetaData();
}
/**
* get the id - ID
* @return the id
*/
public Long getId() {
return this.id;
}
/**
* set the id - ID
*/
public void setId(Long id) {
this.id = id;
}
/**
* get the companyCode - 公司编码
* @return the companyCode
*/
public String getCompanyCode() {
return this.companyCode;
}
/**
* set the companyCode - 公司编码
*/
public void setCompanyCode(String companyCode) {
this.companyCode = companyCode;
}
/**
* get the depCode - 部门编码
* @return the depCode
*/
public String getDepCode() {
return this.depCode;
}
/**
* set the depCode - 部门编码
*/
public void setDepCode(String depCode) {
this.depCode = depCode;
}
/**
* get the createdBy - 创建人
* @return the createdBy
*/
public String getCreatedBy() {
return this.createdBy;
}
/**
* set the createdBy - 创建人
*/
public void setCreatedBy(String createdBy) {
this.createdBy = createdBy;
}
/**
* get the createdName - 创建人名称
* @return the createdName
*/
public String getCreatedName() {
return this.createdName;
}
/**
* set the createdName - 创建人名称
*/
public void setCreatedName(String createdName) {
this.createdName = createdName;
}
/**
* get the createdTime - 创建时间
* @return the createdTime
*/
public String getCreatedTime() {
return this.createdTime;
}
/**
* set the createdTime - 创建时间
*/
public void setCreatedTime(String createdTime) {
this.createdTime = createdTime;
}
/**
* get the updatedBy - 修改人
* @return the updatedBy
*/
public String getUpdatedBy() {
return this.updatedBy;
}
/**
* set the updatedBy - 修改人
*/
public void setUpdatedBy(String updatedBy) {
this.updatedBy = updatedBy;
}
/**
* get the updatedName - 修改人名称
* @return the updatedName
*/
public String getUpdatedName() {
return this.updatedName;
}
/**
* set the updatedName - 修改人名称
*/
public void setUpdatedName(String updatedName) {
this.updatedName = updatedName;
}
/**
* get the updatedTime - 修改时间
* @return the updatedTime
*/
public String getUpdatedTime() {
return this.updatedTime;
}
/**
* set the updatedTime - 修改时间
*/
public void setUpdatedTime(String updatedTime) {
this.updatedTime = updatedTime;
}
/**
* get the deleteFlag - 是否删除 0-否1-是
* @return the deleteFlag
*/
public Integer getDeleteFlag() {
return this.deleteFlag;
}
/**
* set the deleteFlag - 是否删除 0-否1-是
*/
public void setDeleteFlag(Integer deleteFlag) {
this.deleteFlag = deleteFlag;
}
/**
* get the repDate - 维修日期
* @return the repDate
*/
public String getRepDate() {
return this.repDate;
}
/**
* set the repDate - 维修日期
*/
public void setRepDate(String repDate) {
this.repDate = repDate;
}
/**
* get the repOrderNo - 维修单号
* @return the repOrderNo
*/
public String getRepOrderNo() {
return this.repOrderNo;
}
/**
* set the repOrderNo - 维修单号
*/
public void setRepOrderNo(String repOrderNo) {
this.repOrderNo = repOrderNo;
}
/**
* get the repCustomId - 客户人员
* @return the repCustomId
*/
public String getRepCustomId() {
return this.repCustomId;
}
/**
* set the repCustomId - 客户人员
*/
public void setRepCustomId(String repCustomId) {
this.repCustomId = repCustomId;
}
/**
* get the repUserId - 维修人员
* @return the repUserId
*/
public String getRepUserId() {
return this.repUserId;
}
/**
* set the repUserId - 维修人员
*/
public void setRepUserId(String repUserId) {
this.repUserId = repUserId;
}
/**
* get the repStatus - 维修状态 0-待维修 1-已维修
* @return the repStatus
*/
public Integer getRepStatus() {
return this.repStatus;
}
/**
* set the repStatus - 维修状态 0-待维修 1-已维修
*/
public void setRepStatus(Integer repStatus) {
this.repStatus = repStatus;
}
/**
* get the value from Map
*/
public void fromMap(Map map) {
setId(NumberUtils.toLong(StringUtils.toString(map.get("id")), id));
setCompanyCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("companyCode")), companyCode));
setDepCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("depCode")), depCode));
setCreatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("createdBy")), createdBy));
setCreatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("createdName")), createdName));
setCreatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("createdTime")), createdTime));
setUpdatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("updatedBy")), updatedBy));
setUpdatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("updatedName")), updatedName));
setUpdatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("updatedTime")), updatedTime));
setDeleteFlag(NumberUtils.toInteger(StringUtils.toString(map.get("deleteFlag")), deleteFlag));
setRepDate(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("repDate")), repDate));
setRepOrderNo(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("repOrderNo")), repOrderNo));
setRepCustomId(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("repCustomId")), repCustomId));
setRepUserId(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("repUserId")), repUserId));
setRepStatus(NumberUtils.toInteger(StringUtils.toString(map.get("repStatus")), repStatus));
}
/**
* set the value to Map
*/
public Map toMap() {
Map map = new HashMap();
map.put("id",StringUtils.toString(id, eiMetadata.getMeta("id")));
map.put("companyCode",StringUtils.toString(companyCode, eiMetadata.getMeta("companyCode")));
map.put("depCode",StringUtils.toString(depCode, eiMetadata.getMeta("depCode")));
map.put("createdBy",StringUtils.toString(createdBy, eiMetadata.getMeta("createdBy")));
map.put("createdName",StringUtils.toString(createdName, eiMetadata.getMeta("createdName")));
map.put("createdTime",StringUtils.toString(createdTime, eiMetadata.getMeta("createdTime")));
map.put("updatedBy",StringUtils.toString(updatedBy, eiMetadata.getMeta("updatedBy")));
map.put("updatedName",StringUtils.toString(updatedName, eiMetadata.getMeta("updatedName")));
map.put("updatedTime",StringUtils.toString(updatedTime, eiMetadata.getMeta("updatedTime")));
map.put("deleteFlag",StringUtils.toString(deleteFlag, eiMetadata.getMeta("deleteFlag")));
map.put("repDate",StringUtils.toString(repDate, eiMetadata.getMeta("repDate")));
map.put("repOrderNo",StringUtils.toString(repOrderNo, eiMetadata.getMeta("repOrderNo")));
map.put("repCustomId",StringUtils.toString(repCustomId, eiMetadata.getMeta("repCustomId")));
map.put("repUserId",StringUtils.toString(repUserId, eiMetadata.getMeta("repUserId")));
map.put("repStatus",StringUtils.toString(repStatus, eiMetadata.getMeta("repStatus")));
return map;
}
}
\ No newline at end of file
package com.baosight.hpjx.hp.xs.service;
import com.baosight.hpjx.aspect.annotation.OperationLogAnnotation;
import com.baosight.hpjx.common.CompanyTypeEnum;
import com.baosight.hpjx.common.DdynamicEnum;
import com.baosight.hpjx.common.HPConstants;
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.pz.domain.HPPZ003;
import com.baosight.hpjx.hp.sc.domain.HPSC001;
import com.baosight.hpjx.hp.sc.domain.HPSC002;
import com.baosight.hpjx.hp.sc.domain.HPSC008;
import com.baosight.hpjx.hp.xs.domain.HPXS006;
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;
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.*;
/**
*
*/
public class ServiceHPXS006 extends ServiceBase {
/**
* 画面初始化.
*/
@OperationLogAnnotation(operModul = "售后维修",operType = "查询",operDesc = "初始化")
public EiInfo initLoad(EiInfo inInfo) {
try {
/*inInfo.setCell(EiConstant.queryBlock,ACConstants.ROW_CODE_0, "userId",UserSessionUtils.getFactoryCode().get(0));*/
inInfo = super.query(inInfo, HPXS006.QUERY, new HPSC001());
Map map = new HashMap();
map.put("companyCode", UserSessionUtils.getCompanyCode());
map.put("factoryCodes", UserSessionUtils.getFactoryCode());
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.REP_USER_ID_BLOCK_ID), map,true);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.CUSTOMER_RECORD_BLOCK_ID), null);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询操作.
*/
@Override
@OperationLogAnnotation(operModul = "售后维修",operType = "查询")
public EiInfo query(EiInfo inInfo) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HPXS006.FIELD_REP_DATE,
DateUtils.formatShort(inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HPXS006.FIELD_REP_DATE)));
EiInfo outInfo = super.query(inInfo, HPXS006.QUERY, new HPXS006());
return outInfo;
}
/**
* 保存操作.
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "售后维修",operType = "保存",operDesc = "保存")
public EiInfo save(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 写入数据
for (int i = 0; i < resultRows.size(); i++) {
HPXS006 hpsc006 = new HPXS006();
hpsc006.fromMap(resultRows.get(i));
hpsc006.setRepDate(DateUtils.formatShort(hpsc006.getRepDate()));
/* HPPZ003 fPz003 = new HPPZ003();
if (hpsc001.getPrinc2().trim().isEmpty()) {
fPz003.setCustCode(SequenceGenerator.getNextSequence(HPConstant.SequenceId.HPPZ003_CUST_CODE));
fPz003.setCustType(CompanyTypeEnum.GQ.getCode());
fPz003.setCustName(resultRows.get(i).get("princ2Name").toString());
fPz003.setCompanyName(resultRows.get(i).get("princ2Name").toString());
DaoUtils.insert("HPPZ003.insert", fPz003);
hpsc001.setPrinc2(fPz003.getCustCode());
}*/
if (hpsc006.getId() == null || hpsc006.getId() == 0) {
this.add(hpsc006);
} else {
this.modify(hpsc006);
}
}
//inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 新增
*
* @param hpxs006
* @throws Exception
*/
private void add(HPXS006 hpxs006) throws Exception {
hpxs006.setRepOrderNo(SequenceGenerator.getNextSequence(HPConstant.SequenceId.HPXS006_PROD_NO));
DaoUtils.insert(HPXS006.INSERT, hpxs006);
}
/**
* 修改数据
*
* @param hpxs006
*/
private void modify(HPXS006 hpxs006) {
DaoUtils.update(HPXS006.UPDATE, hpxs006);
}
/**
* 删除操作.
*/
@OperationLogAnnotation(operModul = "售后维修",operType = "删除")
public EiInfo delete(EiInfo eiInfo) {
HPXS006 hpxs006 = new HPXS006();
EiBlock eiBlock = eiInfo.getBlock(EiConstant.resultBlock);
try {
for (int i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
hpxs006.fromMap(map);
this.dao.delete(HPXS006.DELETE, hpxs006.toMap());
}
} catch (PlatException e) {
eiInfo.setStatus(EiConstant.STATUS_FAILURE);
eiInfo.setMsg("删除失败,原因参见详细错误描述!");
eiInfo.setDetailMsg(e.getMessage());
logError("删除失败!", e.getMessage());
return eiInfo;
}
eiInfo.setStatus(EiConstant.STATUS_SUCCESS);
eiInfo.setMsg("删除成功!");
return query(eiInfo);
}
/**
*审核
*/
@OperationLogAnnotation(operModul = "售后维修",operType = "审核")
public EiInfo check(EiInfo eiInfo) {
HPXS006 hpxs006 = new HPXS006();
EiBlock eiBlock = eiInfo.getBlock(EiConstant.resultBlock);
try {
for (int i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
hpxs006.fromMap(map);
DaoUtils.update(HPXS006.CHECK, hpxs006.toMap());
}
} catch (PlatException e) {
eiInfo.setStatus(EiConstant.STATUS_FAILURE);
eiInfo.setMsg("审核失败,原因参见详细错误描述!");
eiInfo.setDetailMsg(e.getMessage());
logError("审核失败!", e.getMessage());
return eiInfo;
}
eiInfo.setStatus(EiConstant.STATUS_SUCCESS);
eiInfo.setMsg("审核成功!");
return eiInfo;
}
public void buildHPSC002(EiInfo eiInfo) {
HPSC001 hpsc001 = new HPSC001();
EiBlock eiBlock = eiInfo.getBlock(EiConstant.resultBlock);
List rows = new ArrayList();
for (int i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
hpsc001.fromMap(map);
Map hpsc002 = new HashMap();
hpsc002.put("companyCode", hpsc001.getCompanyCode());
hpsc002.put("depCode", hpsc001.getDepCode());
hpsc002.put("projCode", hpsc001.getProjCode());
hpsc002.put("projName", hpsc001.getProjName());
hpsc002.put("parentId", "root"); //固定写死
hpsc002.put("parentPrdtName", hpsc001.getProjName());
hpsc002.put("deliveryDate",hpsc001.getDeliveryDate());
hpsc002.put("type", "");
hpsc002.put("leaf", "0");
hpsc002.put("sort", "");
hpsc002.put("icon", "");
hpsc002.put("prdtCode", hpsc001.getProjCode());
hpsc002.put("prdtName", hpsc001.getProjName());
hpsc002.put("depCode", hpsc001.getDepCode());
rows.add(hpsc002);
}
eiBlock.setRows(rows);
eiInfo.set(EiConstant.serviceName, "HPSC002");
eiInfo.set(EiConstant.methodName, "insert");
EiInfo outInfo = XLocalManager.call(eiInfo);
if (outInfo.getStatus() < 0) {
throw new PlatException(outInfo.getMsg());
}
}
/**
* 项目下拉框
*
* @param inInfo
* @return
*/
public EiInfo queryComboBox(EiInfo inInfo) {
List<DdynamicEnum> list = new ArrayList<>();
list.add(DdynamicEnum.PROJ_RECORD_BLOCK_ID);
CommonMethod.initBlock(inInfo, list, EiInfoUtils.getFirstRow(inInfo));
return inInfo;
}
}
<?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">
<!-- table information
Generate time : 2024-04-18 8:37:45
Version : 1.0
tableName :hpjx.t_hpxs006
ID BIGINT NOT NULL primarykey,
COMPANY_CODE VARCHAR,
DEP_CODE VARCHAR,
CREATED_BY VARCHAR,
CREATED_NAME VARCHAR,
CREATED_TIME VARCHAR,
UPDATED_BY VARCHAR,
UPDATED_NAME VARCHAR,
UPDATED_TIME VARCHAR,
DELETE_FLAG TINYINT,
REP_DATE VARCHAR,
REP_ORDER_NO VARCHAR,
REP_CUSTOM_ID VARCHAR,
REP_USER_ID VARCHAR,
REP_STATUS TINYINT
-->
<sqlMap namespace="HPXS006">
<sql id="authCondition">
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCodes">
DEP_CODE IN <iterate close=")" open="(" conjunction="," property="depCodes">#depCodes[]#</iterate>
</isNotEmpty>
</sql>
<sql id="condition">
<isNotEmpty prepend=" AND " property="repDate">
REP_DATE = #repDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="repOrderNo">
REP_ORDER_NO LIKE CONCAT('%', #repOrderNo#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="repCustomId">
REP_CUSTOM_ID = #repCustomId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="repUserId">
REP_USER_ID = #repUserId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="repStatus">
REP_STATUS = #repStatus#
</isNotEmpty>
</sql>
<select id="query" parameterClass="java.util.HashMap"
resultClass="com.baosight.hpjx.hp.xs.domain.HPXS006">
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", <!-- 修改时间 -->
DELETE_FLAG as "deleteFlag", <!-- 是否删除 0-否1-是 -->
REP_DATE as "repDate", <!-- 维修日期 -->
REP_ORDER_NO as "repOrderNo", <!-- 维修单号 -->
REP_CUSTOM_ID as "repCustomId", <!-- 客户人员 -->
REP_USER_ID as "repUserId", <!-- 维修人员 -->
REP_STATUS as "repStatus" <!-- 维修状态 0-待维修 1-已维修 -->
FROM hpjx.t_hpxs006 WHERE 1=1
<include refid="authCondition"/>
<include refid="condition"/>
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
CREATED_TIME asc
</isEmpty>
</dynamic>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM hpjx.t_hpxs006 WHERE 1=1
<include refid="authCondition"/>
<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="deleteFlag">
DELETE_FLAG = #deleteFlag#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="repDate">
REP_DATE = #repDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="repOrderNo">
REP_ORDER_NO = #repOrderNo#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="repCustomId">
REP_CUSTOM_ID = #repCustomId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="repUserId">
REP_USER_ID = #repUserId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="repStatus">
REP_STATUS = #repStatus#
</isNotEmpty>
-->
<insert id="insert">
INSERT INTO hpjx.t_hpxs006 (ID, <!-- ID -->
COMPANY_CODE, <!-- 公司编码 -->
DEP_CODE, <!-- 部门编码 -->
CREATED_BY, <!-- 创建人 -->
CREATED_NAME, <!-- 创建人名称 -->
CREATED_TIME, <!-- 创建时间 -->
UPDATED_BY, <!-- 修改人 -->
UPDATED_NAME, <!-- 修改人名称 -->
UPDATED_TIME, <!-- 修改时间 -->
DELETE_FLAG, <!-- 是否删除 0-否1-是 -->
REP_DATE, <!-- 维修日期 -->
REP_ORDER_NO, <!-- 维修单号 -->
REP_CUSTOM_ID, <!-- 客户人员 -->
REP_USER_ID, <!-- 维修人员 -->
REP_STATUS <!-- 维修状态 0-待维修 1-已维修 -->
)
VALUES (#id#, #companyCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #deleteFlag#, #repDate#, #repOrderNo#, #repCustomId#, #repUserId#, #repStatus#)
</insert>
<delete id="delete">
DELETE FROM hpjx.t_hpxs006 WHERE
ID = #id#
</delete>
<update id="update">
UPDATE hpjx.t_hpxs006
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#, <!-- 修改时间 -->
DELETE_FLAG = #deleteFlag#, <!-- 是否删除 0-否1-是 -->
REP_DATE = #repDate#, <!-- 维修日期 -->
REP_ORDER_NO = #repOrderNo#, <!-- 维修单号 -->
REP_CUSTOM_ID = #repCustomId#, <!-- 客户人员 -->
REP_USER_ID = #repUserId#, <!-- 维修人员 -->
REP_STATUS = #repStatus# <!-- 维修状态 0-待维修 1-已维修 -->
WHERE
ID = #id#
</update>
<update id="check">
UPDATE hpjx.t_hpxs006
SET
REP_STATUS = #repStatus# <!-- 维修状态 0-待维修 1-已维修 -->
WHERE
ID = #id#
</update>
<select id="queryUserId" parameterClass="java.util.HashMap" resultClass="java.util.HashMap">
select b.USER_ID as "userId",b.USER_NAME as "userName"
from iplat.txsog02 a
join iplat.xs_user b on a.USER_ID=b.USER_ID
join iplat.txsog01 c on c.ORG_ID = a.ORG_ID and c.IS_DELETED = 0
where 1=1
<isNotEmpty prepend=" AND " property="companyCode">
c.COMPANY_CODE = #companyCode#
</isNotEmpty>
<!-- <isNotEmpty prepend=" AND " property="factoryCodes">
c.FACTORY_CODE = #factoryCode#
</isNotEmpty>-->
<isNotEmpty prepend=" AND " property="factoryCodes">
c.FACTORY_CODE IN <iterate close=")" open="(" conjunction="," property="factoryCodes">#factoryCodes[]#</iterate>
</isNotEmpty>
</select>
</sqlMap>
\ No newline at end of file
$(function () {
$("#QUERY").on("click", query);
IPLATUI.EFGrid = {
"result": {
pageable: {
pageSize: 10,
pageSizes: [10, 20, 30, 50, 100, 200],
},
columns: [{
field: "operator",
template: function (item) {
let auditStatus = item.repStatus;
let template = '';
if (auditStatus) {
if (auditStatus == 0) {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;" ' +
'onclick="check(' + item.id + ',1)" >审核</a>';
}
}
return template;
}
}],
loadComplete: function(grid) {
},
onSave: function (e) {
// 阻止默认请求,使用自定义保存
e.preventDefault();
//let btnNode = $(this);
//禁用按钮
//btnNode.attr("disabled", true);
//saveResult(btnNode);
save();
},
onSuccess: function (e) {
if (e.eiInfo.extAttr.methodName == 'save') {
query();
}
},
onRowClick: function (e) {
},
}
}
});
let query = function () { resultGrid.dataSource.page(1);}
function check(id, auditStatus) {
const inEiInfo = new EiInfo();
inEiInfo.set("result-0-id", id);
inEiInfo.set("result-0-repStatus", auditStatus);
EiCommunicator.send('HPXS006', 'check', inEiInfo, {
onSuccess(response) {
//NotificationUtil(response.msg);
message("审核成功");
resultGrid.dataSource.page(1);
},
onFail(errorMessage, status, e) {
NotificationUtil("执行失败!", "error");
}
},
{
async: false
}
);
}
/**
* 删除
*/
/*function deleteFunc() {
var rows = resultGrid.getCheckedRows();
if (rows.length == 0) {
message("请先勾选数据!");
return;
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"删除\"操作?", {
ok: function () {
JSUtils.submitGridsData("result", "HPSC002A", "delete", true);
}
})
}*/
function save() {
var rows = resultGrid.getCheckedRows();
if (rows.length == 0) {
message("请先勾选数据!");
return;
}
for (let i = 0; i < rows.length; i++) {
if (rows[i]['repStatus']==1) {
message("勾选的第" + (i + 1) + "行已维修不允许修改!");
return;
}
if (isBlank(rows[i]['repDate'])) {
message("勾选的第" + (i + 1) + "行维修日期不能为空");
return;
}
if (isBlank(rows[i]['repCustomId'])) {
message("勾选的第" + (i + 1) + "行客户名称不能为空");
return;
}
if (isBlank(rows[i]['repUserId'])) {
message("勾选的第" + (i + 1) + "行维修人员不能为空");
return;
}
if (isBlank(rows[i]['repStatus'])) {
message("勾选的第" + (i + 1) + "行维修状态不能为空");
return;
}
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作?", {
ok: function () {
JSUtils.submitGridsData("result", "HPXS006", "save", true);
}
})
}
<%--
Created by IntelliJ IDEA.
User: 1
Date: 2024/3/25
Time: 16:17
To change this template use File | Settings | File Templates.
--%>
<!DOCTYPE html>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<EF:EFPage title="售后维修">
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<EF:EFDatePicker cname="维修日期" ename="repDate" blockId="inqu_status" row="0" colWidth="3"
format="yyyy-MM-dd" readonly="true"/>
<EF:EFInput cname="维修单号" ename="inqu_status-0-repOrderNo" colWidth="3"/>
<EF:EFSelect cname="客户名称" ename="inqu_status-0-repCustomId" colWidth="3" filter="contains" defultValue="">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="customer_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFSelect cname="维修人员" ename="inqu_status-0-repUserId" colWidth="3" filter="contains" defultValue="">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="rep_user_id_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFSelect blockId="inqu_status" row="0" ename="repStatus" cname="维修状态" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hpjx.hpxs.repStatus"/>
</EF:EFSelect>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row">
<EF:EFColumn ename="id" primaryKey="true" cname="主键" hidden="true"/>
<EF:EFColumn ename="companyCode" cname="公司编码" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="120" align="center"/>
<EF:EFColumn ename="repDate" cname="维修日期" width="100" align="center" editType="date" readonly="false"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true"/>
<EF:EFColumn ename="repOrderNo" cname="维修单号" enable="false" width="140" align="center"/>
<EF:EFComboColumn ename="repCustomId" cname="客户名称" width="120" align="center" required="true"
blockName="customer_record_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#" readonly="false"
filter="contains">
</EF:EFComboColumn>
<EF:EFComboColumn ename="repUserId" cname="维修人员" blockName="rep_user_id_block_id"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" readonly="false" width="160" required="true"
align="center" filter="contains" sort="true">
</EF:EFComboColumn>
<EF:EFComboColumn ename="repStatus" cname="维修状态" width="80" align="center" readonly="true" required="true" defaultValue="0">
<EF:EFCodeOption codeName="hpjx.hpxs.repStatus"/>
</EF:EFComboColumn>
<EF:EFColumn cname="创建人" ename="createdName" align="center" width="150" readonly="true" required="false" enable="false"/>
<EF:EFColumn cname="创建时间" ename="createdTime" parseFormats="['yyyyMMddHHmmss']" editType="datetime"
dateFormat="yyyy-MM-dd HH:mm:ss" align="center" width="150" readonly="true" required="false"
enable="false"/>
<EF:EFColumn cname="修改人" ename="updatedName" align="center" width="150" readonly="true" required="false" enable="false"/>
<EF:EFColumn cname="修改时间" ename="updatedTime" parseFormats="['yyyyMMddHHmmss']" editType="datetime"
dateFormat="yyyy-MM-dd HH:mm:ss" align="center" width="150" readonly="true" required="false"
enable="false"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment