Commit 8cfb6074 by yukang

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

parents 731a1783 a60a9b84
......@@ -167,6 +167,18 @@
<artifactId>oss-plugin</artifactId>
<version>7.0.0</version>
</dependency>
<!-- 二维码 -->
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-all</artifactId>
<version>5.8.27</version>
</dependency>
<dependency>
<groupId>com.google.zxing</groupId>
<artifactId>core</artifactId>
<version>3.5.3</version>
</dependency>
</dependencies>
<build>
......
......@@ -134,11 +134,18 @@ public enum DdynamicEnum {
/**
* 模块:组管理
* 用途:组管理下拉框
* 编写:songx
* 编写:w
*/
USER_GROUP_BLOCK_ID("user_group_block_id","groupCode","groupName","factoryCode","HPXSOrg.queryAppGroup"),
/**
* 模块:组管理
* 用途:组管理下拉框
* 编写:w
*/
SALE_NO_BLOCK_ID("sale_no_block_id","saleNo","saleNo","HPXS007.getSaleCode"),
/**
* 分厂与组一起查出,用于生产任务分派
*/
FACTORY_GROUP_ECORD_BLOCK_ID("factory_group_ecord_block_id","factoryCode","factoryName","groupCode","groupName","HPPZ011.queryComboBoxAll"),
......
package com.baosight.hpjx.controller;
import com.baosight.hpjx.hp.mt.untils.Base64ToMultipartFile;
import com.baosight.hpjx.core.utils.QrCodeUtils;
import com.baosight.hpjx.hp.mt.untils.UploadUtils2;
import com.baosight.hpjx.util.FileUtils;
import com.baosight.hpjx.util.LogUtils;
import com.baosight.hpjx.util.MapUtils;
import com.baosight.hpjx.util.StringUtils;
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.soa.XServiceManager;
import com.baosight.iplat4j.eu.dm.document.bos.s3.api.signed.SignedBosHelp;
import com.baosight.iplat4j.eu.dm.document.bos.s3.param.BosParamHelp;
import com.google.common.base.Joiner;
import lombok.extern.slf4j.Slf4j;
import net.sf.json.JSONObject;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import org.springframework.data.repository.query.Param;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.commons.CommonsMultipartFile;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URL;
import java.net.URLEncoder;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
import net.sf.json.JSONObject;
/**
* @author:songx
......@@ -51,7 +38,7 @@ public class FileUploadController {
Map resultMap = new HashMap();
try {
JSONObject upload = UploadUtils2.upload((CommonsMultipartFile)file);
resultMap.put("id",upload.getString("docId"));
resultMap.put("id", upload.getString("docId"));
resultMap.put("status", EiConstant.STATUS_SUCCESS);
resultMap.put("message", "SUCCESS");
return resultMap;
......@@ -61,4 +48,22 @@ public class FileUploadController {
return resultMap;
}
}
/**
* @param content
* @return
* @throws IOException
*/
@RequestMapping(value = "/createQrCode", method = RequestMethod.GET)
public Map<String, Object> createQrCode(@Param("content") String content) {
try {
return QrCodeUtils.create(content);
} catch (Exception e) {
Map resultMap = new HashMap();
resultMap.put("status", 500);
resultMap.put("message", LogUtils.getMsg(e));
return resultMap;
}
}
}
......@@ -36,4 +36,9 @@ public class OSConstant {
*/
public final static String DOWN_DIR = USER_DIR + SEPARATOR + "download";
/**
* 二维码目录
*/
public final static String QRCODE_DIR = USER_DIR + SEPARATOR + "qrcode";
}
package com.baosight.hpjx.core.utils;
import com.baosight.hpjx.core.constant.OSConstant;
import com.baosight.hpjx.util.FileUtils;
import com.baosight.hpjx.util.MapUtils;
import com.baosight.hpjx.util.StringUtils;
import com.baosight.iplat4j.core.ioc.spring.PlatApplicationContext;
import com.baosight.iplat4j.core.util.DateUtils;
import com.baosight.iplat4j.core.web.threadlocal.UserSession;
import com.baosight.iplat4j.eu.dm.PlatFileUploadUtils;
import com.baosight.iplat4j.eu.dm.util.IFileUploader;
import com.google.zxing.BarcodeFormat;
import com.google.zxing.EncodeHintType;
import com.google.zxing.MultiFormatWriter;
import com.google.zxing.WriterException;
import com.google.zxing.common.BitMatrix;
import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel;
import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.io.OutputStream;
import java.util.HashMap;
import java.util.Map;
import lombok.extern.slf4j.Slf4j;
/**
* 二维码工具类
*
* @author:songx
* @date:2024/4/16,14:47
*/
@Slf4j
public class QrCodeUtils {
// CODE_WIDTH:二维码宽度,单位像素
private static final int CODE_WIDTH = 400;
// CODE_HEIGHT:二维码高度,单位像素
private static final int CODE_HEIGHT = 400;
// FRONT_COLOR:二维码前景色,0x000000 表示黑色
private static final int FRONT_COLOR = 0x000000;
// BACKGROUND_COLOR:二维码背景色,0xFFFFFF 表示白色
// 演示用 16 进制表示,和前端页面 CSS 的取色是一样的,注意前后景颜色应该对比明显,如常见的黑白
private static final int BACKGROUND_COLOR = 0xFFFFFF;
/**
* 生成本地文件
* {
* "file": "D:\\home\\appuser\\qrCode\\20240416162700_mizw6izh.png",
* "docId": "90f1a41a48e644d1a56682be03a231db",
* "filePath": "D:\\home\\appuser\\qrCode\\20240416162700_mizw6izh.png",
* "fileLocation": "local"
* }
*
* @param content
*/
public static Map<String, Object> create(String content) throws Exception {
String fileLocation = PlatApplicationContext.getProperty("iplat4j.admin.upload.fileLocation");
if ("S3".equals(fileLocation)) {
return createByS3(content);
} else {
return createByLocal(content);
}
}
/**
* 生成二维码到S3
*
* @param content
* @return
*/
private static Map<String, Object> createByS3(String content) throws Exception {
// 生成二维码
File file = createFile(null, content);
Map inMap = new HashMap();
inMap.put("groupId", "hk_file");
inMap.put("configPathDefine", "qrCode");
Map<String, String> uploadMap = PlatFileUploadUtils.uploadFile(file, inMap);
log.warn("uploadMap", uploadMap);
String docId = MapUtils.getString(uploadMap, "docId");
// 上传成功以后需要删除本地文件
file.delete();
Map resultMap = new HashMap();
resultMap.put("fileLocation", "S3");
resultMap.put("docId", docId);
resultMap.put("filePath", MapUtils.getString(uploadMap, "docUrl"));
return resultMap;
}
/**
* 生成本地文件
*
* @param content
* @return
*/
private static Map<String, Object> createByLocal(String content) throws Exception {
IFileUploader fileUploader = PlatApplicationContext.getApplicationContext()
.getBean("platFileUploader", IFileUploader.class);
Map<String, String> pathMap = fileUploader.getRealPath("qrCode");
String category = pathMap.get("path");
File dir = new File(category);
if (!dir.exists()) {
dir.mkdirs();
}
String fileName = StringUtils.uuid();
String fileNameAll = fileName + ".png";
String chgName = fileUploader.transformFileName(fileNameAll);
// 生成本地文件
File file = createFile(category + "/" + chgName, content);
// 写入记录
Map map = new HashMap();
map.put("docId", fileName);
map.put("dirId", pathMap.get("dirId"));
map.put("docTag", "hk_file");
map.put("docName", fileNameAll);
map.put("chgName", chgName);
map.put("docSize", file.length());
map.put("recCreator", UserSession.getLoginName());
map.put("recCreateTime", DateUtils.curDateTimeStr14());
fileUploader.uploadDoc(map);
Map resultMap = new HashMap();
resultMap.put("fileLocation", "local");
resultMap.put("docId", fileName);
resultMap.put("filePath", file.getAbsolutePath());
resultMap.put("file", file);
return resultMap;
}
/**
* 生成二维码文件
*
* @param filePath
* @param content
* @return
* @throws Exception
*/
private static File createFile(String filePath, String content) throws IOException, WriterException {
// 文件如果不存在就创建
if (StringUtils.isBlank(filePath)) {
filePath = OSConstant.QRCODE_DIR + OSConstant.SEPARATOR + StringUtils.uuid() + ".png";
}
FileUtils.creatFiles(filePath);
File file = new File(filePath);
//核心代码-生成二维码
BufferedImage bufferedImage = getBufferedImage(content.trim());
ImageIO.write(bufferedImage, "png", file);
return file;
}
/**
* 生成二维码并输出到输出流, 通常用于输出到网页上进行显示,输出到网页与输出到磁盘上的文件中,区别在于最后一句 ImageIO.write
* write(RenderedImage im,String formatName,File output):写到文件中
* write(RenderedImage im,String formatName,OutputStream output):输出到输出流中
*
* @param content :二维码内容
* @param outputStream :输出流,比如 HttpServletResponse 的 getOutputStream
*/
public static void create(String content, OutputStream outputStream) throws WriterException, IOException {
if (StringUtils.isBlank(content)) {
return;
}
content = content.trim();
//核心代码-生成二维码
BufferedImage bufferedImage = getBufferedImage(content);
//区别就是这一句,输出到输出流中,如果第三个参数是 File,则输出到文件中
ImageIO.write(bufferedImage, "png", outputStream);
}
/**
* 核心代码-生成二维码
*
* @param content
* @return
* @throws WriterException
*/
private static BufferedImage getBufferedImage(String content) throws WriterException {
//com.google.zxing.EncodeHintType:编码提示类型,枚举类型
Map<EncodeHintType, Object> hints = new HashMap();
//EncodeHintType.CHARACTER_SET:设置字符编码类型
hints.put(EncodeHintType.CHARACTER_SET, "UTF-8");
//EncodeHintType.ERROR_CORRECTION:设置误差校正
//ErrorCorrectionLevel:误差校正等级,L = ~7% correction、M = ~15% correction、Q = ~25% correction、H = ~30% correction
//不设置时,默认为 L 等级,等级不一样,生成的图案不同,但扫描的结果是一样的
hints.put(EncodeHintType.ERROR_CORRECTION, ErrorCorrectionLevel.M);
//EncodeHintType.MARGIN:设置二维码边距,单位像素,值越小,二维码距离四周越近
hints.put(EncodeHintType.MARGIN, 1);
MultiFormatWriter multiFormatWriter = new MultiFormatWriter();
BitMatrix bitMatrix = multiFormatWriter.encode(content, BarcodeFormat.QR_CODE, CODE_WIDTH, CODE_HEIGHT, hints);
BufferedImage bufferedImage = new BufferedImage(CODE_WIDTH, CODE_HEIGHT, BufferedImage.TYPE_INT_BGR);
for (int x = 0; x < CODE_WIDTH; x++) {
for (int y = 0; y < CODE_HEIGHT; y++) {
bufferedImage.setRGB(x, y, bitMatrix.get(x, y) ? FRONT_COLOR : BACKGROUND_COLOR);
}
}
return bufferedImage;
}
}
package com.baosight.hpjx.hp.bi.service;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baosight.eplat.be.dz.constants.BEDZConstants;
import com.baosight.hpjx.aspect.annotation.OperationLogAnnotation;
import com.baosight.hpjx.common.InventTypeEnum;
import com.baosight.hpjx.core.security.UserSessionUtils;
import com.baosight.hpjx.util.DateUtils;
import com.baosight.hpjx.util.StringUtils;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.service.impl.ServiceBase;
import com.baosight.iplat4j.core.service.soa.XServiceManager;
import java.util.*;
import static com.baosight.eplat.be.dz.service.ServiceBEDZ04.PARAMS_KEY_STR;
/**
* @author wancheng
* @date 2024年02月01日 17:18
*/
public class ServiceHPBI003 extends ServiceBase {
/**
* 查询报屏设备状态
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "设备监控",operType = "查询",operDesc = "查询报屏模块日产量")
public EiInfo querySbStatus(EiInfo inInfo) {
String companyCode = UserSessionUtils.getCompanyCode();
String factoryCode = (String) inInfo.get("factoryCode");
String deviceCode = (String) inInfo.get("deviceCode");
Map sqlMap = new HashMap();
sqlMap.put("companyCode", companyCode);
sqlMap.put("factoryCode", factoryCode);
sqlMap.put("deviceCode", deviceCode);
List<Map> result = this.dao.query("HPBI003.querySbStatus", sqlMap);
inInfo.set("result",result);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
return inInfo;
}
/**
* 日作业率 ba260e11f7014b6ea19be8239cd43218
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "设备监控",operType = "查询",operDesc = "各组组拼加焊综合产量")
public EiInfo queryZYLInfo(EiInfo inInfo) {
String paramsStr = inInfo.getString(PARAMS_KEY_STR);
JSONArray jsonArray = (JSONArray) JSONArray.parse(paramsStr);
JSONObject jsonObject = (JSONObject) jsonArray.get(0);
JSONArray idsArr = (JSONArray) jsonObject.get("ids");
String idsStr = idsArr.getString(0);
JSONObject paramsObj = null;
if (jsonObject.get("params") instanceof String) {
paramsObj=JSON.parseObject((String) jsonObject.get("params"));
} else {
paramsObj= (JSONObject) jsonObject.get("params");
}
String deviceCodeStr = paramsObj.getString("deviceCode");
EiInfo eiInfo = new EiInfo();
String serviceId = "S_BE_XP_17";
eiInfo.set(EiConstant.serviceId,serviceId);
Map map = new HashMap();
map.put("uuid","ba260e11f7014b6ea19be8239cd43218");
map.put("offset",0);
map.put("limit",1000);
//获取公司代码
String companycode = "%";
if(!StringUtils.isEmpty(UserSessionUtils.getCompanyCode().trim())){
companycode = UserSessionUtils.getCompanyCode();
}
//数据集入参
Map params =new HashMap();
params.put("companycode",companycode);
params.put("deviceCode",deviceCodeStr);
map.put("params",params);
List list =new ArrayList();
list.add(map);
eiInfo.set("queryInfo",list);
//服务接口调用
EiInfo outInfo = XServiceManager.call(eiInfo);
//调用微服务后的结果
Map result = (Map) outInfo.get("result");
Map result1 = (Map) result.get("ba260e11f7014b6ea19be8239cd43218");
List<Map> list1 = (List) result1.get("data");
JSONArray tempArr = new JSONArray();
String json = "appEname,date,unitCover";
List tempContentList = Arrays.asList(json.split(","));
tempArr.add(tempContentList);
JSONObject item = new JSONObject();
list1.forEach(obj -> {
// 处理obj
List datalist =new ArrayList();
datalist.add(obj.get("SERIES"));
datalist.add(obj.get("X"));
datalist.add(obj.get("VALUE"));
tempArr.add(datalist);
});
JSONArray ids = new JSONArray();
ids.add(idsStr);
item.put("ids", ids);
item.put("component", null);
item.put("data", tempArr);
List list2 =new ArrayList();
list2.add(item);
outInfo.set("result",list2);
return outInfo;
}
/**
* 日故障率 c6bd51e5c73345f2ad7851d4c4aa1820
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "设备监控",operType = "查询",operDesc = "各组组拼加焊综合产量")
public EiInfo queryGZLInfo(EiInfo inInfo) {
String paramsStr = inInfo.getString(PARAMS_KEY_STR);
JSONArray jsonArray = (JSONArray) JSONArray.parse(paramsStr);
JSONObject jsonObject = (JSONObject) jsonArray.get(0);
JSONArray idsArr = (JSONArray) jsonObject.get("ids");
String idsStr = idsArr.getString(0);
JSONObject paramsObj = null;
if (jsonObject.get("params") instanceof String) {
paramsObj=JSON.parseObject((String) jsonObject.get("params"));
} else {
paramsObj= (JSONObject) jsonObject.get("params");
}
String deviceCodeStr = paramsObj.getString("deviceCode");
EiInfo eiInfo = new EiInfo();
String serviceId = "S_BE_XP_17";
eiInfo.set(EiConstant.serviceId,serviceId);
Map map = new HashMap();
map.put("uuid","c6bd51e5c73345f2ad7851d4c4aa1820");
map.put("offset",0);
map.put("limit",1000);
//获取公司代码
String companycode = "%";
if(!StringUtils.isEmpty(UserSessionUtils.getCompanyCode().trim())){
companycode = UserSessionUtils.getCompanyCode();
}
//数据集入参
Map params =new HashMap();
params.put("companycode",companycode);
params.put("deviceCode",deviceCodeStr);
map.put("params",params);
List list =new ArrayList();
list.add(map);
eiInfo.set("queryInfo",list);
//服务接口调用
EiInfo outInfo = XServiceManager.call(eiInfo);
//调用微服务后的结果
Map result = (Map) outInfo.get("result");
Map result1 = (Map) result.get("c6bd51e5c73345f2ad7851d4c4aa1820");
List<Map> list1 = (List) result1.get("data");
JSONArray tempArr = new JSONArray();
String json = "appEname,date,unitCover";
List tempContentList = Arrays.asList(json.split(","));
tempArr.add(tempContentList);
JSONObject item = new JSONObject();
list1.forEach(obj -> {
// 处理obj
List datalist =new ArrayList();
datalist.add(obj.get("SERIES"));
datalist.add(obj.get("X"));
datalist.add(obj.get("VALUE"));
tempArr.add(datalist);
});
JSONArray ids = new JSONArray();
ids.add(idsStr);
item.put("ids", ids);
item.put("component", null);
item.put("data", tempArr);
List list2 =new ArrayList();
list2.add(item);
outInfo.set("result",list2);
return outInfo;
}
}
<?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="HPBI003">
<select id="querySbStatus" parameterClass="java.util.HashMap"
resultClass="java.util.HashMap">
select
a.DEVICE_CODE,b.ORG_CNAME,a.DEVICE_NAME,a.DEVICE_MODEL,
case when c.LOG_VALUE = 2 then 1 else 0 end as DEVICE_STATUS,
case when c.LOG_VALUE = 2 then '运行状态'
when c.LOG_VALUE = 1 then '默认状态'
when c.LOG_VALUE = 3 then '暂停状态'
when c.LOG_VALUE = 4 then '复位状态'
when c.LOG_VALUE = 5 then '一级报警状态'
when c.LOG_VALUE = 6 then '二级报警状态'
else '异常状态' end as STATUS_DESC
from hpjx.t_hpsb003 a
join iplat.TXSOG01 b on a.GROUP_CODE = b.ORG_ID and b.IS_DELETED = 0
join hpjx.t_hpsb002 c on a.DEVICE_CODE=c.EQUIPMENT_CODE
where a.DELETE_FLAG = 0 and DEVICE_STATUS = 1 and c.EQUIPMENT_TYPE = 'STARUS_TYPE'
<isNotEmpty prepend=" AND " property="companyCode">
a.COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryCode">
a.FACTORY_CODE = #factoryCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deviceCode">
a.DEVICE_CODE = #deviceCode#
</isNotEmpty>
order by c.CREATED_TIME desc
limit 1
</select>
</sqlMap>
\ No newline at end of file
......@@ -60,6 +60,10 @@ public class HPConstant {
public static final String PROD_TASK_NO = "PROD_TASK_NO";
//售后维修单号
public static final String HPXS006_PROD_NO = "HPXS006_NUMBER";
//销售单号
public static final String HPPZ017_SALES_CODE = "HPPZ017_SALES_CODE";
//销售计划单号
public static final String PLAN_SALES_CODE = "PLAN_SALES_CODE";
}
/**
......
......@@ -316,6 +316,8 @@ public class HPSqlConstant {
// 修改状态
public static final String UPDATE_STATUS = "HPSC003.updateStatus";
// 修改状态
public static final String UPDATE_QRCODE = "HPSC003.updateQrcode";
// 修改时间
public static final String UPDATE_DATE = "HPSC003.updateDate";
......
......@@ -2,10 +2,16 @@ package com.baosight.hpjx.hp.ds.service;
import com.baosight.hpjx.aspect.annotation.OperationLogAnnotation;
import com.baosight.hpjx.hp.ds.domain.HPDS001;
import com.baosight.hpjx.util.ErrorCodeUtils;
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.ServiceBase;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import java.util.HashMap;
/**
* Title: 历史数据清理 <br>
* @author LiuYang
......@@ -21,6 +27,16 @@ public class ServiceHPDS001 extends ServiceEPBase {
@OperationLogAnnotation(operModul = "系统操作日志", operType = "删除", operDesc = "删除6个月之前的历史数据")
public EiInfo deleteHistory(EiInfo inInfo) {
return super.delete(inInfo,"HPDS001.deleteHistory");
try {
this.dao.delete("HPDS001.deleteHistory",new HashMap<>());
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsgByKey("ep.1000", new String[]{String.valueOf(0), I18nMessages.getText("label.delete", "删除")});
}catch (PlatException e){
e.printStackTrace();
inInfo.setStatus(EiConstant.STATUS_FAILURE);
ErrorCodeUtils.handleDeleteException(inInfo,0,e);
logError("删除失败", e.getMessage());
}
return inInfo;
}
}
package com.baosight.hpjx.hp.pz.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.constant.HPConstant;
import com.baosight.hpjx.hp.pz.domain.HPPZ017;
import com.baosight.hpjx.hp.pz.domain.HPPZ018;
import com.baosight.hpjx.hp.pz.tools.HPPZTools;
import com.baosight.hpjx.util.AssertUtils;
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.math.BigDecimal;
import java.math.RoundingMode;
import java.util.*;
/**
* @author LiuYang
* @version 1.0 2024/4/22
*/
public class ServiceHPPZ017 extends ServiceEPBase {
public static final String[] MONTHS = {"01","02","03","04","05","06","07","08","09","10","11","12"};
@Override
public EiInfo initLoad(EiInfo inInfo) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HPPZ017.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
final EiInfo outEiInfo = super.query(inInfo, HPPZ017.QUERY, new HPPZ017());
return outEiInfo;
}
@Override
public EiInfo query(EiInfo inInfo) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HPPZ017.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
return super.query(inInfo,HPPZ017.QUERY);
}
@OperationLogAnnotation(operModul = "销售目标",operType = "删除",operDesc = "删除操作")
@Override
public EiInfo delete(EiInfo inInfo) {
int i = 0;
try {
HPPZ017 hppz017 = new HPPZ017();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
for (i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
hppz017.fromMap(map);
hppz017.setDeleteFlag(CommonConstant.YesNo.YES_1);
DaoUtils.update(HPPZ017.DELETE_FLAG, hppz017);
}
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 (int i = 0; i < resultRows.size(); i++) {
HPPZ017 hppz017 = new HPPZ017();
hppz017.fromMap(resultRows.get(i));
if (hppz017.getId() == null || hppz017.getId() == 0) {
this.add(hppz017);
} else {
this.modify(hppz017);
}
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 新增操作
*/
public void add(HPPZ017 hppz017) {
hppz017.setSalesCode(SequenceGenerator.getNextSequence(HPConstant.SequenceId.HPPZ017_SALES_CODE));
List<HPPZ017> hppz017s = HPPZTools.HpPz017.getYear(hppz017.getYear());
AssertUtils.isNotEmpty(hppz017s, String.format("年度[%s]已存在", hppz017.getYear()));
DaoUtils.insert(HPPZ017.INSERT, hppz017);
}
/**
* 修改操作
*/
public void modify(HPPZ017 hppz017) {
DaoUtils.update(HPPZ017.UPDATE, hppz017);
}
/**
* 分解销售目标
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "销售目标",operType = "分解",operDesc = "分解销售目标")
public EiInfo resolve(EiInfo inInfo){
try {
//List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
//修改状态 1已分解
String id = inInfo.getCellStr(EiConstant.queryBlock,ACConstants.ROW_CODE_0,HPPZ017.FIELD_ID);
String status = inInfo.getCellStr(EiConstant.queryBlock,ACConstants.ROW_CODE_0,HPPZ017.FIELD_STATUS);
HPPZ017 hppz017 = HPPZTools.HpPz017.getId(Long.valueOf(id));
hppz017.setStatus(Integer.valueOf(status));
DaoUtils.update(HPPZ017.UPDATE,hppz017);
//分解目标
HPPZ018 hppz018 = new HPPZ018();
hppz018.toMap();
hppz018.setYear(hppz017.getYear());
hppz018.setSalesCode(hppz017.getSalesCode());
BigDecimal bigDecimal = hppz017.getSalesAmount().divide(new BigDecimal(12),2,RoundingMode.UP);
for (String months:MONTHS) {
hppz018.setMonth(months);
hppz018.setPlanSalesCode(SequenceGenerator.getNextSequence(HPConstant.SequenceId.PLAN_SALES_CODE));
hppz018.setSalesAmount(bigDecimal);
DaoUtils.insert(HPPZ018.INSERT, hppz018);
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次数据分解成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "分解失败");
}
return inInfo;
}
}
package com.baosight.hpjx.hp.pz.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.constant.HPConstant;
import com.baosight.hpjx.hp.pz.domain.HPPZ018;
import com.baosight.hpjx.hp.pz.tools.HPPZTools;
import com.baosight.hpjx.util.AssertUtils;
import com.baosight.hpjx.util.ErrorCodeUtils;
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.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;
/**
* @author LiuYang
* @version 1.0 2024/4/22
*/
public class ServiceHPPZ018 extends ServiceEPBase {
@Override
public EiInfo initLoad(EiInfo inInfo) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HPPZ018.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
final EiInfo outEiInfo = super.query(inInfo, HPPZ018.QUERY, new HPPZ018());
return outEiInfo;
}
@Override
public EiInfo query(EiInfo inInfo) {
return super.query(inInfo,HPPZ018.QUERY);
}
@OperationLogAnnotation(operModul = "销售计划",operType = "删除",operDesc = "删除操作")
@Override
public EiInfo delete(EiInfo inInfo) {
int i = 0;
try {
HPPZ018 hppz018 = new HPPZ018();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
for (i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
hppz018.fromMap(map);
hppz018.setDeleteFlag(CommonConstant.YesNo.YES_1);
DaoUtils.update(HPPZ018.DELETE_FLAG, hppz018);
}
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 (int i = 0; i < resultRows.size(); i++) {
HPPZ018 hppz018 = new HPPZ018();
hppz018.fromMap(resultRows.get(i));
if (hppz018.getId() == null || hppz018.getId() == 0) {
this.add(hppz018);
} else {
this.modify(hppz018);
}
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 新增操作
*/
public void add(HPPZ018 hppz018) {
hppz018.setPlanSalesCode(SequenceGenerator.getNextSequence(HPConstant.SequenceId.PLAN_SALES_CODE));
List<HPPZ018> hppz018s = HPPZTools.HpPz018.getYear(hppz018.getYear());
AssertUtils.isNotEmpty(hppz018s, String.format("年度[%s]已存在", hppz018.getYear()));
DaoUtils.insert(HPPZ018.INSERT, hppz018);
}
/**
* 修改操作
*/
public void modify(HPPZ018 hppz018) {
DaoUtils.update(HPPZ018.UPDATE, hppz018);
}
public EiInfo updateStatus(EiInfo inInfo){
int i = 0;
try {
HPPZ018 hppz018 = new HPPZ018();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
for (i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
hppz018.fromMap(map);
DaoUtils.update(HPPZ018.UPDATE_STATUS, hppz018);
}
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsgByKey("ep.1000", new String[]{String.valueOf(i), I18nMessages.getText("label.update", "修改")});
} catch (PlatException e) {
e.printStackTrace();
inInfo.setStatus(EiConstant.STATUS_FAILURE);
ErrorCodeUtils.handleUpdateException(inInfo,i,e);
logError("修改失败", e.getMessage());
return inInfo;
}
return inInfo;
}
}
<?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-04-22 11:06:57
Version : 1.0
schema : hpjx
tableName : T_HPPZ017
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,
YEAR VARCHAR,
SALES_CODE VARCHAR,
SALES_AMOUNT DECIMAL,
TARGET_EXPLAIN VARCHAR
-->
<sqlMap namespace="HPPZ017">
<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="deleteFlag">
DELETE_FLAG = #deleteFlag#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="year">
YEAR = #year#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="salesCode">
SALES_CODE = #salesCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="salesAmount">
SALES_AMOUNT LIKE CONCAT(#salesAmount#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="targetExplain">
TARGET_EXPLAIN = #targetExplain#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="status">
STATUS = #status#
</isNotEmpty>
</sql>
<select id="query" parameterClass="java.util.HashMap"
resultClass="com.baosight.hpjx.hp.pz.domain.HPPZ017">
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.是 -->
YEAR as "year", <!-- 年度 -->
SALES_CODE as "salesCode", <!-- 销售单号 -->
SALES_AMOUNT as "salesAmount", <!-- 销售额 -->
TARGET_EXPLAIN as "targetExplain", <!-- 目标说明 -->
STATUS as "status"
FROM ${hpjxSchema}.T_HPPZ017 WHERE 1=1
<include refid="condition" />
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
YEAR DESC
</isEmpty>
</dynamic>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hpjxSchema}.T_HPPZ017 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="deleteFlag">
DELETE_FLAG = #deleteFlag#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="year">
YEAR = #year#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="salesCode">
SALES_CODE = #salesCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="salesAmount">
SALES_AMOUNT = #salesAmount#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="targetExplain">
TARGET_EXPLAIN = #targetExplain#
</isNotEmpty>
-->
<insert id="insert">
INSERT INTO ${hpjxSchema}.T_HPPZ017 (ID, <!-- ID -->
COMPANY_CODE, <!-- 企业编码 -->
DEP_CODE, <!-- 部门编码 -->
CREATED_BY, <!-- 创建人 -->
CREATED_NAME, <!-- 创建人名称 -->
CREATED_TIME, <!-- 创建时间 -->
UPDATED_BY, <!-- 修改人 -->
UPDATED_NAME, <!-- 修改人名称 -->
UPDATED_TIME, <!-- 修改时间 -->
DELETE_FLAG, <!-- 是否删除0:否1.是 -->
YEAR, <!-- 年度 -->
SALES_CODE, <!-- 销售单号 -->
SALES_AMOUNT, <!-- 销售额 -->
TARGET_EXPLAIN, <!-- 目标说明 -->
STATUS
)
VALUES (#id#, #companyCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #deleteFlag#, #year#, #salesCode#, #salesAmount#, #targetExplain#, #status#)
</insert>
<delete id="delete">
DELETE FROM ${hpjxSchema}.T_HPPZ017 WHERE
ID = #id#
</delete>
<!--逻辑删除-->
<update id="deleteFlag">
UPDATE ${hpjxSchema}.T_HPPZ017
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_HPPZ017
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.是 -->
YEAR = #year#, <!-- 年度 -->
SALES_CODE = #salesCode#, <!-- 销售单号 -->
SALES_AMOUNT = #salesAmount#, <!-- 销售额 -->
TARGET_EXPLAIN = #targetExplain#, <!-- 目标说明 -->
STATUS = #status#
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-04-22 15:24:59
Version : 1.0
schema : hpjx
tableName : T_HPPZ018
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,
YEAR VARCHAR,
MONTH VARCHAR,
SALES_CODE VARCHAR,
PLAN_SALES_CODE VARCHAR,
SALES_AMOUNT DECIMAL
-->
<sqlMap namespace="HPPZ018">
<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="deleteFlag">
DELETE_FLAG = #deleteFlag#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="year">
YEAR = #year#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="month">
MONTH = #month#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="salesCode">
SALES_CODE = #salesCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="planSalesCode">
PLAN_SALES_CODE = #planSalesCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="salesAmount">
SALES_AMOUNT LIKE CONCAT(#salesAmount#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="status">
STATUS = #status#
</isNotEmpty>
</sql>
<select id="query" parameterClass="java.util.HashMap"
resultClass="com.baosight.hpjx.hp.pz.domain.HPPZ018">
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.是 -->
YEAR as "year", <!-- 年度 -->
MONTH as "month", <!-- 月份 -->
SALES_CODE as "salesCode", <!-- 销售单号 -->
PLAN_SALES_CODE as "planSalesCode", <!-- 销售计划单号 -->
SALES_AMOUNT as "salesAmount", <!-- 营销额 -->
STATUS as "status" <!-- 状态 0-未审核,1-已审核 -->
FROM ${hpjxSchema}.T_HPPZ018 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_HPPZ018 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="deleteFlag">
DELETE_FLAG = #deleteFlag#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="year">
YEAR = #year#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="month">
MONTH = #month#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="salesCode">
SALES_CODE = #salesCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="planSalesCode">
PLAN_SALES_CODE = #planSalesCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="salesAmount">
SALES_AMOUNT = #salesAmount#
</isNotEmpty>
-->
<insert id="insert">
INSERT INTO ${hpjxSchema}.T_HPPZ018 (ID, <!-- ID -->
COMPANY_CODE, <!-- 企业编码 -->
DEP_CODE, <!-- 部门编码 -->
CREATED_BY, <!-- 创建人 -->
CREATED_NAME, <!-- 创建人名称 -->
CREATED_TIME, <!-- 创建时间 -->
UPDATED_BY, <!-- 修改人 -->
UPDATED_NAME, <!-- 修改人名称 -->
UPDATED_TIME, <!-- 修改时间 -->
DELETE_FLAG, <!-- 是否删除0:否1.是 -->
YEAR, <!-- 年度 -->
MONTH, <!-- 月份 -->
SALES_CODE, <!-- 销售单号 -->
PLAN_SALES_CODE, <!-- 销售计划单号 -->
SALES_AMOUNT, <!-- 营销额 -->
STATUS
)
VALUES (#id#, #companyCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #deleteFlag#, #year#, #month#, #salesCode#, #planSalesCode#, #salesAmount#, #status#)
</insert>
<delete id="delete">
DELETE FROM ${hpjxSchema}.T_HPPZ018 WHERE
ID = #id#
</delete>
<!--逻辑删除-->
<update id="deleteFlag">
UPDATE ${hpjxSchema}.T_HPPZ018
SET
UPDATED_BY = #updatedBy#, <!-- 修改人 -->
UPDATED_NAME = #updatedName#, <!-- 修改人名称 -->
UPDATED_TIME = #updatedTime#, <!-- 修改时间 -->
DELETE_FLAG = #deleteFlag#, <!-- 是否删除0:否1.是 -->
WHERE
ID = #id#
</update>
<!--审批状态-->
<update id="updateStatus">
UPDATE ${hpjxSchema}.T_HPPZ018
SET
UPDATED_BY = #updatedBy#, <!-- 修改人 -->
UPDATED_NAME = #updatedName#, <!-- 修改人名称 -->
UPDATED_TIME = #updatedTime#, <!-- 修改时间 -->
STATUS = #status#
WHERE
ID = #id#
</update>
<update id="update">
UPDATE ${hpjxSchema}.T_HPPZ018
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.是 -->
YEAR = #year#, <!-- 年度 -->
MONTH = #month#, <!-- 月份 -->
SALES_CODE = #salesCode#, <!-- 销售单号 -->
PLAN_SALES_CODE = #planSalesCode#, <!-- 销售计划单号 -->
SALES_AMOUNT = #salesAmount#, <!-- 营销额 -->
STATUS = #status#
WHERE
ID = #id#
</update>
</sqlMap>
......@@ -7,15 +7,7 @@ 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.constant.HPSqlConstant;
import com.baosight.hpjx.hp.pz.domain.HPPZ004;
import com.baosight.hpjx.hp.pz.domain.HPPZ006;
import com.baosight.hpjx.hp.pz.domain.HPPZ007;
import com.baosight.hpjx.hp.pz.domain.HPPZ009;
import com.baosight.hpjx.hp.pz.domain.HPPZ010;
import com.baosight.hpjx.hp.pz.domain.HPPZ011;
import com.baosight.hpjx.hp.pz.domain.HPPZ013;
import com.baosight.hpjx.hp.pz.domain.HPPZ015;
import com.baosight.hpjx.hp.pz.domain.HPPZ015A;
import com.baosight.hpjx.hp.pz.domain.*;
import com.baosight.hpjx.hp.sc.domain.HPSC001;
import com.baosight.hpjx.hp.sc.domain.HPSC002;
import com.baosight.hpjx.hp.sc.tools.HPSCTools;
......@@ -124,7 +116,7 @@ public class HPPZTools {
if(pz004s!=null&&pz004s.size()==0){
pz004s = null;
}
AssertUtils.isNull(pz004s, String.format("存货编码[%s]不存在", inventCode));
AssertUtils.isEmpty(pz004s, String.format("存货编码[%s]不存在", inventCode));
return pz004s.get(0);
}
......@@ -213,7 +205,7 @@ public class HPPZTools {
if(pz007s.size()==0){
pz007s = null;
}
AssertUtils.isNull(pz007s, String.format("仓库编码[%s]不存在", whCode));
AssertUtils.isEmpty(pz007s, String.format("仓库编码[%s]不存在", whCode));
return pz007s.get(0);
}
......@@ -704,7 +696,7 @@ public class HPPZTools {
Map queryMap = new HashMap();
queryMap.put("prdtCode", prdtCode);
List<HPPZ015> results = DaoBase.getInstance().query("HPPZ015.query", queryMap);
AssertUtils.isNull(results, String.format("部件编码[%s]信息不存在", prdtCode));
AssertUtils.isEmpty(results, String.format("部件编码[%s]信息不存在", prdtCode));
return results.get(0);
}
}
......@@ -728,7 +720,7 @@ public class HPPZTools {
Map queryMap = new HashMap();
queryMap.put("prdtCode", prdtCode);
List<HPPZ015A> results = DaoBase.getInstance().query("HPPZ015A.query", queryMap);
AssertUtils.isNull(results, String.format("部件编码[%s]信息不存在", prdtCode));
AssertUtils.isEmpty(results, String.format("部件编码[%s]信息不存在", prdtCode));
return results.get(0);
}
......@@ -743,7 +735,7 @@ public class HPPZTools {
Map queryMap = new HashMap();
queryMap.put("id", id);
List<HPPZ015A> results = DaoBase.getInstance().query("HPPZ015A.queryEntityByParentPrtdCode", queryMap);
AssertUtils.isNull(results, String.format("节点ID[%s]信息不存在", id));
AssertUtils.isEmpty(results, String.format("节点ID[%s]信息不存在", id));
return results.get(0);
}
......@@ -828,4 +820,48 @@ public class HPPZTools {
}
public static class HpPz017 {
/**
* 查询年份信息
*
* @param year
* @return
*/
public static List<HPPZ017> getYear(String year) {
AssertUtils.isNull(year, String.format("年份不能为空", year));
Map queryMap = new HashMap();
queryMap.put("year", year);
List<HPPZ017> results = DaoBase.getInstance().query(HPPZ017.QUERY, queryMap);
return results;
}
public static HPPZ017 getId(Long id){
AssertUtils.isNull(id, "ID不能为空");
Map queryMap = new HashMap();
queryMap.put("id", id);
List<HPPZ017> results = DaoBase.getInstance().query(HPPZ017.QUERY, queryMap);
AssertUtils.isEmpty(results, String.format("ID[%s]不存在", id));
return results.get(0);
}
}
public static class HpPz018 {
/**
* 查询年份信息
*
* @param year
* @return
*/
public static List<HPPZ018> getYear(String year) {
AssertUtils.isNull(year, String.format("年份不能为空", year));
Map queryMap = new HashMap();
queryMap.put("year", year);
List<HPPZ018> results = DaoBase.getInstance().query(HPPZ017.QUERY, queryMap);
return results;
}
}
}
......@@ -7,11 +7,13 @@ import com.baosight.hpjx.core.security.UserSessionUtils;
import com.baosight.hpjx.hp.sb.domain.HPSB001;
import com.baosight.hpjx.hp.sc.domain.HPSC001;
import com.baosight.hpjx.util.CommonMethod;
import com.baosight.hpjx.util.ErrorCodeUtils;
import com.baosight.hpjx.util.LogUtils;
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.ServiceBase;
import com.baosight.iplat4j.core.web.threadlocal.UserSession;
......@@ -145,7 +147,17 @@ public class ServiceHPSB001 extends ServiceBase {
*/
@OperationLogAnnotation(operModul = "设备异常日志", operType = "删除", operDesc = "删除30天之前的历史数据")
public EiInfo deleteHistory(EiInfo inInfo) {
return super.delete(inInfo,"HPSB001.deleteByCreatedTime");
try {
this.dao.delete("HPSB001.deleteByCreatedTime",new HashMap<>());
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsgByKey("ep.1000", new String[]{String.valueOf(0), I18nMessages.getText("label.delete", "删除")});
}catch (PlatException e){
e.printStackTrace();
inInfo.setStatus(EiConstant.STATUS_FAILURE);
ErrorCodeUtils.handleDeleteException(inInfo,0,e);
logError("删除失败", e.getMessage());
}
return inInfo;
}
}
......@@ -3,15 +3,18 @@ package com.baosight.hpjx.hp.sb.service;
import com.baosight.hpjx.aspect.annotation.OperationLogAnnotation;
import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.hp.sb.domain.HPSB002;
import com.baosight.hpjx.util.ErrorCodeUtils;
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.ServiceBase;
import com.baosight.iplat4j.core.web.threadlocal.UserSession;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
/**
......@@ -140,7 +143,17 @@ public class ServiceHPSB002 extends ServiceBase {
*/
@OperationLogAnnotation(operModul = "设备日志", operType = "删除", operDesc = "删除30天之前的历史数据")
public EiInfo deleteHistory(EiInfo inInfo) {
return super.delete(inInfo,"HPSB002.deleteByCreatedTime");
try {
this.dao.delete("HPSB002.deleteByCreatedTime",new HashMap<>());
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsgByKey("ep.1000", new String[]{String.valueOf(0), I18nMessages.getText("label.delete", "删除")});
}catch (PlatException e){
e.printStackTrace();
inInfo.setStatus(EiConstant.STATUS_FAILURE);
ErrorCodeUtils.handleDeleteException(inInfo,0,e);
logError("删除失败", e.getMessage());
}
return inInfo;
}
}
......@@ -46,12 +46,18 @@
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
CREATED_BY LIKE CONCAT('%', #createdBy#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="errorCode">
ERROR_CODE LIKE CONCAT('%', #errorCode#, '%')
</isNotEmpty>
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
ID asc
CREATED_TIME desc
</isEmpty>
</dynamic>
......@@ -62,6 +68,12 @@
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
CREATED_BY LIKE CONCAT('%', #createdBy#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="errorCode">
ERROR_CODE LIKE CONCAT('%', #errorCode#, '%')
</isNotEmpty>
</select>
<!--
......
......@@ -38,12 +38,15 @@
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
CREATED_BY LIKE CONCAT('%', #createdBy#, '%')
</isNotEmpty>
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
ID asc
CREATED_TIME desc
</isEmpty>
</dynamic>
......@@ -54,6 +57,9 @@
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
CREATED_BY LIKE CONCAT('%', #createdBy#, '%')
</isNotEmpty>
</select>
<!--
......
......@@ -43,9 +43,9 @@ public class HPSC003 extends DaoEPBase {
public static final String FIELD_SCHEDULE = "schedule";
public static final String FIELD_DELIVERY_DATE = "deliveryDate";
public static final String FIELD_INVENT_RECORD_ID = "inventRecordId";
public static final String FIELD_QRCODE_DOC_ID = "qrcodeDocId";
public static final String FIELD_FACTORY_CODE = "factoryCode";
public static final String COL_ID = "ID";
public static final String COL_COMPANY_CODE = "COMPANY_CODE"; /* 企业编码 预留*/
public static final String COL_PROJ_TYPE = "PROJ_TYPE"; /* 项目类型*/
......@@ -65,6 +65,7 @@ public class HPSC003 extends DaoEPBase {
public static final String COL_REMARK = "REMARK"; /* 备注*/
public static final String COL_INVENT_RECORD_ID = "INVENT_RECORD_ID";
public static final String COL_DELIVERY_DATE = "DELIVERY_DATE";
public static final String COL_QRCODE_DOC_ID = "QRCODE_DOC_ID";
public static final String COL_FACTORY_CODE = "FACTORY_CODE"; /* 工厂代码*/
public static final String QUERY = "HPSC003.query";
......@@ -91,17 +92,14 @@ public class HPSC003 extends DaoEPBase {
private String depCode = " "; /* 部门编码*/
private String remark = " "; /* 备注*/
private Long matId = null; /* 物料ID*/
private String schedule = "";
private String deliveryDate = " ";
private Long inventRecordId = new Long(0);
private String spec = " "; /* 规格*/
private BigDecimal length = new BigDecimal(0.00); /* 长*/
private BigDecimal width = new BigDecimal(0.00); /* 宽*/
private BigDecimal thick = new BigDecimal(0.00); /* 厚*/
private String qrcodeDocId = " "; /* 二维码文件ID */
private String factoryCode = " "; /* 工厂代码*/
......@@ -221,6 +219,10 @@ public class HPSC003 extends DaoEPBase {
eiColumn.setDescName("交货日期");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_QRCODE_DOC_ID);
eiColumn.setDescName("二维码文件ID");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_FACTORY_CODE);
eiColumn.setDescName("工厂代码");
eiMetadata.addMeta(eiColumn);
......@@ -595,6 +597,15 @@ public class HPSC003 extends DaoEPBase {
this.deliveryDate = deliveryDate;
}
public String getQrcodeDocId() {
return qrcodeDocId;
}
public void setQrcodeDocId(String qrcodeDocId) {
this.qrcodeDocId = qrcodeDocId;
}
public String getFactoryCode() {
return factoryCode;
}
......@@ -636,6 +647,7 @@ public class HPSC003 extends DaoEPBase {
setThick(NumberUtils.toBigDecimal(StringUtils.toString(map.get("thick")), thick));
setMatId(NumberUtils.toLong(StringUtils.toString(map.get("matId")), matId));
setDeliveryDate(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DELIVERY_DATE)), deliveryDate));
setQrcodeDocId(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_QRCODE_DOC_ID)), qrcodeDocId));
setFactoryCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_FACTORY_CODE)), factoryCode));
}
......@@ -671,6 +683,7 @@ public class HPSC003 extends DaoEPBase {
map.put("thick", StringUtils.toString(thick, eiMetadata.getMeta("thick")));
map.put("matId", StringUtils.toString(matId, eiMetadata.getMeta("matId")));
map.put(FIELD_DELIVERY_DATE, StringUtils.toString(deliveryDate, eiMetadata.getMeta(FIELD_DELIVERY_DATE)));
map.put(FIELD_QRCODE_DOC_ID, StringUtils.toString(qrcodeDocId, eiMetadata.getMeta(FIELD_QRCODE_DOC_ID)));
map.put(FIELD_FACTORY_CODE, StringUtils.toString(factoryCode, eiMetadata.getMeta(FIELD_FACTORY_CODE)));
return map;
......
......@@ -10,12 +10,18 @@ import com.baosight.hpjx.hp.constant.HPSqlConstant;
import com.baosight.hpjx.hp.sc.domain.HPSC003;
import com.baosight.hpjx.hp.sc.domain.HPSC004;
import com.baosight.hpjx.hp.sc.domain.HPSC005;
import com.baosight.hpjx.hp.sc.domain.HPSC005B;
import com.baosight.hpjx.hp.sc.tools.HPSCTools;
import com.baosight.hpjx.hp.xs.domain.Org;
import com.baosight.hpjx.hp.xs.tools.HPXSTools;
import com.baosight.hpjx.util.AssertUtils;
import com.baosight.hpjx.util.BeanUtils;
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.ObjectUtils;
import com.baosight.hpjx.util.StringUtils;
import com.baosight.hpjx.util.contants.ACConstants;
import com.baosight.iplat4j.core.ei.EiBlock;
......@@ -23,11 +29,9 @@ 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.core.web.threadlocal.UserSession;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import org.apache.commons.collections.MapUtils;
import org.apache.commons.collections.CollectionUtils;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
......@@ -36,7 +40,7 @@ import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Random;
import java.util.stream.Collectors;
/**
*
......@@ -222,6 +226,10 @@ public class ServiceHPSC003 extends ServiceBase {
}
// 修改计划状态
HPSCTools.HpSc003.updateStatus(id, HPConstant.planStatus.S_1);
// 生成二维码
if (StringUtils.isBlank(dbSc003.getQrcodeDocId())) {
HPSCTools.HpSc003.createQrCode(dbSc003.getPlanInfoNo());
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("提交成功");
} catch (Exception e) {
......@@ -274,7 +282,7 @@ public class ServiceHPSC003 extends ServiceBase {
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "生产计划",operType = "查询",operDesc = "部件下拉框")
@OperationLogAnnotation(operModul = "生产计划", operType = "查询", operDesc = "部件下拉框")
public EiInfo queryInventComboBox(EiInfo inInfo) {
List<DdynamicEnum> list = new ArrayList<>();
list.add(DdynamicEnum.INVENT_RECORD_BLOCK_ID);
......@@ -282,4 +290,84 @@ public class ServiceHPSC003 extends ServiceBase {
return inInfo;
}
/**
* 扫码显示计划明细
*
* @param inInfo
* @return
*/
public EiInfo qrcodePlanDetail(EiInfo inInfo) {
try {
String planInfoNo = inInfo.getString(HPSC003.FIELD_PLAN_INFO_NO);
AssertUtils.isNull(planInfoNo, "计划号不能为空");
// 查询计划主信息
HPSC003 dbSc003 = HPSCTools.HpSc003.getByNo(planInfoNo);
Map dbSc003Map = dbSc003.toMap();
// 设置厂区名称
if (StringUtils.isNotBlank(dbSc003.getFactoryCode())) {
Org org = HPXSTools.XsOrg.get(dbSc003.getFactoryCode());
dbSc003Map.put("factoryName", org.getOrgCname());
} else {
dbSc003Map.put("factoryName", "");
}
// 查询计划明细信息
this.buildPlanDetail(dbSc003Map);
inInfo.set("planInfo", dbSc003Map);
} catch (Exception e) {
LogUtils.setMsg(inInfo, e, "查询计划详情失败");
// 小程序端要求,错误码使用500
inInfo.setStatus(500);
}
return inInfo;
}
/**
* 计划明细
*
* @param dbSc003Map
*/
private void buildPlanDetail(Map dbSc003Map) {
String planInfoNo = MapUtils.getString(dbSc003Map, HPSC003.FIELD_PLAN_INFO_NO);
// 查询计划明细信息
List<HPSC004> dbSc004s = HPSCTools.HpSc004.queryByParent(planInfoNo);
if (CollectionUtils.isEmpty(dbSc004s)) {
dbSc003Map.put("planDetail", new ArrayList<>());
return;
}
List<Map> dbSc004Maps = dbSc004s.stream().map(HPSC004::toMap).collect(Collectors.toList());
dbSc003Map.put("planDetail", dbSc004Maps);
// 派工信息
buildProdOrder(dbSc004Maps);
}
/**
* 派工信息
*
* @param dbSc004Maps
*/
private void buildProdOrder(List<Map> dbSc004Maps) {
// 订单号
List<String> prodOrderNos = ObjectUtils.listKey(dbSc004Maps, HPSC004.FIELD_PROD_ORDER_NO);
// 查询派工信息
List<HPSC005B> dbSc005bs = HPSCTools.HpSc005b.listByOrder(prodOrderNos);
// 填充数据
Map<String, List<HPSC005B>> dbSc005bMap = CollectionUtils.isEmpty(dbSc005bs) ? null
: dbSc005bs.stream().collect(Collectors.groupingBy(HPSC005B::getProdOrderNo));
for (Map dbSc004Map : dbSc004Maps) {
String prodOrderNo = MapUtils.getString(dbSc004Map, HPSC004.FIELD_PROD_ORDER_NO);
if (dbSc005bMap == null) {
dbSc004Map.put("prodOrders", new ArrayList<>());
continue;
}
List<HPSC005B> dbSc005Items = dbSc005bMap.get(prodOrderNo);
if (CollectionUtils.isNotEmpty(dbSc005Items)) {
dbSc004Map.put("prodOrders", dbSc005Items.stream().map(HPSC005B::toMap)
.collect(Collectors.toList()));
} else {
dbSc004Map.put("prodOrders", new ArrayList<>());
}
}
}
}
......@@ -108,6 +108,7 @@
THICK as "thick", <!-- 厚 -->
MAT_ID AS "matId",
DELIVERY_DATE as "deliveryDate",
QRCODE_DOC_ID as "qrcodeDocId",
FACTORY_CODE as "factoryCode", <!-- 工厂代码 -->
CONCAT((
SELECT
......@@ -240,4 +241,13 @@
WHERE ID = #id#
</update>
<!-- 修改二维码地址 -->
<update id="updateQrcode">
UPDATE hpjx.T_HPSC003
SET
QRCODE_DOC_ID = #qrcodeDocId#,
<include refid="updateRevise"/>
WHERE PLAN_INFO_NO = #planInfoNo#
</update>
</sqlMap>
......@@ -108,6 +108,9 @@
<isNotEmpty prepend=" AND " property="ids">
A.ID IN <iterate close=")" open="(" conjunction="," property="statuses">#statuses[]#</iterate>
</isNotEmpty>
<isNotEmpty prepend=" AND " property="prodOrderNos">
A.PROD_ORDER_NO IN <iterate close=")" open="(" conjunction="," property="prodOrderNos">#prodOrderNos[]#</iterate>
</isNotEmpty>
<isNotEmpty prepend=" AND " property="prodTaskNos">
B.PROD_TASK_NO IN <iterate close=")" open="(" conjunction="," property="prodTaskNos">#prodTaskNos[]#</iterate>
</isNotEmpty>
......@@ -128,7 +131,7 @@
$order$
</isNotEmpty>
<isEmpty property="order">
A.CREATED_TIME desc
A.PROD_ORDER_NO DESC, B.PROD_TASK_NO ASC
</isEmpty>
</dynamic>
</sql>
......
......@@ -42,7 +42,7 @@ public class ServiceHPXS006 extends ServiceBase {
try {
/*inInfo.setCell(EiConstant.queryBlock,ACConstants.ROW_CODE_0, "userId",UserSessionUtils.getFactoryCode().get(0));*/
inInfo = super.query(inInfo, HPXS006.QUERY, new HPSC001());
inInfo = super.query(inInfo, HPXS006.QUERY, new HPXS006());
Map map = new HashMap();
map.put("companyCode", UserSessionUtils.getCompanyCode());
map.put("factoryCodes", getFactoryCode(inInfo));
......@@ -183,53 +183,6 @@ public class ServiceHPXS006 extends ServiceBase {
}
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;
}
/**
* @param inInfo
* @return
......
package com.baosight.hpjx.hp.xs.service;
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;
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 ServiceHPXS007 extends ServiceBase {
/**
* 画面初始化.
*/
@OperationLogAnnotation(operModul = "客户回访",operType = "查询",operDesc = "初始化")
public EiInfo initLoad(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HPXS007.QUERY, new HPXS007());
Map map = new HashMap();
map.put("companyCode", UserSessionUtils.getCompanyCode());
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.SALE_NO_BLOCK_ID), null,false);
} 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, HPXS007.FIELD_FOL_DATE,
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;
}
/**
* 保存操作.
*
* @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++) {
HPXS007 hpsc007 = new HPXS007();
hpsc007.fromMap(resultRows.get(i));
hpsc007.setFolDate(DateUtils.formatShort(hpsc007.getFolDate()));
if (hpsc007.getId() == null || hpsc007.getId() == 0) {
this.add(hpsc007);
} else {
this.modify(hpsc007);
}
}
//inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 新增
*
* @param hpsc007
* @throws Exception
*/
private void add(HPXS007 hpsc007) throws Exception {
DaoUtils.insert(HPXS007.INSERT, hpsc007);
}
/**
* 修改数据
*
* @param hpxs007
*/
private void modify(HPXS007 hpxs007) {
DaoUtils.update(HPXS007.UPDATE, hpxs007);
}
/**
* 删除操作.
*/
@OperationLogAnnotation(operModul = "客户回访",operType = "删除")
public EiInfo delete(EiInfo eiInfo) {
HPXS007 hpxs007 = new HPXS007();
EiBlock eiBlock = eiInfo.getBlock(EiConstant.resultBlock);
try {
for (int i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
hpxs007.fromMap(map);
this.dao.delete(HPXS007.DELETE, hpxs007.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) {
HPXS007 hpxs007 = new HPXS007();
EiBlock eiBlock = eiInfo.getBlock(EiConstant.resultBlock);
try {
for (int i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
hpxs007.fromMap(map);
DaoUtils.update(HPXS007.CHECK, hpxs007.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;
}
}
......@@ -47,7 +47,6 @@
<isNotEmpty prepend=" AND " property="repStatus">
REP_STATUS = #repStatus#
</isNotEmpty>
</sql>
<select id="query" parameterClass="java.util.HashMap"
......@@ -76,7 +75,7 @@
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
CREATED_TIME asc
CREATED_TIME desc
</isEmpty>
</dynamic>
......@@ -219,6 +218,5 @@
<isNotEmpty prepend=" AND " property="userId">
b.USER_ID = #userId#
</isNotEmpty>
</select>
</sqlMap>
\ No newline at end of file
<?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-22 14:15:25
Version : 1.0
tableName :hpjx.t_hpxs007
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,
FOL_DATE VARCHAR,
DEL_ORDER_NO VARCHAR,
FOL_TYPE TINYINT,
FOL_STATUS TINYINT
-->
<sqlMap namespace="HPXS007">
<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.HPXS007">
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-是 -->
FOL_DATE as "folDate", <!-- 回访日期 -->
DEL_ORDER_NO as "delOrderNo", <!-- 发货单号 -->
FOL_TYPE as "folType", <!-- 回访方式 1-电话回访 2-上门回访 -->
FOL_STATUS as "folStatus" <!-- 回访状态 0-待回访 1-已回访 -->
FROM hpjx.t_hpxs007 WHERE 1=1
<include refid="authCondition"/>
<include refid="condition"/>
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
CREATED_TIME desc
</isEmpty>
</dynamic>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM hpjx.t_hpxs007 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="folDate">
FOL_DATE = #folDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="delOrderNo">
DEL_ORDER_NO = #delOrderNo#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="folType">
FOL_TYPE = #folType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="folStatus">
FOL_STATUS = #folStatus#
</isNotEmpty>
-->
<insert id="insert">
INSERT INTO hpjx.t_hpxs007 (ID, <!-- ID -->
COMPANY_CODE, <!-- 公司编码 -->
DEP_CODE, <!-- 部门编码 -->
CREATED_BY, <!-- 创建人 -->
CREATED_NAME, <!-- 创建人名称 -->
CREATED_TIME, <!-- 创建时间 -->
UPDATED_BY, <!-- 修改人 -->
UPDATED_NAME, <!-- 修改人名称 -->
UPDATED_TIME, <!-- 修改时间 -->
DELETE_FLAG, <!-- 是否删除 0-否1-是 -->
FOL_DATE, <!-- 回访日期 -->
DEL_ORDER_NO, <!-- 发货单号 -->
FOL_TYPE, <!-- 回访方式 1-电话回访 1-上门回访 -->
FOL_STATUS <!-- 回访状态 0-待回访 1-已回访 -->
)
VALUES (#id#, #companyCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #deleteFlag#, #folDate#, #delOrderNo#, #folType#, #folStatus#)
</insert>
<delete id="delete">
DELETE FROM hpjx.t_hpxs007 WHERE
ID = #id#
</delete>
<update id="update">
UPDATE hpjx.t_hpxs007
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-是 -->
FOL_DATE = #folDate#, <!-- 回访日期 -->
DEL_ORDER_NO = #delOrderNo#, <!-- 发货单号 -->
FOL_TYPE = #folType#, <!-- 回访方式 1-电话回访 1-上门回访 -->
FOL_STATUS = #folStatus# <!-- 回访状态 0-待回访 1-已回访 -->
WHERE
ID = #id#
</update>
<update id="check">
UPDATE hpjx.t_hpxs007
SET
FOL_STATUS = #folStatus# <!-- 回访状态 0-待回访 1-已回访 -->
WHERE
ID = #id#
</update>
<select id="getSaleCode" parameterClass="java.util.HashMap" resultClass="java.util.HashMap">
select SALE_NO as "saleNo"
from hpjx.T_HPKC004
where DELETE_FLAG = 0 and IS_PRINT = 1
<include refid="authCondition"/>
</select>
</sqlMap>
\ No newline at end of file
......@@ -4,7 +4,9 @@
<sql id="condition">
AND IS_DELETED = '0'
AND COMPANY_CODE = #companyCode#
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="orgEname">
ORG_ENAME = #orgEname#
</isNotEmpty>
......
......@@ -195,7 +195,7 @@ public class HPXSTools {
Map queryMap = new HashMap();
queryMap.put("orgId", orgId);
List<Org> results = DaoBase.getInstance().query(HPSqlConstant.HpXsOrg.QUERY_PARENT, queryMap);
AssertUtils.isNull(results, String.format("组织[%s]不存在父级信息", orgId));
AssertUtils.isEmpty(results, String.format("组织[%s]不存在父级信息", orgId));
return results;
}
......@@ -211,7 +211,7 @@ public class HPXSTools {
queryMap.put("orgId", orgId);
queryMap.put("orgType", OrgTypeEnum.FACTORY.getCode());
List<Org> results = DaoBase.getInstance().query(HPSqlConstant.HpXsOrg.QUERY_PARENT, queryMap);
AssertUtils.isNull(results, String.format("组织[%s]不存在厂区信息", orgId));
AssertUtils.isEmpty(results, String.format("组织[%s]不存在厂区信息", orgId));
return results.get(0);
}
......@@ -263,7 +263,7 @@ public class HPXSTools {
queryMap.put("orgType", orgType);
List<Map> results = DaoBase.getInstance().query("HPXSOrg.queryGroupComboBox", queryMap);
AssertUtils.isNull(results, String.format("组织[%s]不存在父级信息", orgId));
AssertUtils.isEmpty(results, String.format("组织[%s]不存在父级信息", orgId));
return results;
}
......
......@@ -26,7 +26,7 @@ public class HPZLTools {
Map queryMap = new HashMap();
queryMap.put("id", id);
List<HPZL001> results = DaoBase.getInstance().query(HPZL001.QUERY, queryMap);
AssertUtils.isNull(results, String.format("质检单[%s]信息不存在", id));
AssertUtils.isEmpty(results, String.format("质检单[%s]信息不存在", id));
return results.get(0);
}
......@@ -41,7 +41,7 @@ public class HPZLTools {
Map queryMap = new HashMap();
queryMap.put("checkNo", checkNo);
List<HPZL001> results = DaoBase.getInstance().query(HPZL001.QUERY, queryMap);
AssertUtils.isNull(results, String.format("质检单号[%s]信息不存在", checkNo));
AssertUtils.isEmpty(results, String.format("质检单号[%s]信息不存在", checkNo));
return results.get(0);
}
......
package com.baosight.hpjx.util;
import com.baosight.iplat4j.core.BaseObject;
import com.baosight.iplat4j.core.data.DaoEPBase;
import com.baosight.iplat4j.core.ei.EiBlock;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import org.apache.commons.collections.MapUtils;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
......@@ -107,4 +110,42 @@ public class EiInfoUtils {
rowMap.put(key, value);
}
/**
* eiinfo中新增block
*
* @param inInfo
* @param blockId
* @param row
* @param clazz
* @param <T>
* @throws InstantiationException
* @throws IllegalAccessException
*/
public static <T extends DaoEPBase> void addBlock(EiInfo inInfo, String blockId, T row, Class<T> clazz)
throws InstantiationException, IllegalAccessException {
EiBlock block = new EiBlock(blockId);
block.addBlockMeta(clazz.newInstance().eiMetadata);
block.addRow(row);
inInfo.setBlock(block);
}
/**
* eiinfo中新增block
*
* @param inInfo
* @param blockId
* @param rows
* @param clazz
* @param <T>
* @throws InstantiationException
* @throws IllegalAccessException
*/
public static <T extends DaoEPBase> void addBlock(EiInfo inInfo, String blockId, List<T> rows, Class<T> clazz)
throws InstantiationException, IllegalAccessException {
EiBlock block = new EiBlock(blockId);
block.addBlockMeta(clazz.newInstance().eiMetadata);
block.addRows(rows);
inInfo.setBlock(block);
}
}
......@@ -65,6 +65,7 @@ public class LogUtils {
* @return
*/
public static String getMsg(Throwable e) {
logger.error("转换系统异常:{}", e.getMessage(), e);
if (e instanceof PlatException) {
return e.getMessage();
} else {
......
package com.baosight.hpjx.util;
import com.baosight.iplat4j.core.data.DaoEPBase;
import org.apache.commons.collections.CollectionUtils;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
......@@ -119,4 +121,19 @@ public class ObjectUtils extends org.apache.commons.lang.ObjectUtils {
.collect(Collectors.toList());
}
/**
* 从DaoEPBase中取KEY
*
* @param items
* @param keyName
* @return
*/
public static <T> List<T> listEpKey(Collection<? extends DaoEPBase> items, String keyName) {
if (CollectionUtils.isEmpty(items)) {
return null;
}
return items.stream().map(item -> item.toMap()).map(item -> (T) item.get(keyName))
.filter(ObjectUtils::isNotBlank).distinct().collect(Collectors.toList());
}
}
......@@ -187,7 +187,7 @@ public class SqlMapDaoLogProxy extends SqlMapDao {
*/
private void setCompanyCode(String name, Object parameters) {
// 需要过滤部分sql name,否则会形成死循环
String[] serviceFilter = {"HPXSUser"};
String[] serviceFilter = {"HPXSUser", "HPPZ009.query"};
if (StringUtils.startsWithAny(name, serviceFilter)) {
return;
}
......
......@@ -19,7 +19,7 @@ spring.servlet.multipart.file-size-threshold =0
componentEname=hpjx
projectName=hpjx
moduleName=ep
projectEnv=run
projectEnv=dev
platSchema=iplat
eplatSchema=EPLAT
lowcodedbSchema=lowcodedb
......@@ -36,6 +36,7 @@ jdbc.driverClassName=com.mysql.jdbc.Driver
#jdbc.url=jdbc:mysql://127.0.0.1:3306/iplat?useSSL=false&useUnicode=true&characterEncoding=utf-8
jdbc.url=jdbc:mysql://10.135.13.5:30005/iplat?useSSL=false&useUnicode=true&characterEncoding=utf-8
jdbc.username=dbprod32
#jdbc.username=root
jdbc.password=t9UrgcELp=
#jdbc.password=123456
jdbc.maxActive=20
......
......@@ -28,10 +28,10 @@ org.quartz.jobStore.clusterCheckinInterval = 20000
org.quartz.dataSource.appDS.driver = com.mysql.jdbc.Driver
org.quartz.dataSource.appDS.URL = jdbc:mysql://10.135.13.5:30005/iplat?useSSL=false&useUnicode=true&characterEncoding=utf-8
#org.quartz.dataSource.appDS.URL = jdbc:mysql://127.0.0.1:3306/iplat?useSSL=false&useUnicode=true&characterEncoding=utf-8
org.quartz.dataSource.appDS.user = dbprod32
#org.quartz.dataSource.appDS.password =root
#org.quartz.dataSource.appDS.user = root
org.quartz.dataSource.appDS.password =t9UrgcELp=
#org.quartz.dataSource.appDS.password =123456
org.quartz.dataSource.appDS.maxConnections = 30
#\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u05B1\uFFFD\uFFFD\uFFFD\uFFFD\u05BE\uFFFD\uFFFD\u00BC\uFFFD\uFFFD\uFFFD
......
$(function () {
$(".row").children().attr("class", "col-md-3");
$("#QUERY").on("click", query);
/* 页面查询框的尺寸设置 */
$.extend(true, IPLATUI.Config, {
EFGrid: {
height: $(document).height() - $("#inqu").height() - $("#ef_form_head").height() - 100,
/*pageable: {
input: true,
numeric: false,
pageSizes: [10, 50 , 100 , 200]
}*/
}
});
IPLATUI.EFDatePicker = {
"inqu_status-0-year":{
start:"decade",
depth:"decade",
format:"yyyy",
}
}
IPLATUI.EFGrid= {
"result": {
pageable: {
pageSize: 10,
pageSizes: [10, 20, 50, 100],
},
columns: [
{
field: "operator",
title: "操作",
template: function (item) {
let status = item.status;
let template = '';
if (status == 0) {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="taskResolve(' + item.id + ')" >分解</a>';
}
return template;
}
},
{
field: "createdName",
template: function (options) {
return showUserName(options.createdBy, options.createdName);
}
}, {
field: "updatedName",
template: function (options) {
return showUserName(options.updatedBy, options.updatedName);
}
}
],
loadComplete: function(grid) {
},
beforeEdit:function (e) {
if (e.model["status"] === "1") {
e.preventDefault();
}
},
//单元格数据储存时回调
afterEdit:function (e) {
/*if (e.field === "groupCode" && e.model["factoryCode"].length === 0){
for (let i = 0; i < groupCodeBox.length; i++) {
if (e.model[e.field] === groupCodeBox[i]["valueField"]){
e.model["factoryCode"]=groupCodeBox[i]["param1Field"]
break;
}
}
}*/
},
onSave: function (e) {
// 阻止默认请求,使用自定义保存
e.preventDefault();
let btnNode = $(this);
//禁用按钮
btnNode.attr("disabled", true);
save(btnNode);
},
onDelete: function (e) {
// 阻止默认请求,使用自定义删除
//e.preventDefault();
//deleteFunc();
},
onSuccess: function (e) {
if (e.eiInfo.extAttr.methodName == 'save' || e.eiInfo.extAttr.methodName == 'delete') {
query();
}
},
exportGrid : {
exportFileName: function (gridInstance) {
// 导出的文件名包含时间戳 yyyy-MM-dd HH:mm:ss
return "销售目标_" + kendo.toString(new Date(), IPLAT.FORMAT.DATE_14_PR);
},
exportFileType: "xls",
exportBlockId: "result",
}
}
}
downKeyUp();
});
let query = function () {
resultGrid.dataSource.page(1);
}
/**
* 保存
*/
let save = function (btnNode) {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
let flag = true;
/*$.each(rows, function(index, item) {
let factoryCode= item.get("factoryCode");
if(isBlank(factoryCode)){
message("选中的第"+(index+1)+"行\"工厂\",不能为空!");
flag = false;
return false;
}
});*/
if(flag) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HPPZ017", "save", true);
btnNode.attr("disabled", false);
}
});
}
}
/**
* 分解销售目标
*
* @param id
*/
function taskResolve(id) {
JSUtils.confirm("确定对数据做\"分解\"操作? ", {
ok: function () {
var info = new EiInfo();
info.set("inqu_status-0-id",id);
info.set("inqu_status-0-status",1);
EiCommunicator.send("HPPZ017", "resolve", info, {
onSuccess: function (ei) {
if (ei.getStatus() >= 0) {
NotificationUtil(ei);
query();
} else {
NotificationUtil(ei, "error");
}
},
onFail: function (ei) {
// 发生异常
NotificationUtil("操作失败,原因[" + ei + "]", "error");
}
});
}
});
}
<%--
Created by IntelliJ IDEA.
User: 1
Date: 2024/4/22
Time: 11:24
To change this template use File | Settings | File Templates.
--%>
<!DOCTYPE html>
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ 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 blockId="inqu_status" row="0" ename="year" cname="年度" colWidth="4"/>
<EF:EFInput blockId="inqu_status" row="0" ename="salesAmount" cname="营业额" editType="number" colWidth="4"
data-regex="/^-?[0-9]{1,18}([.][0-9]{1,2})?$/"
data-errorprompt="请输入数字,该值最大可设置18位整数和2位小数!"
/>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="记录集">
<EF:EFGrid blockId="result" autoDraw="override" checkMode="cell">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="120" align="center"/>
<EF:EFColumn ename="year" cname="年度" align="center" width="120" editType="date" start="decade" depth="decade"
readonly="true" dateFormat="yyyy" parseFormats="['yyyy']"/>
<EF:EFColumn ename="salesCode" cname="单号" enable="false" align="center" width="160"/>
<EF:EFColumn ename="salesAmount" cname="营业额" width="120" format="{0:N2}"
displayType="0.000" sort="true" align="right" maxLength="20"
data-regex="/^-?[0-9]{1,18}([.][0-9]{1,2})?$/"
data-errorprompt="请输入数字,该值最大可设置17位整数和3位小数!"/>
<EF:EFColumn ename="targetExplain" cname="目标说明" align="center" width="200" editType="textarea"/>
<EF:EFComboColumn ename="status" cname="分解状态" width="100" align="center" enable="false" defaultValue="0">
<EF:EFOption label="未分解" value="0"/>
<EF:EFOption label="已分解" value="1"/>
</EF:EFComboColumn>
<EF:EFColumn ename="createdName" cname="记录创建者" readonly="true" width="120" align="center" enable="false"/>
<EF:EFColumn ename="createdTime" cname="记录创建时间" readonly="true" width="150" align="center" enable="false" parseFormats="['yyyyMMddHHmmss']" editType="datetime" dateFormat="yyyy-MM-dd HH:mm:ss"/>
<EF:EFColumn ename="updatedName" cname="记录修改者" readonly="true" width="120" align="center" enable="false"/>
<EF:EFColumn ename="updatedTime" cname="记录修改时间" readonly="true" width="150" align="center" enable="false" parseFormats="['yyyyMMddHHmmss']" editType="datetime" dateFormat="yyyy-MM-dd HH:mm:ss"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
$(function () {
$(".row").children().attr("class", "col-md-3");
$("#QUERY").on("click", query);
/* 页面查询框的尺寸设置 */
$.extend(true, IPLATUI.Config, {
EFGrid: {
height: $(document).height() - $("#inqu").height() - $("#ef_form_head").height() - 100,
/*pageable: {
input: true,
numeric: false,
pageSizes: [10, 50 , 100 , 200]
}*/
}
});
IPLATUI.EFDatePicker = {
"inqu_status-0-year":{
start:"decade",
depth:"decade",
format:"yyyy",
},
"inqu_status-0-month":{
start:"year",
depth:"year",
format:"mm",
}
}
IPLATUI.EFGrid= {
"result": {
pageable: {
pageSize: 10,
pageSizes: [10, 20, 50, 100],
},
columns: [
{
field: "operator",
title: "操作",
template: function (item) {
let id = item.id;
let template = '';
if (item.status == 0) {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="updateStatus(' + item.id + ')" >审核</a>';
}
return template;
}
},
{
field: "createdName",
template: function (options) {
return showUserName(options.createdBy, options.createdName);
}
}, {
field: "updatedName",
template: function (options) {
return showUserName(options.updatedBy, options.updatedName);
}
}
],
loadComplete: function(grid) {
},
beforeEdit:function (e) {
if (e.model["status"] === "1") {
e.preventDefault();
}
},
//单元格数据储存时回调
afterEdit:function (e) {
/*if (e.field === "groupCode" && e.model["factoryCode"].length === 0){
for (let i = 0; i < groupCodeBox.length; i++) {
if (e.model[e.field] === groupCodeBox[i]["valueField"]){
e.model["factoryCode"]=groupCodeBox[i]["param1Field"]
break;
}
}
}*/
},
onSave: function (e) {
// 阻止默认请求,使用自定义保存
e.preventDefault();
let btnNode = $(this);
//禁用按钮
btnNode.attr("disabled", true);
save(btnNode);
},
onDelete: function (e) {
// 阻止默认请求,使用自定义删除
//e.preventDefault();
//deleteFunc();
},
onSuccess: function (e) {
if (e.eiInfo.extAttr.methodName == 'save' || e.eiInfo.extAttr.methodName == 'delete') {
query();
}
},
exportGrid : {
exportFileName: function (gridInstance) {
// 导出的文件名包含时间戳 yyyy-MM-dd HH:mm:ss
return "销售目标_" + kendo.toString(new Date(), IPLAT.FORMAT.DATE_14_PR);
},
exportFileType: "xls",
exportBlockId: "result",
}
}
}
downKeyUp();
});
let query = function () {
resultGrid.dataSource.page(1);
}
/**
* 保存
*/
let save = function (btnNode) {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
let flag = true;
/*$.each(rows, function(index, item) {
let factoryCode= item.get("factoryCode");
if(isBlank(factoryCode)){
message("选中的第"+(index+1)+"行\"工厂\",不能为空!");
flag = false;
return false;
}
});*/
if(flag) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HPPZ018", "save", true);
btnNode.attr("disabled", false);
}
});
}
}
/**
* 分解销售目标
*
* @param id
*/
function updateStatus(id) {
let inEiInfo = new EiInfo();
inEiInfo.set("result-0-id", id);
inEiInfo.set("result-0-status", 1);
EiCommunicator.send('HPPZ018', 'updateStatus', inEiInfo, {
onSuccess(response) {
NotificationUtil(response.msg);
query();
},
onFail(errorMessage, status, e) {
NotificationUtil("执行失败!", "error");
}
}, {
async: false
}
);
}
\ No newline at end of file
<%--
Created by IntelliJ IDEA.
User: 1
Date: 2024/4/22
Time: 15:36
To change this template use File | Settings | File Templates.
--%>
<!DOCTYPE html>
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ 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 blockId="inqu_status" row="0" ename="year" cname="年度" colWidth="4"/>
<EF:EFInput blockId="inqu_status" row="0" ename="salesAmount" cname="营业额" editType="number" colWidth="4"
data-regex="/^-?[0-9]{1,18}([.][0-9]{1,2})?$/"
data-errorprompt="请输入数字,该值最大可设置18位整数和2位小数!"
/>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="记录集">
<EF:EFGrid blockId="result" autoDraw="override" checkMode="cell">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="120" align="center"/>
<EF:EFColumn ename="year" cname="年度" align="center" width="120" editType="date" start="decade" depth="decade"
readonly="true" dateFormat="yyyy" parseFormats="['yyyy']"/>
<EF:EFColumn ename="month" cname="月度" align="center" width="120" editType="date" start="year" depth="year"
readonly="true" dateFormat="mm" parseFormats="['mm']"/>
<EF:EFColumn ename="salesCode" cname="单号" enable="false" align="center" width="160"/>
<EF:EFColumn ename="planSalesCode" cname="计划单号" enable="false" align="center" width="160"/>
<EF:EFColumn ename="salesAmount" cname="营业额" width="120" format="{0:N2}" editType="text"
displayType="0.000" sort="true" align="right" maxLength="20"
data-regex="/^-?[0-9]{1,18}([.][0-9]{1,2})?$/"
data-errorprompt="请输入数字,该值最大可设置17位整数和3位小数!"/>
<EF:EFComboColumn ename="status" cname="审批状态" width="100" align="center" defaultValue="0">
<EF:EFOption label="未审批" value="0"/>
<EF:EFOption label="已审批" value="1"/>
</EF:EFComboColumn>
<EF:EFColumn ename="createdName" cname="记录创建者" readonly="true" width="120" align="center" enable="false"/>
<EF:EFColumn ename="createdTime" cname="记录创建时间" readonly="true" width="150" align="center" enable="false" parseFormats="['yyyyMMddHHmmss']" editType="datetime" dateFormat="yyyy-MM-dd HH:mm:ss"/>
<EF:EFColumn ename="updatedName" cname="记录修改者" readonly="true" width="120" align="center" enable="false"/>
<EF:EFColumn ename="updatedTime" cname="记录修改时间" readonly="true" width="150" align="center" enable="false" parseFormats="['yyyyMMddHHmmss']" editType="datetime" dateFormat="yyyy-MM-dd HH:mm:ss"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
......@@ -9,7 +9,7 @@
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<EF:EFInput cname="操作人" ename="inqu_status-0-createdName" colWidth="3"/>
<EF:EFInput cname="操作人" ename="inqu_status-0-createdBy" colWidth="3"/>
<EF:EFInput cname="异常编码" ename="inqu_status-0-errorCode" colWidth="3"/>
</div>
</EF:EFRegion>
......
......@@ -9,7 +9,7 @@
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<EF:EFInput cname="操作人" ename="inqu_status-0-createdName" colWidth="3"/>
<EF:EFInput cname="操作人" ename="inqu_status-0-createdBy" colWidth="3"/>
</div>
</EF:EFRegion>
......
......@@ -185,7 +185,7 @@ $(function () {
},
onSuccess: function (e) {
if (e.eiInfo.extAttr.methodName == 'update'
if (e.eiInfo.extAttr.methodName == 'delete'
|| e.eiInfo.extAttr.methodName == 'insert') {
query();
}
......
......@@ -39,6 +39,16 @@ $(function () {
}
return template;
}
}, {
field: "qrcodeDocId",
template: function (item) {
if (isBlank(item.qrcodeDocId)) {
return "";
} else {
return '<img src="' + downloadHref(item.qrcodeDocId) + '" width="20px" height="20px"'
+ ' onclick="imgClick(\'' + item.qrcodeDocId + '\')" />';
}
}
}],
/**
* 翻页事件,点翻页按钮,输入页数跳转时触发
......@@ -410,3 +420,26 @@ function saveDetail(btn) {
});
}
}
/**
* 图片放大
*/
let imgClick = function (docId) {
// 图片路径
$("#bigImg").attr("src", downloadHref(docId));
$("#bigImg").css({'width': 400});
// 图片淡入
$("#back-curtain").fadeIn("fast");
// 遮罩效果
$("#back-curtain").css({
'position': 'fixed',
'overflow-y': 'auto',
'width': '100%',
'height': '100%',
'z-index': '998'
}).show();
// 点击图片或遮罩,图片淡出
$("#back-curtain").on('click', function () {
$(this).fadeOut("fast");
});
}
......@@ -29,6 +29,7 @@
<EF:EFGrid blockId="result" autoDraw="no" isFloat="true">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="100" align="center"/>
<EF:EFColumn enable="false" ename="qrcodeDocId" cname="二维码" width="50" align="center"/>
<EF:EFColumn enable="false" ename="projCode" cname="项目号" readonly="true" hidden="true"/>
<EF:EFColumn enable="false" ename="planInfoNo" cname="生产计划单号" readonly="true" hidden="true" width="100"/>
<EF:EFColumn enable="false" ename="projName" cname="项目名称" width="120" readonly="true"/>
......@@ -86,3 +87,9 @@
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
<div id="back-curtain" style="position:fixed; top:0; left:0; background:rgba(0,0,0,0.5); z-index:998; width:100%;
display:none;display: flex; justify-content: center; align-items: center;">
<img id="bigImg" src=""/>
</div>
$(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.folStatus;
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) {
},
}
}
downKeyUp();
});
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-folStatus", auditStatus);
EiCommunicator.send('HPXS007', '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]['folStatus']==1) {
message("勾选的第" + (i + 1) + "行已回访不允许修改!");
return;
}
if (isBlank(rows[i]['folDate'])) {
message("勾选的第" + (i + 1) + "行回访日期不能为空");
return;
}
if (isBlank(rows[i]['delOrderNo'])) {
message("勾选的第" + (i + 1) + "行发货单号不能为空");
return;
}
if (isBlank(rows[i]['folType'])) {
message("勾选的第" + (i + 1) + "行回访方式不能为空");
return;
}
if (isBlank(rows[i]['folStatus'])) {
message("勾选的第" + (i + 1) + "行维修状态不能为空");
return;
}
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作?", {
ok: function () {
JSUtils.submitGridsData("result", "HPXS007", "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="folDate" blockId="inqu_status" row="0" colWidth="3"
format="yyyy-MM-dd" readonly="true"/>
<%-- <EF:EFInput cname="发货单号" ename="inqu_status-0-folOrderNo" colWidth="3"/>--%>
<EF:EFSelect cname="发货单号" ename="inqu_status-0-folOrderNo" colWidth="3" filter="contains" defultValue="">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="sale_no_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFSelect blockId="inqu_status" row="0" ename="folType" cname="回访方式" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hpjx.hpxs.folType"/>
</EF:EFSelect>
<EF:EFSelect blockId="inqu_status" row="0" ename="folStatus" cname="回访状态" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hpjx.hpxs.folStatus"/>
</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="folDate" cname="回访日期" width="100" align="center" editType="date" readonly="false"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true"/>
<%--<EF:EFColumn ename="folOrderNo" cname="发货单号" enable="false" width="140" align="center"/>--%>
<EF:EFComboColumn ename="delOrderNo" cname="发货单号" width="120" align="center" required="true"
blockName="sale_no_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#" readonly="false"
filter="contains">
</EF:EFComboColumn>
<EF:EFComboColumn ename="folType" cname="回访方式" width="80" align="center" readonly="false" required="true" defaultValue="1">
<EF:EFCodeOption codeName="hpjx.hpxs.folType"/>
</EF:EFComboColumn>
<EF:EFComboColumn ename="folStatus" cname="回访状态" width="80" align="center" readonly="true" required="true" defaultValue="0">
<EF:EFCodeOption codeName="hpjx.hpxs.folStatus"/>
</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