Commit 9726be52 by wasx8023

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

 Conflicts:
	src/main/java/com/baosight/hpjx/hp/mt/service/ServiceHPMT002.java
	src/main/java/com/baosight/hpjx/hp/sc/service/ServiceHPSC006.java
parents 449b5259 27271308
......@@ -8,7 +8,9 @@ import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ImportResource;
import org.springframework.web.multipart.commons.CommonsMultipartResolver;
@SpringBootApplication(scanBasePackages = "com.baosight")
@ServletComponentScan("com.baosight.iplat4j.core.web.servlet")
......@@ -26,4 +28,12 @@ public class HpjxApplication extends SpringBootServletInitializer {
return application.sources(HpjxApplication.class);
}
@Bean("multipartResolver")
public CommonsMultipartResolver multipartResolver(){
CommonsMultipartResolver resolver = new CommonsMultipartResolver();
resolver.setDefaultEncoding("UTF-8");
resolver.setMaxInMemorySize(10000);
return resolver;
}
}
package com.baosight.hpjx.aspect.annotation;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baosight.hpjx.util.DocExcelUtils;
import com.baosight.hpjx.util.LogUtils;
import com.baosight.hpjx.util.MapUtils;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.service.soa.XLocalManager;
import com.baosight.iplat4j.core.web.controller.WebDispatchController;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.math.NumberUtils;
import org.apache.http.HttpEntity;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.util.Args;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.Reader;
import java.net.URLDecoder;
import java.net.URLEncoder;
import java.nio.charset.Charset;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import com.baosight.hpjx.common.DocRouteEnum;
/**
* DOC 接口类
*
* @author:songx
* @date:2022/5/5,10:04
*/
@CrossOrigin
@RestController
@RequestMapping("/doc")
public class DocController extends WebDispatchController {
private final static Logger logger = LoggerFactory.getLogger(DocController.class);
/**
* 批量导入
*
* @param file
* @return
*/
@RequestMapping(value = "/import/api", method = RequestMethod.POST)
public EiInfo importExcel(MultipartFile file, HttpServletRequest request) {
Map<String, String[]> paramMaps = request.getParameterMap();
EiInfo outInfo = new EiInfo();
outInfo.setStatus(EiConstant.STATUS_FAILURE);
try {
if (file == null) {
outInfo.setMsg("导入文件不能为空");
return outInfo;
}
String id = request.getParameter("id");
DocRouteEnum docRouteEnum = DocRouteEnum.getById(id);
if (docRouteEnum == null) {
outInfo.setMsg("导入标识ID不存在");
return outInfo;
}
String startRow = request.getParameter("startRow");
List dataList = DocExcelUtils.readExcel(file, NumberUtils.createInteger(startRow), docRouteEnum.getClazz());
if (CollectionUtils.isEmpty(dataList)) {
outInfo.setMsg("未读取到数据");
return outInfo;
}
outInfo.set(EiConstant.serviceName, docRouteEnum.getServiceNme());
outInfo.set(EiConstant.methodName, docRouteEnum.getMethodName());
outInfo.set("params", this.convertParam(paramMaps));
outInfo.set("dataList", dataList);
outInfo = XLocalManager.call(outInfo);
} catch (Exception e) {
LogUtils.setDetailMsg(outInfo, e, "导入excel失败");
}
return outInfo;
}
/**
* 参数转换
*
* @param paramMaps
* @return
*/
private Map<String, String> convertParam(Map<String, String[]> paramMaps) {
if (MapUtils.isEmpty(paramMaps)) {
return new HashMap<>();
}
Map<String, String> paramMap = new HashMap<>();
for (Map.Entry<String, String[]> entry : paramMaps.entrySet()) {
paramMap.put(entry.getKey(), entry.getValue()[0]);
}
return paramMap;
}
}
......@@ -272,6 +272,26 @@ public enum DdynamicEnum {
*/
FACTORY_CODE1_BLOCK_ID("factory_code1_block_id","factoryCode","factoryName", "HPSC008.queryFactoryCode"),
/**
* 模块:系统管理
* 用途:用户查询
* 编写:ly
*/
USER_NAME_BLOCK_ID("user_name_block_id","userId","userName","factoryCode","groupCode", "HPSC008.queryUserName"),
/**
* 模块:系统管理
* 用途:生产组查询
* 编写:ly
*/
GROUP_NAME_BLOCK_ID("group_name_block_id","groupCode","groupName","factoryCode", "HPSC008.queryGroupName"),
/**
* 模块:系统管理
* 用途:厂区查询
* 编写:ly
*/
FACTORY_NAME_BLOCK_ID("factory_name_block_id","factoryCode","factoryName", "HPSC008.queryFactoryCode"),
/**
* 模块:巡检填报APP下拉
......
package com.baosight.hpjx.common;
import com.baosight.hpjx.hp.sc.domain.HPSC002;
import com.baosight.hpjx.hp.sc.domain.HPSC006;
/**
* @author:songx
* @date:2022/9/23,14:51
*/
public enum DocRouteEnum {
HPSC002("route_001", "HPSC002", "importData", HPSC002.class),
HPSC006("route_002", "HPSC006", "importData",HPSC006 .class);
private String id;
private String serviceNme;
private String methodName;
private Class clazz;
<T> DocRouteEnum(String id, String serviceNme, String methodName, Class<T> clazz) {
this.id = id;
this.serviceNme = serviceNme;
this.methodName = methodName;
this.clazz = clazz;
}
/**
* 根据ID获取枚举
*
* @param id
* @return
*/
public static DocRouteEnum getById(String id) {
for (DocRouteEnum docRouteEnum : DocRouteEnum.values()) {
if (docRouteEnum.id.equals(id)) {
return docRouteEnum;
}
}
return null;
}
public String getId() {
return id;
}
public String getServiceNme() {
return serviceNme;
}
public String getMethodName() {
return methodName;
}
public Class getClazz() {
return clazz;
}
}
package com.baosight.hpjx.common;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
/**
* @author:songx
* @date:2021/3/20,21:38
*/
@Retention(RetentionPolicy.RUNTIME)
public @interface ExcelAnno {
/**
* 列索引
*
* @return
*/
int index() default 0;
/**
* 列名
*
* @return
*/
String name() default "";
}
package com.baosight.hpjx.common;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
/**
* @author:songx
* @date:2021/3/20,21:38
*/
@Retention(RetentionPolicy.RUNTIME)
public @interface ExcelHeadAnon {
/**
* 列索引
*
* @return
*/
int index() default 0;
/**
* 必须与属性名保持一致,否则会获取不到数据
*
* @return
*/
String field() default "";
/**
* 列的中文名
*
* @return
*/
String name() default "";
}
package com.baosight.hpjx.controller;
import com.baosight.hpjx.hp.mt.untils.Base64ToMultipartFile;
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.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;
/**
* @author:songx
* @date:2024/3/14,14:26
*/
@CrossOrigin
@RestController
@RequestMapping({"/upload/file"})
public class FileUploadController {
/**
* 更具docId上传文件
*
* @param file
* @throws IOException
*/
@RequestMapping(value = "/app", method = RequestMethod.POST)
public Map upload(MultipartFile file) throws IOException {
Map resultMap = new HashMap();
try {
JSONObject upload = UploadUtils2.upload((CommonsMultipartFile)file);
resultMap.put("id",upload.getString("docId"));
resultMap.put("status", EiConstant.STATUS_SUCCESS);
resultMap.put("message", "SUCCESS");
return resultMap;
} catch (Exception e) {
resultMap.put("status", 500);
resultMap.put("message", LogUtils.getMsg(e));
return resultMap;
}
}
}
......@@ -105,7 +105,7 @@
<select id="query" resultClass="com.baosight.hpjx.hp.kc.domain.HPKC010">
SELECT <include refid="column"/>
FROM hpjx.T_HPKC010
WHERE 1=1
WHERE 1=1 AND AMOUNT!=0
<include refid="condition"/>
<include refid="customCondition"/>
<dynamic prepend="ORDER BY">
......
......@@ -44,21 +44,18 @@ public class ServiceHPMT001 extends ServiceBase {
* @param inInfo
* @return
*/
public EiInfo pmOverview(EiInfo inInfo) {
public Map pmOverview(EiInfo inInfo) {
Map resultMap = new HashMap();
try {
String queryMonth = inInfo.getString("queryMonth");
String companyCode = UserSessionUtils.getCompanyCode();
if (StrUtil.isEmpty(companyCode)) {
inInfo.setMsg("账号异常");
}
Map sqlMap = new HashMap();
sqlMap.put("queryMonth", queryMonth);
sqlMap.put("companyCode", companyCode);
List<Map> row1 = this.dao.query("HPMT001.pmOverview1", sqlMap);//目标
List<Map> row2 = this.dao.query("HPMT001.pmOverview2", sqlMap);//实际
List<Map> rows = new ArrayList<>();
Map resultMap = new HashMap();
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMM");
try {
Date parse = sdf.parse(queryMonth);
Calendar instance = Calendar.getInstance();
instance.setTime(parse);
......@@ -132,15 +129,13 @@ public class ServiceHPMT001 extends ServiceBase {
resultMap.put("actualWt_h_yoy", actualWt.subtract(actualWt2).divide(actualWt2,BigDecimal.ROUND_UP).
multiply(new BigDecimal(100)).doubleValue());
}
rows.add(resultMap);
EiInfo outInfo = new EiInfo();
EiBlock eiBlock = new EiBlock(EiConstant.resultBlock);
eiBlock.setRows(rows);
outInfo.setBlock(eiBlock);
return outInfo;
} catch (ParseException e) {
e.printStackTrace();
return inInfo;
resultMap.put("status",EiConstant.STATUS_SUCCESS);
resultMap.put("message","SUCCESS");
return resultMap;
} catch (Exception e) {
resultMap.put("status", 500);
resultMap.put("message",LogUtils.getMsg(e));
return resultMap;
}
}
......@@ -151,24 +146,26 @@ public class ServiceHPMT001 extends ServiceBase {
* @param inInfo
* @return
*/
public EiInfo pmBenchmarking(EiInfo inInfo) {
public Map pmBenchmarking(EiInfo inInfo) {
Map resultMap = new HashMap();
try {
String queryMonth = inInfo.getString("queryMonth");
String companyCode = UserSessionUtils.getCompanyCode();
if (StrUtil.isEmpty(companyCode)) {
inInfo.setMsg("账号异常");
}
Map sqlMap = new HashMap();
sqlMap.put("queryMonth", queryMonth);
sqlMap.put("companyCode", companyCode);
List<Map> rows = this.dao.query("HPMT001.pmBenchmarking", sqlMap);
List<Map> rows2 = this.dao.query("HPMT001.pmBenchmarking2", sqlMap);
EiInfo outInfo = new EiInfo();
EiBlock eiBlock = new EiBlock(EiConstant.resultBlock);
eiBlock.setRows(rows);
outInfo.setBlock(eiBlock);
outInfo.set("cout",rows2);
return outInfo;
resultMap.put("result",rows);
resultMap.put("result2",rows2);
resultMap.put("status",EiConstant.STATUS_SUCCESS);
resultMap.put("message","SUCCESS");
return resultMap;
} catch (Exception e) {
resultMap.put("status", 500);
resultMap.put("message",LogUtils.getMsg(e));
return resultMap;
}
}
}
......@@ -3,6 +3,7 @@
<sqlMap namespace="HPMT002">
<select id="pmProject" resultClass="java.util.HashMap">
SELECT * FROM (
SELECT
ID as "id",
COMPANY_CODE as "companyCode", <!-- 企业编码 预留 -->
......@@ -42,16 +43,52 @@
PROJ_NAME LIKE CONCAT('%', #projName#, '%')
</isNotEmpty>
order by STATUS,PLAN_COMPLETION_DATE
) AS A WHERE actualCompletionNum!=num
limit #offset#, #pageSize#
</select>
<select id="pmProjectCount" resultClass="int">
<select id="pmProjectCount" resultClass="java.util.HashMap">
SELECT * FROM (
SELECT
COUNT(*)
ID as "id",
COMPANY_CODE as "companyCode", <!-- 企业编码 预留 -->
PROJ_TYPE as "projType", <!-- 项目类型 -->
PROJ_CODE as "projCode", <!-- 项目编码 -->
PROJ_NAME as "projName", <!-- 项目名称 -->
PLAN_INFO_NO as "planInfoNo", <!-- 生产计划单号 -->
PLAN_COMPLETION_DATE as "planCompletionDate", <!-- 计划完成日期 -->
STATUS as "status", <!-- 状态 0-计划中,1-生产中 -->
CONCAT((
SELECT
format((ifnull( SUM( ACTUAL_COMPLETION_NUM ), 0 ) / ifnull( SUM( NUM ), 0 ) * 100),2)
FROM
hpjx.T_HPSC004
WHERE
PARENT_ID = hpjx.T_HPSC003.PLAN_INFO_NO
),'%') AS "schedule", <!-- 进度 -->
(
SELECT
IFNULL( SUM( ACTUAL_COMPLETION_UNIT_WT ), 0 )
FROM
hpjx.T_HPSC004
WHERE
PARENT_ID = hpjx.T_HPSC003.PLAN_INFO_NO
) AS "actualCompletionNum" <!-- 完成重量 -->
,
(
SELECT
IFNULL( SUM( TOTAL_WT ),2)
FROM
hpjx.T_HPSC004
WHERE
PARENT_ID = hpjx.T_HPSC003.PLAN_INFO_NO
) AS "num" <!-- 计划重量 -->
FROM hpjx.T_HPSC003 WHERE COMPANY_CODE= #companyCode#
<isNotEmpty prepend=" AND " property="projName">
PROJ_NAME LIKE CONCAT('%', #projName#, '%')
</isNotEmpty>
order by STATUS,PLAN_COMPLETION_DATE
) AS A WHERE actualCompletionNum!=num
</select>
<select id="pmQuality" resultClass="java.util.HashMap">
......@@ -194,7 +231,7 @@
<select id="queryFile" resultClass="java.util.HashMap">
SELECT CHG_NAME FROM iplat.TEUDM02 where DOC_ID=#docId#
SELECT URL FROM iplat.TEUDM05 where RES_ID=#docId#
</select>
......@@ -312,7 +349,7 @@
<select id="queryFvalue" resultClass="java.util.HashMap">
SELECT FVALUE AS "fvalue" FROM iplat.TEDCC03 WHERE FKEY='docRootDir'
SELECT DISTINCT FVALUE AS "fvalue" FROM iplat.TEDCC03 WHERE FKEY='docRootDir'
</select>
......
package com.baosight.hpjx.hp.mt.untils;
import com.baosight.hpjx.core.dao.DaoBase;
import com.baosight.iplat4j.core.data.ibatis.dao.Dao;
import com.baosight.iplat4j.core.data.id.UUIDHexIdGenerator;
import com.baosight.iplat4j.core.exception.PlatException;
......@@ -44,10 +45,12 @@ public class UploadUtils {
filePath = multipartFile.getOriginalFilename();
Long docSize = multipartFile.getSize();
String chgName = transformFileName(filePath);
System.out.println("----------------------------------解析Path");
String attachmentName;
Map<String, String> pathMap = getRealPath("A");
msg = (String)pathMap.get("dirId");
category = (String)pathMap.get("path");
System.out.println("----------------------------------获取dirId成功");
checkInvalidPath(category);
File dir = new File(category);
if (!dir.exists()) {
......@@ -116,7 +119,10 @@ public class UploadUtils {
public static Map<String, String> getRealPath(String path) {
String postPath = preparePath(path);
String dirId = initPath(postPath);
List<Map> query = dao.query("HPMT002.queryFvalue");
Map hashMap = new HashMap();
hashMap.put("fkey","docRootDir");
List<Map> query = DaoBase.getInstance().query("EDCC03.query",hashMap);
System.out.println("----------------------------------获取path地址");
if (query.get(0).get("fvalue")!=null) {
ROOT_PATH= (String) query.get(0).get("fvalue");
}
......
package com.baosight.hpjx.hp.mt.untils;
import com.baosight.hpjx.core.dao.DaoBase;
import com.baosight.iplat4j.core.data.ibatis.dao.Dao;
import com.baosight.iplat4j.core.data.id.UUIDHexIdGenerator;
import com.baosight.iplat4j.core.exception.PlatException;
......@@ -13,17 +14,17 @@ import com.baosight.iplat4j.eu.dm.util.FileProcessUtils;
import com.baosight.iplat4j.eu.dm.util.IFileUploader;
import net.sf.json.JSONObject;
import org.apache.commons.codec.binary.Base64;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.multipart.commons.CommonsMultipartFile;
import org.springframework.web.multipart.commons.CommonsMultipartResolver;
import javax.imageio.ImageIO;
import javax.servlet.http.HttpServletRequest;
import java.awt.image.BufferedImage;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.IOException;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
public class UploadUtils2 {
private static Dao dao = (Dao)PlatApplicationContext.getApplicationContext().getBean("dao");
......@@ -32,10 +33,9 @@ public class UploadUtils2 {
String docName = multipartFile.getOriginalFilename();
Long docSize = multipartFile.getSize();
HashMap<String, String> inMap = new HashMap();
Map<String, String> returnMap = null;
returnMap = PlatFileUploadUtils.uploadFile(multipartFile, inMap);
inMap.put("groupId", "hk_file11");
inMap.put("configPathDefine", "A");
Map<String, String> returnMap = PlatFileUploadUtils.uploadFile(multipartFile, inMap);
String docId = (String)returnMap.get("docId");
String docUrl = (String)returnMap.get("docUrl");
docId = docId == null ? "" : docId;
......@@ -45,15 +45,13 @@ public class UploadUtils2 {
} else {
documentJSON.remove("docUrl");
}
documentJSON.put("groupId", returnMap.get("groupId") == null ? "" : returnMap.get("groupId"));
documentJSON.put("docName", docName);
documentJSON.put("docSize", docSize);
documentJSON.put("docType", docName.substring(docName.lastIndexOf(46)));
return documentJSON;
}
}
}
......@@ -26,6 +26,8 @@ public class HPPZ009 extends DaoEPBase {
public static final String FIELD_COMPANY_NAME = "companyName"; /* 企业名称*/
public static final String FIELD_VALID_FLAG = "validFlag"; /* 是否启用:1.启用,0.停用*/
public static final String FIELD_LOGIN_PREFIX = "loginPrefix"; /* 登录前缀*/
public static final String FIELD_DOC_ID_PC = "docIdPc"; /* 登录前缀*/
public static final String FIELD_DOC_ID_APP = "docIdApp"; /* 登录前缀*/
public static final String FIELD_REMARK = "remark"; /* 备注*/
public static final String FIELD_CREATED_BY = "createdBy"; /* 创建人*/
public static final String FIELD_CREATED_NAME = "createdName"; /* 创建人名称*/
......@@ -60,6 +62,8 @@ public class HPPZ009 extends DaoEPBase {
private String companyName = " "; /* 企业名称*/
private Integer validFlag; /* 是否启用:1.启用,0.停用*/
private String loginPrefix = " "; /* 登录前缀*/
private String docIdPc = " "; /* 登录前缀*/
private String docIdApp = " "; /* 登录前缀*/
private String remark = " "; /* 备注*/
private String createdBy = " "; /* 创建人*/
private String createdName = " "; /* 创建人名称*/
......@@ -96,6 +100,14 @@ public class HPPZ009 extends DaoEPBase {
eiColumn.setDescName("登录前缀");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DOC_ID_PC);
eiColumn.setDescName("pc文档标识");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DOC_ID_APP);
eiColumn.setDescName("app文档标识");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_REMARK);
eiColumn.setDescName("备注");
eiMetadata.addMeta(eiColumn);
......@@ -218,6 +230,23 @@ public class HPPZ009 extends DaoEPBase {
public void setLoginPrefix(String loginPrefix) {
this.loginPrefix = loginPrefix;
}
public String getDocIdPc() {
return docIdPc;
}
public void setDocIdPc(String docIdPc) {
this.docIdPc = docIdPc;
}
public String getDocIdApp() {
return docIdApp;
}
public void setDocIdApp(String docIdApp) {
this.docIdApp = docIdApp;
}
/**
* get the remark - 备注.
* @return the remark
......@@ -359,6 +388,8 @@ public class HPPZ009 extends DaoEPBase {
setCompanyName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_COMPANY_NAME)), companyName));
setValidFlag(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_VALID_FLAG)), validFlag));
setLoginPrefix(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_LOGIN_PREFIX)), loginPrefix));
setDocIdPc(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DOC_ID_PC)), docIdPc));
setDocIdApp(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DOC_ID_APP)), docIdApp));
setRemark(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_REMARK)), remark));
setCreatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_BY)), createdBy));
setCreatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_NAME)), createdName));
......@@ -381,6 +412,8 @@ public class HPPZ009 extends DaoEPBase {
map.put(FIELD_COMPANY_NAME, StringUtils.toString(companyName, eiMetadata.getMeta(FIELD_COMPANY_NAME)));
map.put(FIELD_VALID_FLAG, StringUtils.toString(validFlag, eiMetadata.getMeta(FIELD_VALID_FLAG)));
map.put(FIELD_LOGIN_PREFIX, StringUtils.toString(loginPrefix, eiMetadata.getMeta(FIELD_LOGIN_PREFIX)));
map.put(FIELD_DOC_ID_PC, StringUtils.toString(docIdPc, eiMetadata.getMeta(FIELD_DOC_ID_PC)));
map.put(FIELD_DOC_ID_APP, StringUtils.toString(docIdApp, eiMetadata.getMeta(FIELD_DOC_ID_APP)));
map.put(FIELD_REMARK, StringUtils.toString(remark, eiMetadata.getMeta(FIELD_REMARK)));
map.put(FIELD_CREATED_BY, StringUtils.toString(createdBy, eiMetadata.getMeta(FIELD_CREATED_BY)));
map.put(FIELD_CREATED_NAME, StringUtils.toString(createdName, eiMetadata.getMeta(FIELD_CREATED_NAME)));
......
......@@ -61,6 +61,7 @@ public class ServiceHPPZ006 extends ServiceBase {
@Override
public EiInfo query(EiInfo inInfo) {
try {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_NAME_BLOCK_ID), null,false);
inInfo = super.query(inInfo, HPPZ006.QUERY, new HPPZ006());
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
......
......@@ -3,12 +3,15 @@ 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.core.security.UserSessionUtils;
import com.baosight.hpjx.hp.constant.HPConstant;
import com.baosight.hpjx.hp.pz.domain.HPPZ009;
import com.baosight.hpjx.hp.xs.tools.HPXSTools;
import com.baosight.hpjx.util.AssertUtils;
import com.baosight.hpjx.util.DateUtils;
import com.baosight.hpjx.util.LogUtils;
import com.baosight.hpjx.util.contants.ACConstants;
import com.baosight.iplat4j.core.ProjectInfo;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException;
......@@ -57,6 +60,8 @@ public class ServiceHPPZ009 extends ServiceBase {
public EiInfo query(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, "HPPZ009.query", new HPPZ009());
String projectEnv = ProjectInfo.getProjectEnv();
inInfo.setCell(EiConstant.resultBlock,ACConstants.ROW_CODE_0,"projectEnv",projectEnv);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
......
......@@ -96,7 +96,7 @@ public class ServiceHPPZ015 extends ServiceBase {
HPPZ015.setProjCode(hpsc001.getProjCode());
HPPZ015.setTemplateName(inInfo.getString("templateName"));
HPPZ015.setCreatedBy(UserSession.getUserId());
HPPZ015.setCompanyCode(UserSession.getUserId());
HPPZ015.setCompanyCode(UserSessionUtils.getCompanyCode());
HPPZ015.setCreatedName(UserSession.getUserId()+"-"+UserSession.getLoginCName());
HPPZ015.setCreatedTime(sdf.format(new Date()));
HPPZ015.setUpdatedBy(null);
......
......@@ -8,6 +8,8 @@
COMPANY_NAME as "companyName", <!-- 企业名称 -->
VALID_FLAG as "validFlag", <!-- 是否启用:1.启用,0.停用 -->
LOGIN_PREFIX as "loginPrefix", <!-- 登录前缀 -->
DOC_ID_PC as "docIdPc",
DOC_ID_APP as "docIdApp",
REMARK as "remark", <!-- 备注 -->
CREATED_BY as "createdBy", <!-- 创建人 -->
CREATED_NAME as "createdName", <!-- 创建人名称 -->
......@@ -81,12 +83,14 @@
COMPANY_NAME, <!-- 企业名称 -->
VALID_FLAG, <!-- 是否启用:1.启用,0.停用 -->
LOGIN_PREFIX, <!-- 登录前缀 -->
DOC_ID_PC,
DOC_ID_APP,
REMARK, <!-- 备注 -->
CREATED_BY, <!-- 创建人 -->
CREATED_NAME, <!-- 创建人名称 -->
CREATED_TIME <!-- 创建时间 -->
) VALUES (
#companyCode#, #companyName#, #validFlag#, #loginPrefix#, #remark#, #createdBy#,
#companyCode#, #companyName#, #validFlag#, #loginPrefix#, #docIdPc#, #docIdApp#, #remark#, #createdBy#,
#createdName#, #createdTime#
)
</insert>
......@@ -96,6 +100,8 @@
UPDATE ${hpjxSchema}.T_HPPZ009
SET
COMPANY_NAME = #companyName#,
DOC_ID_PC = #docIdPc#,
DOC_ID_APP = #docIdApp#,
VALID_FLAG = #validFlag#,
REMARK = #remark#,
<include refid="updateRevise"/>
......
package com.baosight.hpjx.hp.sc.domain;
import com.baosight.hpjx.common.ExcelAnno;
import com.baosight.iplat4j.core.util.NumberUtils;
import java.math.BigDecimal;
import com.baosight.iplat4j.core.ei.EiColumn;
......@@ -119,15 +120,22 @@ public class HPSC002 extends DaoEPBase {
private String leaf = "1"; /* 是否有叶子节点*/
private String sort = " "; /* 排序字段*/
private String icon = " "; /* 图片地址*/
@ExcelAnno(index = 0)
private Integer prdtType; /* 产品类型*/
private String prdtCode = " "; /* 产品编码*/
@ExcelAnno(index = 1)
private String prdtName = " "; /* 产品名称*/
@ExcelAnno(index = 2)
private BigDecimal length = new BigDecimal("0"); /* 长*/
@ExcelAnno(index = 3)
private BigDecimal width = new BigDecimal("0"); /* 宽*/
@ExcelAnno(index = 4)
private BigDecimal thick = new BigDecimal("0"); /* 厚*/
private Long inventRecordId; /* 项目档案ID*/
private String spec = " "; /* 规格*/
@ExcelAnno(index = 6)
private BigDecimal num = new BigDecimal(0.000); /* 数量*/
@ExcelAnno(index = 7)
private BigDecimal unitWt = new BigDecimal(0.000); /* 单重*/
private BigDecimal totalWt = new BigDecimal(0.000); /* 总重*/
private String filePath1 = " "; /* 文件地址1*/
......@@ -143,6 +151,7 @@ public class HPSC002 extends DaoEPBase {
private String updatedBy = " "; /* 更新人*/
private String updatedName = " "; /* 修改人名称*/
private String updatedTime = " "; /* 更新时间*/
@ExcelAnno(index = 5)
private String remark = " "; /* 备注*/
private String pgStatus = " "; /* 派工状态*/
......
package com.baosight.hpjx.hp.sc.domain;
import com.baosight.hpjx.common.ExcelAnno;
import com.baosight.iplat4j.core.util.NumberUtils;
import java.math.BigDecimal;
import com.baosight.iplat4j.core.ei.EiColumn;
......@@ -117,13 +118,20 @@ public class HPSC006 extends DaoEPBase {
private String productionOrderNo = " "; /* 生产订单号*/
private Integer inventType; /* 材料类型*/
private String inventCode = " "; /* 材料编码*/
@ExcelAnno(index = 0)
private String inventName = " "; /* 材料名称*/
@ExcelAnno(index = 1)
private BigDecimal inventLength = new BigDecimal("0"); /* 材料-长*/
@ExcelAnno(index = 2)
private BigDecimal inventWidth = new BigDecimal("0"); /* 材料-宽*/
@ExcelAnno(index = 3)
private BigDecimal inventThick = new BigDecimal("0"); /* 材料-厚*/
private String inventSpec = " "; /* 材料规格*/
@ExcelAnno(index = 8)
private String planCompletionDate = " "; /* 计划完成日期*/
@ExcelAnno(index = 6)
private BigDecimal num = new BigDecimal(0.000); /* 计划数量*/
@ExcelAnno(index = 7)
private BigDecimal unitWt = new BigDecimal("0"); /* 计划单重*/
private BigDecimal totalWt = new BigDecimal(0.000); /* 计划重量*/
private String actualCompletionDate = " "; /* 实际完工日期*/
......@@ -139,9 +147,11 @@ public class HPSC006 extends DaoEPBase {
private String updatedBy = " "; /* 更新人*/
private String updatedTime = " "; /* 更新时间*/
private String depCode = " "; /* 部门编码*/
@ExcelAnno(index = 5)
private String remark = " "; /* 备注*/
private String filePath1 = " "; /* 文件地址1*/
private Integer inventRecordId = new Integer(0); /* 存货档案ID*/
@ExcelAnno(index = 4)
private String material = " "; /* 材质*/
private String prdtName = " "; /* 产品名称*/
private String partName = " "; /* 零件名称*/
......
......@@ -67,6 +67,7 @@ public class HPSC008 extends DaoEPBase {
public static final String INSERT = "HPSC008.insert";
public static final String UPDATE = "HPSC008.update";
public static final String DELETE = "HPSC008.delete";
public static final String DELETE_FLAG = "HPSC008.deleteFlag";
private Long id = new Long(0); /* ID*/
private String companyCode = " "; /* 企业编码 预留*/
......
......@@ -139,7 +139,7 @@ public class ServiceHPSC002 extends ServiceBase {
BigDecimal num = hpsc002.getNum();
BigDecimal unitWt = hpsc002.getUnitWt();
DecimalFormat decimalFormat = new DecimalFormat("#.000");
BigDecimal totalWt = new BigDecimal(decimalFormat.format(Math.round(num.multiply(unitWt).floatValue())));
BigDecimal totalWt = new BigDecimal(decimalFormat.format(num.multiply(unitWt).floatValue()));
hpsc002.setDelStatus(CommonConstant.YesNo.NO_0.intValue());
hpsc002.setTotalWt(totalWt);
......@@ -293,7 +293,7 @@ public class ServiceHPSC002 extends ServiceBase {
BigDecimal num = hppz002.getNum();
BigDecimal unitWt = hppz002.getUnitWt();
DecimalFormat decimalFormat = new DecimalFormat("#.000");
BigDecimal totalWt = new BigDecimal(decimalFormat.format(Math.round(num.multiply(unitWt).floatValue())));
BigDecimal totalWt = new BigDecimal(decimalFormat.format(num.multiply(unitWt).floatValue()));
hppz002.setDelStatus(CommonConstant.YesNo.NO_0.intValue());
hppz002.setTotalWt(totalWt);
......@@ -443,7 +443,7 @@ public class ServiceHPSC002 extends ServiceBase {
BigDecimal num = hppz002.getNum();
BigDecimal unitWt = hppz002.getUnitWt();
DecimalFormat decimalFormat = new DecimalFormat("#.000");
BigDecimal totalWt = new BigDecimal(decimalFormat.format(Math.round(num.multiply(unitWt).floatValue())));
BigDecimal totalWt = new BigDecimal(decimalFormat.format(num.multiply(unitWt).floatValue()));
hppz002.setDelStatus(CommonConstant.YesNo.NO_0.intValue());
hppz002.setTotalWt(totalWt);
hppz002.setSpec(HPPZTools.HpPz006.jointSpec(hppz002.getLength(),hppz002.getWidth(),hppz002.getThick()));
......@@ -742,7 +742,33 @@ public class ServiceHPSC002 extends ServiceBase {
}
}
@OperationLogAnnotation(operModul = "物料清单",operType = "导入",operDesc = "导入")
public EiInfo importData(EiInfo inInfo) {
try {
List<HPSC002> dataList = (List) inInfo.get("dataList");
HashMap params = (HashMap) inInfo.get("params");
String parentId = (String) params.get("parentId");
String projCode = (String) params.get("projCode");
String projName = (String) params.get("projName");
String parentPrdtName = (String) params.get("parentPrdtName");
// 写入数据
for (HPSC002 hpsc002:dataList) {
hpsc002.setParentId(parentId);
hpsc002.setProjCode(projCode);
hpsc002.setProjName(projName);
hpsc002.setParentPrdtName(parentPrdtName);
hpsc002.setStatus(CommonConstant.YesNo.NO_0.intValue());
add(hpsc002);
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + dataList.size() + "]条数据保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 部件类型下拉框
* @param inInfo 形参
......
package com.baosight.hpjx.hp.sc.service;
import cn.hutool.core.bean.BeanUtil;
import com.baosight.hpjx.aspect.annotation.OperationLogAnnotation;
import com.baosight.hpjx.common.DdynamicEnum;
import com.baosight.hpjx.common.HPConstants;
import com.baosight.hpjx.common.ProdOrderStatusEnum;
import com.baosight.hpjx.core.constant.CommonConstant;
import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.core.security.UserSessionUtils;
import com.baosight.hpjx.hp.constant.HPConstant;
import com.baosight.hpjx.hp.ds.domain.HPDS002;
import com.baosight.hpjx.hp.pz.domain.HPPZ002;
import com.baosight.hpjx.hp.pz.domain.HPPZ011;
import com.baosight.hpjx.hp.pz.tools.HPPZTools;
import com.baosight.hpjx.hp.sc.domain.*;
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.*;
import com.baosight.iplat4j.core.ProjectInfo;
......@@ -20,11 +26,13 @@ import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.service.impl.ServiceBase;
import com.baosight.iplat4j.core.service.soa.XServiceManager;
import com.baosight.iplat4j.core.util.NumberUtils;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import org.apache.commons.lang.StringUtils;
import org.springframework.util.CollectionUtils;
import java.math.BigDecimal;
import java.text.DecimalFormat;
import java.text.SimpleDateFormat;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
......@@ -100,6 +108,74 @@ public class ServiceHPSC006 extends ServiceBase {
}
/**
* 保存操作
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "生产下料",operType = "保存",operDesc = "保存")
public EiInfo save(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock("detail").getRows();
String productionOrderNo = inInfo.getString("productionOrderNo");
String projCode = inInfo.getString("projCode");
String projName = inInfo.getString("projName");
// 写入数据
for (int i = 0; i < resultRows.size(); i++) {
HPSC006 hpsc006 = new HPSC006();
hpsc006.fromMap(resultRows.get(i));
hpsc006.setInventType(7);
BigDecimal num = hpsc006.getNum();
BigDecimal unitWt = hpsc006.getUnitWt();
DecimalFormat decimalFormat = new DecimalFormat("#.000");
BigDecimal totalWt = new BigDecimal(decimalFormat.format(num.multiply(unitWt).floatValue()));
hpsc006.setInventSpec(HPPZTools.HpPz006.jointSpec(hpsc006.getInventLength(),hpsc006.getInventWidth(),hpsc006.getInventThick()));
hpsc006.setProjCode(projCode);
hpsc006.setProjName(projName);
hpsc006.setProductionOrderNo(productionOrderNo);
hpsc006.setTotalWt(totalWt);
hpsc006.setInventCode(HPPZTools.checkAndSavePZ04(hpsc006.getInventType(),hpsc006.getInventName()));
// 去除日期字符串中的-
hpsc006.setPlanCompletionDate(StringUtil.removeHorizontalLine(hpsc006.getPlanCompletionDate()));
if(hpsc006.getFactoryCode()!=null && !(hpsc006.getFactoryCode().equals(" "))) {
AssertUtils.isEmpty(hpsc006.getOrgNo(), "已选择厂区,下料组不能为空");
hpsc006.setStatus(1);
hpsc006.setOrgName(HPXSTools.XsOrg.get(hpsc006.getFactoryCode()).getOrgCname());
hpsc006.setFactoryName(HPXSTools.XsOrg.get(hpsc006.getOrgNo()).getOrgCname());
}
if (hpsc006.getId() == null || hpsc006.getId() == 0) {
hpsc006.setStatus(CommonConstant.YesNo.NO_0.intValue());
this.add(hpsc006);
} else {
this.modify(hpsc006);
}
}
int size = resultRows.size();
//刷新
//inInfo = this.refreshHPSC006(inInfo, productionOrderNo);
inInfo = this.queryDetail(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + size + "]条数据保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 新增操作.
*/
public void add(HPSC006 hpsc006) {
DaoUtils.insert("HPSC006.insert",hpsc006);
}
/**
* 修改操作.
*/
public void modify(HPSC006 hpsc006) {
DaoUtils.update("HPSC006.update",hpsc006);
}
/**
* 新增操作.
*/
@OperationLogAnnotation(operModul = "生产下料",operType = "新增",operDesc = "新增")
......@@ -119,7 +195,7 @@ public class ServiceHPSC006 extends ServiceBase {
BigDecimal num = HPSC006.getNum();
BigDecimal unitWt = HPSC006.getUnitWt();
DecimalFormat decimalFormat = new DecimalFormat("#.000");
BigDecimal totalWt = new BigDecimal(decimalFormat.format(Math.round(num.multiply(unitWt).floatValue())));
BigDecimal totalWt = new BigDecimal(decimalFormat.format(num.multiply(unitWt).floatValue()));
HPSC006.setInventSpec(HPPZTools.HpPz006.jointSpec(HPSC006.getInventLength(),HPSC006.getInventWidth(),HPSC006.getInventThick()));
HPSC006.setProjCode(projCode);
HPSC006.setProjName(projName);
......@@ -176,7 +252,7 @@ public class ServiceHPSC006 extends ServiceBase {
BigDecimal num = HPSC006.getNum();
BigDecimal unitWt = HPSC006.getUnitWt();
DecimalFormat decimalFormat = new DecimalFormat("#.000");
BigDecimal totalWt = new BigDecimal(decimalFormat.format(Math.round(num.multiply(unitWt).floatValue())));
BigDecimal totalWt = new BigDecimal(decimalFormat.format(num.multiply(unitWt).floatValue()));
HPSC006.setInventSpec(HPPZTools.HpPz006.jointSpec(HPSC006.getInventLength(),HPSC006.getInventWidth(),HPSC006.getInventThick()));
HPSC006.setProjCode(projCode);
HPSC006.setProjName(projName);
......@@ -305,6 +381,41 @@ public class ServiceHPSC006 extends ServiceBase {
return outInfo;
}
@OperationLogAnnotation(operModul = "物料清单",operType = "导入",operDesc = "导入")
public EiInfo importData(EiInfo inInfo) {
try {
List<HPSC006> dataList = (List) inInfo.get("dataList");
HashMap params = (HashMap) inInfo.get("params");
String productionOrderNo = (String) params.get("productionOrderNo");
String projCode = (String) params.get("projCode");
String projName = (String) params.get("projName");
// 写入数据
for (HPSC006 hpsc006:dataList) {
hpsc006.setInventType(7);
BigDecimal num = hpsc006.getNum();
BigDecimal unitWt = hpsc006.getUnitWt();
DecimalFormat decimalFormat = new DecimalFormat("#.000");
BigDecimal totalWt = new BigDecimal(decimalFormat.format(num.multiply(unitWt).floatValue()));
hpsc006.setInventSpec(HPPZTools.HpPz006.jointSpec(hpsc006.getInventLength(),hpsc006.getInventWidth(),hpsc006.getInventThick()));
hpsc006.setProjCode(projCode);
hpsc006.setProjName(projName);
hpsc006.setProductionOrderNo(productionOrderNo);
hpsc006.setTotalWt(totalWt);
hpsc006.setInventCode(HPPZTools.checkAndSavePZ04(hpsc006.getInventType(),hpsc006.getInventName()));
// 去除日期字符串中的-
hpsc006.setPlanCompletionDate(StringUtil.removeHorizontalLine(hpsc006.getPlanCompletionDate()));
add(hpsc006);
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + dataList.size() + "]条数据保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 删除附件文件
* @param id 文件ID
......
......@@ -8,12 +8,14 @@ import com.baosight.hpjx.core.security.UserSessionUtils;
import com.baosight.hpjx.hp.pz.domain.HPPZ013;
import com.baosight.hpjx.hp.sc.domain.HPSC008;
import com.baosight.hpjx.util.CommonMethod;
import com.baosight.hpjx.util.ErrorCodeUtils;
import com.baosight.hpjx.util.StringUtil;
import com.baosight.hpjx.util.contants.ACConstants;
import com.baosight.iplat4j.core.ei.EiBlock;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.resource.I18nMessages;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import java.util.Arrays;
......@@ -27,22 +29,39 @@ import java.util.Map;
*/
public class ServiceHPSC008 extends ServiceEPBase {
final public static String GROUP_TYPE = "prodGroup";
@Override
public EiInfo initLoad(EiInfo inInfo) {
inInfo.setCell(EiConstant.queryBlock,ACConstants.ROW_CODE_0,HPSC008.FIELD_DELETE_FLAG,CommonConstant.YesNo.NO_0);
final EiInfo outEiInfo = super.query(inInfo, HPSC008.QUERY, new HPSC008());
final String companyCode = UserSessionUtils.getCompanyCode();
//拼接名称 包含逻辑删除数据
CommonMethod.initBlock(outEiInfo,
Arrays.asList(DdynamicEnum.USER_ID_BLOCK_ID,DdynamicEnum.GROUP_CODE_BLOCK_ID,DdynamicEnum.FACTORY_CODE_BLOCK_ID),
new HashMap<String,Object>(){{put(HPSC008.FIELD_COMPANY_CODE,companyCode);}}
new HashMap<String,Object>(){{
put(HPSC008.FIELD_COMPANY_CODE,companyCode);
put(HPSC008.FIELD_GROUP_TYPE,GROUP_TYPE);
}}
);
//拼接名称 不包含逻辑删除数据
CommonMethod.initBlock(outEiInfo,
Arrays.asList(DdynamicEnum.USER_ID1_BLOCK_ID,DdynamicEnum.GROUP_CODE1_BLOCK_ID,DdynamicEnum.FACTORY_CODE1_BLOCK_ID),
new HashMap<String,Object>(){{
put(HPSC008.FIELD_COMPANY_CODE,companyCode);
put(HPSC008.FIELD_GROUP_TYPE,GROUP_TYPE);
put(HPSC008.FIELD_DELETE_FLAG,CommonConstant.YesNo.NO_0);
}}
);
//outEiInfo.getBlock(EiConstant.resultBlock).getRows().clear();
//无拼接名称 包含逻辑删除数据
CommonMethod.initBlock(outEiInfo,
Arrays.asList(DdynamicEnum.USER_NAME_BLOCK_ID,DdynamicEnum.GROUP_NAME_BLOCK_ID),
new HashMap<String,Object>(){{
put(HPSC008.FIELD_COMPANY_CODE,companyCode);
put(HPSC008.FIELD_GROUP_TYPE,GROUP_TYPE);
//put(HPSC008.FIELD_DELETE_FLAG,CommonConstant.YesNo.NO_0);
}}
);
return outEiInfo;
}
......@@ -57,70 +76,111 @@ public class ServiceHPSC008 extends ServiceEPBase {
if (!startDate.isEmpty()) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0,"createdDateFrom",StringUtil.removeHorizontalLine(startDate));
}
inInfo.setCell(EiConstant.queryBlock,ACConstants.ROW_CODE_0,HPSC008.FIELD_DELETE_FLAG,CommonConstant.YesNo.NO_0);
return super.query(inInfo, HPSC008.QUERY,new HPSC008());
}
@OperationLogAnnotation(operModul = "报工管理",operType = "删除",operDesc = "删除操作")
@Override
public EiInfo delete(EiInfo inInfo) {
return super.delete(inInfo, HPSC008.DELETE);
int i = 0;
try {
HPSC008 hpxs001 = new HPSC008();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
for (i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
hpxs001.fromMap(map);
hpxs001.setDeleteFlag(CommonConstant.YesNo.YES_1);
DaoUtils.update(HPSC008.DELETE_FLAG, hpxs001);
}
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 = "修改操作")
@Override
public EiInfo update(EiInfo inInfo) {
return super.update(inInfo, HPSC008.UPDATE);
int i = 0;
try {
HPSC008 hpxs002 = new HPSC008();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
for (i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
hpxs002.fromMap(map);
hpxs002.setDeleteFlag(CommonConstant.YesNo.NO_0);
DaoUtils.update(HPSC008.UPDATE, hpxs002);
}
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;
}
@OperationLogAnnotation(operModul = "报工管理",operType = "新增",operDesc = "新增操作")
@Override
public EiInfo insert(EiInfo inInfo) {
int i = 0;
try {
HPSC008 hpxs001 = new HPSC008();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
for (int i = 0; i < eiBlock.getRowCount(); i++) {
for (i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
hpxs001.fromMap(map);
hpxs001.setDeleteFlag(CommonConstant.YesNo.NO_0);
DaoUtils.insert(HPSC008.INSERT, hpxs001.toMap());
DaoUtils.insert(HPSC008.INSERT, hpxs001);
}
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsg("新增成功!");
inInfo.setMsgByKey("ep.1000", new String[]{String.valueOf(i), I18nMessages.getText("label.insert", "新增")});
} catch (PlatException e) {
e.printStackTrace();
inInfo.setStatus(EiConstant.STATUS_FAILURE);
inInfo.setMsg("新增失败!原因参见详细错误描述!");
inInfo.setDetailMsg(e.getMessage());
ErrorCodeUtils.handleInsertException(inInfo,i,e);
logError("新增失败", e.getMessage());
return inInfo;
}
return query(inInfo);
//return super.insert(inInfo,HPXS001.INSERT);
return inInfo;
}
public EiInfo queryFactoryCode(EiInfo inInfo) {
final String companyCode = UserSessionUtils.getCompanyCode();
String factoryCode = inInfo.getString(HPPZ013.FIELD_FACTORY_CODE);
String factoryCode = inInfo.getString(HPSC008.FIELD_FACTORY_CODE);
String groupType = inInfo.getString(HPSC008.FIELD_GROUP_TYPE);
CommonMethod.initBlock(inInfo,
Arrays.asList(DdynamicEnum.GROUP_CODE_BLOCK_ID),
new HashMap<String,Object>(){{
put(HPSC008.FIELD_COMPANY_CODE,companyCode);
put(HPSC008.FIELD_FACTORY_CODE,factoryCode);
put(HPSC008.FIELD_GROUP_TYPE,groupType);
}});
return inInfo;
}
public EiInfo queryGroupCode(EiInfo inInfo) {
final String companyCode = UserSessionUtils.getCompanyCode();
String factoryCode = inInfo.getString(HPPZ013.FIELD_FACTORY_CODE);
String factoryCode = inInfo.getString(HPSC008.FIELD_FACTORY_CODE);
String groupCode = inInfo.getString(HPSC008.FIELD_GROUP_CODE);
String groupType = inInfo.getString(HPSC008.FIELD_GROUP_TYPE);
CommonMethod.initBlock(inInfo,
Arrays.asList(DdynamicEnum.USER_ID_BLOCK_ID),
new HashMap<String,Object>(){{
put(HPSC008.FIELD_COMPANY_CODE,companyCode);
put(HPSC008.FIELD_FACTORY_CODE,factoryCode);
put(HPSC008.FIELD_GROUP_CODE,groupCode);
put(HPSC008.FIELD_GROUP_TYPE,groupType);
}});
return inInfo;
}
......
package com.baosight.hpjx.hp.sc.service;
import com.baosight.hpjx.aspect.annotation.OperationLogAnnotation;
import com.baosight.hpjx.common.DdynamicEnum;
import com.baosight.hpjx.core.constant.CommonConstant;
import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.core.security.UserSessionUtils;
import com.baosight.hpjx.hp.sc.domain.HPSC009;
import com.baosight.hpjx.util.CommonMethod;
import com.baosight.hpjx.util.ErrorCodeUtils;
import com.baosight.hpjx.util.StringUtil;
import com.baosight.hpjx.util.contants.ACConstants;
import com.baosight.iplat4j.core.ei.EiBlock;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.resource.I18nMessages;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
/**
* @author LiuYang
* @version 1.0 2024/3/21
* @page 下料报工管理
*/
public class ServiceHPSC009 extends ServiceEPBase {
//下料组编码
final public static String GROUP_TYPE = "cutGroup";
@Override
public EiInfo initLoad(EiInfo inInfo) {
final String companyCode = UserSessionUtils.getCompanyCode();
inInfo.setCell(EiConstant.queryBlock,ACConstants.ROW_CODE_0, HPSC009.FIELD_DELETE_FLAG,CommonConstant.YesNo.NO_0);
inInfo.setCell(EiConstant.queryBlock,ACConstants.ROW_CODE_0,HPSC009.COL_COMPANY_CODE,companyCode);
final EiInfo outEiInfo = super.query(inInfo, HPSC009.QUERY, new HPSC009());
CommonMethod.initBlock(outEiInfo,
Arrays.asList(DdynamicEnum.USER_ID_BLOCK_ID,DdynamicEnum.GROUP_CODE_BLOCK_ID,DdynamicEnum.FACTORY_CODE_BLOCK_ID),
new HashMap<String,Object>(){{
put(HPSC009.FIELD_COMPANY_CODE,companyCode);
put(HPSC009.FIELD_GROUP_TYPE,GROUP_TYPE);
}}
);
CommonMethod.initBlock(outEiInfo,
Arrays.asList(DdynamicEnum.USER_ID1_BLOCK_ID,DdynamicEnum.GROUP_CODE1_BLOCK_ID,DdynamicEnum.FACTORY_CODE1_BLOCK_ID),
new HashMap<String,Object>(){{
put(HPSC009.FIELD_COMPANY_CODE,companyCode);
put(HPSC009.FIELD_GROUP_TYPE,GROUP_TYPE);
put(HPSC009.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
}}
);
CommonMethod.initBlock(outEiInfo,
Arrays.asList(DdynamicEnum.USER_NAME_BLOCK_ID,DdynamicEnum.GROUP_NAME_BLOCK_ID),
new HashMap<String,Object>(){{
put(HPSC009.FIELD_COMPANY_CODE,companyCode);
put(HPSC009.FIELD_GROUP_TYPE,GROUP_TYPE);
//put(HPSC009.FIELD_DELETE_FLAG,CommonConstant.YesNo.NO_0);
}}
);
return outEiInfo;
}
@Override
public EiInfo query(EiInfo inInfo) {
EiBlock block = inInfo.getBlock(EiConstant.queryBlock);
String startDate = block.getCellStr(ACConstants.ROW_CODE_0,"createdDateFrom");
String endDate = block.getCellStr(ACConstants.ROW_CODE_0,"createdDateTo");
if (!endDate.isEmpty()) {
inInfo.setCell(EiConstant.queryBlock,ACConstants.ROW_CODE_0,"createdDateTo", StringUtil.removeHorizontalLine(endDate));
}
if (!startDate.isEmpty()) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0,"createdDateFrom",StringUtil.removeHorizontalLine(startDate));
}
inInfo.setCell(EiConstant.queryBlock,ACConstants.ROW_CODE_0,HPSC009.FIELD_DELETE_FLAG,CommonConstant.YesNo.NO_0);
return super.query(inInfo, HPSC009.QUERY,new HPSC009());
}
@OperationLogAnnotation(operModul = "报工管理",operType = "删除",operDesc = "删除操作")
@Override
public EiInfo delete(EiInfo inInfo) {
int i = 0;
try {
HPSC009 hpxs001 = new HPSC009();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
for (i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
hpxs001.fromMap(map);
hpxs001.setDeleteFlag(CommonConstant.YesNo.YES_1);
DaoUtils.update(HPSC009.DELETE_FLAG, hpxs001.toMap());
}
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 query(inInfo);
}
@OperationLogAnnotation(operModul = "报工管理",operType = "修改",operDesc = "修改操作")
@Override
public EiInfo update(EiInfo inInfo) {
int i = 0;
try {
HPSC009 hpxs002 = new HPSC009();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
for (i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
hpxs002.fromMap(map);
hpxs002.setDeleteFlag(CommonConstant.YesNo.NO_0);
DaoUtils.update(HPSC009.UPDATE, hpxs002);
}
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 query(inInfo);
}
@OperationLogAnnotation(operModul = "报工管理",operType = "新增",operDesc = "新增操作")
@Override
public EiInfo insert(EiInfo inInfo) {
int i = 0;
try {
HPSC009 hpxs002 = new HPSC009();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
for (i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
hpxs002.fromMap(map);
hpxs002.setDeleteFlag(CommonConstant.YesNo.NO_0);
DaoUtils.insert(HPSC009.INSERT, hpxs002);
}
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsgByKey("ep.1000", new String[]{String.valueOf(i), I18nMessages.getText("label.insert", "新增")});
} catch (PlatException e) {
e.printStackTrace();
inInfo.setStatus(EiConstant.STATUS_FAILURE);
ErrorCodeUtils.handleInsertException(inInfo,i,e);
logError("新增失败", e.getMessage());
return inInfo;
}
return query(inInfo);
}
public EiInfo queryFactoryCode(EiInfo inInfo) {
final String companyCode = UserSessionUtils.getCompanyCode();
String factoryCode = inInfo.getString(HPSC009.FIELD_FACTORY_CODE);
String groupType = inInfo.getString(HPSC009.FIELD_GROUP_TYPE);
CommonMethod.initBlock(inInfo,
Arrays.asList(DdynamicEnum.GROUP_CODE_BLOCK_ID),
new HashMap<String,Object>(){{
put(HPSC009.FIELD_COMPANY_CODE,companyCode);
put(HPSC009.FIELD_FACTORY_CODE,factoryCode);
put(HPSC009.FIELD_GROUP_TYPE,groupType);
}});
return inInfo;
}
public EiInfo queryGroupCode(EiInfo inInfo) {
final String companyCode = UserSessionUtils.getCompanyCode();
String factoryCode = inInfo.getString(HPSC009.FIELD_FACTORY_CODE);
String groupCode = inInfo.getString(HPSC009.FIELD_GROUP_CODE);
String groupType = inInfo.getString(HPSC009.FIELD_GROUP_TYPE);
CommonMethod.initBlock(inInfo,
Arrays.asList(DdynamicEnum.USER_ID_BLOCK_ID),
new HashMap<String,Object>(){{
put(HPSC009.FIELD_COMPANY_CODE,companyCode);
put(HPSC009.FIELD_FACTORY_CODE,factoryCode);
put(HPSC009.FIELD_GROUP_CODE,groupCode);
put(HPSC009.FIELD_GROUP_TYPE,groupType);
}});
return inInfo;
}
}
package com.baosight.hpjx.hp.sc.service;
import com.baosight.hpjx.aspect.annotation.OperationLogAnnotation;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.service.impl.ServiceBase;
/**
*
*/
public class ServiceHPSC097 extends ServiceBase {
/**
* 画面初始化.
*/
@OperationLogAnnotation(operModul = "附件上传",operType = "查询",operDesc = "初始化")
public EiInfo initLoad(EiInfo inInfo) {
return inInfo;
}
/**
* 附件上传.
*/
@OperationLogAnnotation(operModul = "附件上传",operType = "上传",operDesc = "附件上传")
public EiInfo form(EiInfo inInfo) {
return inInfo;
}
}
......@@ -209,6 +209,23 @@
</isNotEmpty>
</delete>
<update id="deleteFlag">
UPDATE ${hpjxSchema}.T_HPXS001
SET
DELETE_FLAG = #deleteFlag#, <!-- 是否删除0:否1.是 -->
UPDATED_BY = #updatedBy#, <!-- 修改人 -->
UPDATED_TIME = #updatedTime#, <!-- 修改人名称 -->
UPDATED_NAME = #updatedName# <!-- 修改时间 -->
WHERE
ID = #id#
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
</update>
<update id="update">
UPDATE ${hpjxSchema}.T_HPXS001
SET
......@@ -240,39 +257,97 @@
</update>
<select id="queryFactoryCode" parameterClass="java.util.HashMap" resultClass="java.util.HashMap">
SELECT DISTINCT
SELECT
FACTORY_CODE as "factoryCode",
FACTORY_NAME as "factoryName"
FROM ${hpjxSchema}.T_HPPZ013 WHERE 1=1
FROM ${hpjxSchema}.T_HPPZ013
WHERE 1=1
and length(FACTORY_CODE)>0
and length(FACTORY_NAME)>0
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="groupType">
GROUP_TYPE = #groupType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deleteFlag">
DELETE_FLAG = #deleteFlag#
</isNotEmpty>
GROUP BY FACTORY_CODE,FACTORY_NAME
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
ID asc
CREATED_TIME desc
</isEmpty>
</dynamic>
</select>
<select id="queryGroupCode" parameterClass="java.util.HashMap" resultClass="java.util.HashMap">
SELECT DISTINCT
GROUP_CODE as "groupCode",
GROUP_NAME as "groupName",
FACTORY_CODE AS factoryCode
FROM ${hpjxSchema}.T_HPPZ013 WHERE 1=1
SELECT
A.GROUP_CODE as "groupCode",
CONCAT('[',A.FACTORY_NAME,']',A.GROUP_NAME) as "groupName",
A.FACTORY_CODE AS factoryCode
FROM ${hpjxSchema}.T_HPPZ013 A
LEFT JOIN ${platSchema}.TXSOG01 B ON A.COMPANY_CODE = B.COMPANY_CODE AND A.GROUP_CODE = B.ORG_ENAME
WHERE 1=1
and length(A.FACTORY_CODE)>0
and length(A.FACTORY_NAME)>0
and length(A.GROUP_CODE)>0
and length(A.GROUP_NAME)>0
<isNotEmpty prepend=" AND " property="companyCode">
A.COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryCode">
A.FACTORY_CODE = #factoryCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deleteFlag">
A.DELETE_FLAG = #deleteFlag#
</isNotEmpty>
<isEmpty prepend=" AND " property="groupType">
A.GROUP_TYPE = 'prodGroup'
</isEmpty>
<isNotEmpty prepend=" AND " property="groupType">
A.GROUP_TYPE = #groupType#
</isNotEmpty>
GROUP BY A.GROUP_CODE,A.GROUP_NAME,A.FACTORY_CODE,A.FACTORY_NAME
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
A.FACTORY_CODE,B.SORT_INDEX ASC
</isEmpty>
</dynamic>
</select>
<select id="queryUserId" parameterClass="java.util.HashMap" resultClass="java.util.HashMap">
SELECT
USER_ID as "userId",
CONCAT('[',FACTORY_NAME,' - ',GROUP_NAME,']',USER_NAME) as "userName",
FACTORY_CODE AS factoryCode,
GROUP_CODE as "groupCode"
FROM ${hpjxSchema}.T_HPPZ013
WHERE 1=1
and STATUS = '1'
and length(FACTORY_CODE)>0
and length(FACTORY_NAME)>0
and length(GROUP_CODE)>0
and length(GROUP_NAME)>0
and length(USER_ID)>0
and length(USER_NAME)>0
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryCode">
FACTORY_CODE = #factoryCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="groupCode">
GROUP_CODE = #groupCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deleteFlag">
DELETE_FLAG = #deleteFlag#
</isNotEmpty>
......@@ -282,24 +357,72 @@
<isNotEmpty prepend=" AND " property="groupType">
GROUP_TYPE = #groupType#
</isNotEmpty>
GROUP BY USER_ID,USER_NAME,FACTORY_CODE,FACTORY_NAME,GROUP_CODE,GROUP_NAME
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
ID asc
CREATED_TIME desc
</isEmpty>
</dynamic>
</select>
<select id="queryUserId" parameterClass="java.util.HashMap" resultClass="java.util.HashMap">
SELECT DISTINCT
<select id="queryGroupName" parameterClass="java.util.HashMap" resultClass="java.util.HashMap">
SELECT
A.GROUP_CODE as "groupCode",
A.GROUP_NAME as "groupName",
A.FACTORY_CODE AS factoryCode
FROM ${hpjxSchema}.T_HPPZ013 A
LEFT JOIN ${platSchema}.TXSOG01 B ON A.COMPANY_CODE = B.COMPANY_CODE AND A.GROUP_CODE = B.ORG_ENAME
WHERE 1=1
and length(A.FACTORY_CODE)>0
and length(A.FACTORY_NAME)>0
and length(A.GROUP_CODE)>0
and length(A.GROUP_NAME)>0
<isNotEmpty prepend=" AND " property="companyCode">
A.COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryCode">
A.FACTORY_CODE = #factoryCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deleteFlag">
A.DELETE_FLAG = #deleteFlag#
</isNotEmpty>
<isEmpty prepend=" AND " property="groupType">
A.GROUP_TYPE = 'prodGroup'
</isEmpty>
<isNotEmpty prepend=" AND " property="groupType">
A.GROUP_TYPE = #groupType#
</isNotEmpty>
GROUP BY A.GROUP_CODE,A.GROUP_NAME,A.FACTORY_CODE
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
A.FACTORY_CODE,B.SORT_INDEX ASC
</isEmpty>
</dynamic>
</select>
<select id="queryUserName" parameterClass="java.util.HashMap" resultClass="java.util.HashMap">
SELECT
USER_ID as "userId",
USER_NAME as "userName",
FACTORY_CODE AS factoryCode,
GROUP_CODE as "groupCode"
FROM ${hpjxSchema}.T_HPPZ013 WHERE 1=1 and STATUS = '1'
FROM ${hpjxSchema}.T_HPPZ013
WHERE 1=1
and STATUS = '1'
and length(FACTORY_CODE)>0
and length(FACTORY_NAME)>0
and length(GROUP_CODE)>0
and length(GROUP_NAME)>0
and length(USER_ID)>0
and length(USER_NAME)>0
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
......@@ -318,12 +441,13 @@
<isNotEmpty prepend=" AND " property="groupType">
GROUP_TYPE = #groupType#
</isNotEmpty>
GROUP BY USER_ID,USER_NAME,FACTORY_CODE,GROUP_CODE
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
ID asc
CREATED_TIME desc
</isEmpty>
</dynamic>
......
<?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-03-21 11:14:28
Version : 1.0
schema : hpjx
tableName : T_HPXS002
ID BIGINT NOT NULL primarykey,
COMPANY_CODE VARCHAR,
DEP_CODE VARCHAR,
REGISTER_DATE VARCHAR,
FACTORY_CODE VARCHAR NOT NULL,
GROUP_CODE VARCHAR,
USER_ID VARCHAR,
GROUP_TYPE VARCHAR,
CONTENT VARCHAR,
REMARK VARCHAR,
DELETE_FLAG TINYINT,
CREATED_BY VARCHAR,
CREATED_NAME VARCHAR,
CREATED_TIME VARCHAR,
UPDATED_BY VARCHAR,
UPDATED_TIME VARCHAR,
UPDATED_NAME VARCHAR
-->
<sqlMap namespace="HPSC009">
<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="registerDate">
REGISTER_DATE = #registerDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryCode">
FACTORY_CODE = #factoryCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="groupCode">
GROUP_CODE = #groupCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="userId">
USER_ID = #userId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="groupType">
GROUP_TYPE = #groupType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="content">
CONTENT = #content#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="remark">
REMARK = #remark#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deleteFlag">
DELETE_FLAG = #deleteFlag#
</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="updatedTime">
UPDATED_TIME = #updatedTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedName">
UPDATED_NAME = #updatedName#
</isNotEmpty>
</sql>
<select id="query" parameterClass="java.util.HashMap"
resultClass="com.baosight.hpjx.hp.sc.domain.HPSC009">
SELECT
ID as "id", <!-- ID -->
COMPANY_CODE as "companyCode", <!-- 企业编码 预留 -->
DEP_CODE as "depCode", <!-- 部门编码 预留 -->
REGISTER_DATE as "registerDate", <!-- 登记日期 -->
FACTORY_CODE as "factoryCode", <!-- 工厂代码 -->
GROUP_CODE as "groupCode", <!-- 下料组代码 -->
USER_ID as "userId", <!-- 员工代码 -->
GROUP_TYPE as "groupType", <!-- 下料类型 -->
CONTENT as "content", <!-- 报工内容 -->
REMARK as "remark", <!-- 备注 -->
DELETE_FLAG as "deleteFlag", <!-- 是否删除0:否1.是 -->
CREATED_BY as "createdBy", <!-- 创建人 -->
CREATED_NAME as "createdName", <!-- 创建人名称 -->
CREATED_TIME as "createdTime", <!-- 创建时间 -->
UPDATED_BY as "updatedBy", <!-- 修改人 -->
UPDATED_TIME as "updatedTime", <!-- 修改人名称 -->
UPDATED_NAME as "updatedName" <!-- 修改时间 -->
FROM ${hpjxSchema}.T_HPXS002 WHERE 1=1
<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 ${hpjxSchema}.T_HPXS002 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="registerDate">
REGISTER_DATE = #registerDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryCode">
FACTORY_CODE = #factoryCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="groupCode">
GROUP_CODE = #groupCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="userId">
USER_ID = #userId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="groupType">
GROUP_TYPE = #groupType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="content">
CONTENT = #content#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="remark">
REMARK = #remark#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deleteFlag">
DELETE_FLAG = #deleteFlag#
</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="updatedTime">
UPDATED_TIME = #updatedTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedName">
UPDATED_NAME = #updatedName#
</isNotEmpty>
-->
<insert id="insert">
INSERT INTO ${hpjxSchema}.T_HPXS002 (ID, <!-- ID -->
COMPANY_CODE, <!-- 企业编码 预留 -->
DEP_CODE, <!-- 部门编码 预留 -->
REGISTER_DATE, <!-- 登记日期 -->
FACTORY_CODE, <!-- 工厂代码 -->
GROUP_CODE, <!-- 下料组代码 -->
USER_ID, <!-- 员工代码 -->
GROUP_TYPE, <!-- 下料类型 -->
CONTENT, <!-- 报工内容 -->
REMARK, <!-- 备注 -->
DELETE_FLAG, <!-- 是否删除0:否1.是 -->
CREATED_BY, <!-- 创建人 -->
CREATED_NAME, <!-- 创建人名称 -->
CREATED_TIME, <!-- 创建时间 -->
UPDATED_BY, <!-- 修改人 -->
UPDATED_TIME, <!-- 修改人名称 -->
UPDATED_NAME <!-- 修改时间 -->
)
VALUES (#id#, #companyCode#, #depCode#, #registerDate#, #factoryCode#, #groupCode#, #userId#, #groupType#, #content#, #remark#, #deleteFlag#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedTime#, #updatedName#)
</insert>
<delete id="delete">
DELETE FROM ${hpjxSchema}.T_HPXS002 WHERE
ID = #id#
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
</delete>
<!--逻辑删除-->
<update id="deleteFlag">
UPDATE ${hpjxSchema}.T_HPXS002
SET
DELETE_FLAG = #deleteFlag#, <!-- 是否删除0:否1.是 -->
UPDATED_BY = #updatedBy#, <!-- 修改人 -->
UPDATED_TIME = #updatedTime#, <!-- 修改人名称 -->
UPDATED_NAME = #updatedName# <!-- 修改时间 -->
WHERE
ID = #id#
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
</update>
<update id="update">
UPDATE ${hpjxSchema}.T_HPXS002
SET
COMPANY_CODE = #companyCode#, <!-- 企业编码 预留 -->
DEP_CODE = #depCode#, <!-- 部门编码 预留 -->
REGISTER_DATE = #registerDate#, <!-- 登记日期 -->
FACTORY_CODE = #factoryCode#, <!-- 工厂代码 -->
GROUP_CODE = #groupCode#, <!-- 下料组代码 -->
USER_ID = #userId#, <!-- 员工代码 -->
GROUP_TYPE = #groupType#, <!-- 下料类型 -->
CONTENT = #content#, <!-- 报工内容 -->
REMARK = #remark#, <!-- 备注 -->
DELETE_FLAG = #deleteFlag#, <!-- 是否删除0:否1.是 -->
CREATED_BY = #createdBy#, <!-- 创建人 -->
CREATED_NAME = #createdName#, <!-- 创建人名称 -->
CREATED_TIME = #createdTime#, <!-- 创建时间 -->
UPDATED_BY = #updatedBy#, <!-- 修改人 -->
UPDATED_TIME = #updatedTime#, <!-- 修改人名称 -->
UPDATED_NAME = #updatedName# <!-- 修改时间 -->
WHERE
ID = #id#
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
</update>
</sqlMap>
package com.baosight.hpjx.hp.xs.service;
import com.baosight.hpjx.aspect.annotation.OperationLogAnnotation;
import com.baosight.hpjx.core.constant.CommonConstant;
import com.baosight.hpjx.core.dao.DaoBase;
import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.core.security.UserSessionUtils;
import com.baosight.hpjx.hp.ds.domain.HPDS002;
import com.baosight.hpjx.hp.sc.domain.HPSC002A;
import com.baosight.hpjx.hp.xs.domain.HPXS003;
import com.baosight.hpjx.util.ErrorCodeUtils;
import com.baosight.hpjx.util.FileUtils;
import com.baosight.hpjx.util.LogUtils;
import com.baosight.hpjx.util.contants.ACConstants;
import com.baosight.iplat4j.core.ProjectInfo;
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.core.service.soa.XServiceManager;
import com.baosight.iplat4j.core.util.StringUtils;
import com.baosight.iplat4j.core.web.threadlocal.UserSession;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.jsp.PageContext;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @author LiuYang
* @version 1.0 2024/3/25
*/
public class ServiceHPXS003 extends ServiceEPBase {
@Override
public EiInfo initLoad(EiInfo inInfo) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HPXS003.FIELD_DELETE_FLAG,CommonConstant.YesNo.NO_0);
final EiInfo outEiInfo = super.query(inInfo, HPXS003.QUERY, new HPXS003());
//outInfo.getBlock(EiConstant.resultBlock).getRows().clear();
return outEiInfo;
}
@Override
public EiInfo query(EiInfo inInfo) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HPXS003.FIELD_DELETE_FLAG,CommonConstant.YesNo.NO_0);
return super.query(inInfo, HPXS003.QUERY,new HPXS003());
}
/**
* 查询最新企业log附件
* @param inInfo
* @return
*/
public EiInfo queryMaxLog(EiInfo inInfo) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HPXS003.FIELD_DELETE_FLAG,CommonConstant.YesNo.NO_0);
EiInfo eiInfo = super.query(inInfo, HPXS003.QUERY,new HPXS003());
String projectEnv = ProjectInfo.getProjectEnv();
eiInfo.setCell(EiConstant.resultBlock,ACConstants.ROW_CODE_0,"projectEnv",projectEnv);
return eiInfo;
}
@OperationLogAnnotation(operModul = "企业log上传管理", operType = "删除", operDesc = "删除6个月之前的历史数据")
@Override
public EiInfo delete(EiInfo inInfo) {
int i = 0;
try {
HPXS003 hpxs003 = new HPXS003();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
for (i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
hpxs003.fromMap(map);
hpxs003.setDeleteFlag(CommonConstant.YesNo.YES_1);
delectDoc(eiBlock.getCellStr(i,HPXS003.FIELD_DIR_ID));
DaoUtils.update(HPXS003.DELETE_FLAG, hpxs003.toMap());
}
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 = "企业log上传管理", operType = "修改", operDesc = "修改log操作")
@Override
public EiInfo update(EiInfo inInfo) {
int i = 0;
try {
HPXS003 hpxs003 = new HPXS003();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
for (i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
hpxs003.fromMap(map);
hpxs003.setDeleteFlag(CommonConstant.YesNo.NO_0);
DaoUtils.update(HPXS003.UPDATE, hpxs003);
}
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;
}
@OperationLogAnnotation(operModul = "企业log上传管理", operType = "新增", operDesc = "新增log操作")
@Override
public EiInfo insert(EiInfo inInfo) {
int i = 0;
try {
HPXS003 hpxs003 = new HPXS003();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
String userName;
try {
userName = UserSession.getLoginCName();
} catch (Exception e) {
userName = "System";
}
for (i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
hpxs003.fromMap(map);
hpxs003.setDeleteFlag(CommonConstant.YesNo.NO_0);
hpxs003.setCompanyName(userName);
DaoUtils.insert(HPXS003.INSERT, hpxs003);
}
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsgByKey("ep.1000", new String[]{String.valueOf(i), I18nMessages.getText("label.insert", "新增")});
} catch (PlatException e) {
e.printStackTrace();
inInfo.setStatus(EiConstant.STATUS_FAILURE);
ErrorCodeUtils.handleInsertException(inInfo,i,e);
logError("新增失败", e.getMessage());
return inInfo;
}
return inInfo;
}
/**
* 删除附件文件
* @param docId 文件ID
*/
@OperationLogAnnotation(operModul = "企业log上传管理",operType = "删除",operDesc = "删除附件文件")
public void delectDoc(String docId){
Map<String,Object> map = new HashMap<>();
map.put("docId",docId);
List<HPDS002> list = this.dao.query("HPXS003.query",map);
if (list.size() > 0) {
for (HPDS002 hpds002: list) {
String realPath = hpds002.getRealPath();
// 项目环境
String projectEnv = ProjectInfo.getProjectEnv();
if (projectEnv.equals(CommonConstant.projectEnv.RUN)) {
EiInfo queryInfo = new EiInfo();
queryInfo.set(HPSC002A.FIELD_DOC_ID,hpds002.getDocId());
//获取文档信息
queryInfo.set(EiConstant.serviceId,"S_EU_0102");
EiInfo docInfo = XServiceManager.call(queryInfo);
//数据库
Map docInfoMap = docInfo.getMap("docMap");
if (docInfoMap.size() > 0) {
EiInfo eiInfo = new EiInfo();
eiInfo.set("data",docInfoMap.get("url")+"-"+0);
eiInfo.set(EiConstant.serviceId,"S_EU_0105");
//调用接口
EiInfo outInfo = XServiceManager.call(eiInfo);
if(outInfo.getStatus() == EiConstant.STATUS_FAILURE){
LogUtils.setDetailMsg(outInfo, new Throwable(), "查询部件类型失败");
outInfo.setMsg("失败");
}
}
}else {
FileUtils.deleteFile(realPath);
}
}
this.dao.delete(HPDS002.DELETE,map);
}
}
}
package com.baosight.hpjx.hp.xs.service;
import com.baosight.hpjx.aspect.annotation.OperationLogAnnotation;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
/**
* @author LiuYang
* @version 1.0 2024/3/25
*/
public class ServiceHPXS099 extends ServiceEPBase {
/**
* 画面初始化.
*/
@OperationLogAnnotation(operModul = "附件上传",operType = "查询",operDesc = "初始化")
@Override
public EiInfo initLoad(EiInfo inInfo) {
return inInfo;
}
/**
* 附件上传.
*/
@OperationLogAnnotation(operModul = "附件上传",operType = "上传",operDesc = "附件上传")
public EiInfo form(EiInfo 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-03-25 15:58:56
Version : 1.0
schema : hpjx
tableName : T_HPXS003
ID BIGINT NOT NULL primarykey,
COMPANY_CODE VARCHAR,
DEP_CODE VARCHAR,
DOC_ID VARCHAR NOT NULL,
DIR_ID VARCHAR,
DOC_NAME VARCHAR,
CHG_NAME VARCHAR,
DOC_SIZE DECIMAL,
DOC_TAG VARCHAR,
DELETE_FLAG TINYINT,
CREATED_BY VARCHAR,
CREATED_NAME VARCHAR,
CREATED_TIME VARCHAR,
UPDATED_BY VARCHAR,
UPDATED_TIME VARCHAR,
UPDATED_NAME VARCHAR
-->
<sqlMap namespace="HPXS003">
<sql id="authCondition">
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE=#companyCode#
</isNotEmpty>
<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="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="docId">
DOC_ID = #docId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="dirId">
DIR_ID = #dirId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="docName">
DOC_NAME = #docName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="chgName">
CHG_NAME = #chgName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="docSize">
DOC_SIZE = #docSize#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="docTag">
DOC_TAG = #docTag#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="realPath">
REAL_PATH = #realPath#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deleteFlag">
DELETE_FLAG = #deleteFlag#
</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="updatedTime">
UPDATED_TIME = #updatedTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedName">
UPDATED_NAME = #updatedName#
</isNotEmpty>
</sql>
<select id="query" parameterClass="java.util.HashMap"
resultClass="com.baosight.hpjx.hp.xs.domain.HPXS003">
SELECT
ID as "id", <!-- ID -->
COMPANY_CODE as "companyCode", <!-- 企业编码 预留 -->
COMPANY_NAME as "companyName", <!-- 企业编码 预留 -->
DEP_CODE as "depCode", <!-- 部门编码 预留 -->
DOC_ID as "docId", <!-- 文件标识 -->
DIR_ID as "dirId", <!-- 目录标识 -->
DOC_NAME as "docName", <!-- 文件名 -->
CHG_NAME as "chgName", <!-- 物料文件名 -->
DOC_SIZE as "docSize", <!-- 文件大小 -->
DOC_TAG as "docTag", <!-- 文件标签 -->
REAL_PATH as "realPath", <!-- 物理路径 -->
DELETE_FLAG as "deleteFlag", <!-- 是否删除0:否1.是 -->
CREATED_BY as "createdBy", <!-- 创建人 -->
CREATED_NAME as "createdName", <!-- 创建人名称 -->
CREATED_TIME as "createdTime", <!-- 创建时间 -->
UPDATED_BY as "updatedBy", <!-- 修改人 -->
UPDATED_TIME as "updatedTime", <!-- 修改人名称 -->
UPDATED_NAME as "updatedName" <!-- 修改时间 -->
FROM ${hpjxSchema}.T_HPXS003 WHERE 1=1
<include refid="condition" />
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
CREATED_TIME DESC
</isEmpty>
</dynamic>
</select>
<select id="queryMax" parameterClass="java.util.HashMap"
resultClass="com.baosight.hpjx.hp.xs.domain.HPXS003">
SELECT
ID as "id", <!-- ID -->
COMPANY_CODE as "companyCode", <!-- 企业编码 预留 -->
COMPANY_NAME as "companyName", <!-- 企业编码 预留 -->
DEP_CODE as "depCode", <!-- 部门编码 预留 -->
DOC_ID as "docId", <!-- 文件标识 -->
DIR_ID as "dirId", <!-- 目录标识 -->
DOC_NAME as "docName", <!-- 文件名 -->
CHG_NAME as "chgName", <!-- 物料文件名 -->
DOC_SIZE as "docSize", <!-- 文件大小 -->
DOC_TAG as "docTag", <!-- 文件标签 -->
REAL_PATH as "realPath", <!-- 物理路径 -->
DELETE_FLAG as "deleteFlag", <!-- 是否删除0:否1.是 -->
CREATED_BY as "createdBy", <!-- 创建人 -->
CREATED_NAME as "createdName", <!-- 创建人名称 -->
CREATED_TIME as "createdTime", <!-- 创建时间 -->
UPDATED_BY as "updatedBy", <!-- 修改人 -->
UPDATED_TIME as "updatedTime", <!-- 修改人名称 -->
UPDATED_NAME as "updatedName" <!-- 修改时间 -->
FROM ${hpjxSchema}.T_HPXS003 WHERE 1=1 AND CREATED_TIME = (SELECT MAX(CREATED_TIME) FROM ${hpjxSchema}.T_HPXS003 WHERE DELETE_FLAG = '0')
<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 ${hpjxSchema}.T_HPXS003 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="docId">
DOC_ID = #docId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="dirId">
DIR_ID = #dirId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="docName">
DOC_NAME = #docName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="chgName">
CHG_NAME = #chgName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="docSize">
DOC_SIZE = #docSize#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="docTag">
DOC_TAG = #docTag#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deleteFlag">
DELETE_FLAG = #deleteFlag#
</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="updatedTime">
UPDATED_TIME = #updatedTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedName">
UPDATED_NAME = #updatedName#
</isNotEmpty>
-->
<insert id="insert">
INSERT INTO ${hpjxSchema}.T_HPXS003 (ID, <!-- ID -->
COMPANY_CODE, <!-- 企业编码 预留 -->
COMPANY_NAME, <!-- 企业编码 预留 -->
DEP_CODE, <!-- 部门编码 预留 -->
DOC_ID, <!-- 文件标识 -->
DIR_ID, <!-- 目录标识 -->
DOC_NAME, <!-- 文件名 -->
CHG_NAME, <!-- 物料文件名 -->
DOC_SIZE, <!-- 文件大小 -->
DOC_TAG, <!-- 文件标签 -->
REAL_PATH, <!-- 物理路径 -->
DELETE_FLAG, <!-- 是否删除0:否1.是 -->
CREATED_BY, <!-- 创建人 -->
CREATED_NAME, <!-- 创建人名称 -->
CREATED_TIME, <!-- 创建时间 -->
UPDATED_BY, <!-- 修改人 -->
UPDATED_TIME, <!-- 修改人名称 -->
UPDATED_NAME <!-- 修改时间 -->
)
VALUES (#id#, #companyCode#, #companyName#, #depCode#, #docId#, #dirId#, #docName#, #chgName#, #docSize#, #docTag#, #realPath#,
#deleteFlag#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedTime#, #updatedName#)
</insert>
<delete id="delete">
DELETE FROM ${hpjxSchema}.T_HPXS003 WHERE
ID = #id#
</delete>
<!--逻辑删除-->
<update id="deleteFlag">
UPDATE ${hpjxSchema}.T_HPXS003
SET
DELETE_FLAG = #deleteFlag#, <!-- 是否删除0:否1.是 -->
UPDATED_BY = #updatedBy#, <!-- 修改人 -->
UPDATED_TIME = #updatedTime#, <!-- 修改人名称 -->
UPDATED_NAME = #updatedName# <!-- 修改时间 -->
WHERE
ID = #id#
<include refid="authCondition" />
</update>
<update id="update">
UPDATE ${hpjxSchema}.T_HPXS003
SET
COMPANY_CODE = #companyCode#, <!-- 企业编码 预留 -->
DEP_CODE = #depCode#, <!-- 部门编码 预留 -->
DOC_ID = #docId#, <!-- 文件标识 -->
DIR_ID = #dirId#, <!-- 目录标识 -->
DOC_NAME = #docName#, <!-- 文件名 -->
CHG_NAME = #chgName#, <!-- 物料文件名 -->
DOC_SIZE = #docSize#, <!-- 文件大小 -->
DOC_TAG = #docTag#, <!-- 文件标签 -->
REAL_PATH = #realPath#,
DELETE_FLAG = #deleteFlag#, <!-- 是否删除0:否1.是 -->
CREATED_BY = #createdBy#, <!-- 创建人 -->
CREATED_NAME = #createdName#, <!-- 创建人名称 -->
CREATED_TIME = #createdTime#, <!-- 创建时间 -->
UPDATED_BY = #updatedBy#, <!-- 修改人 -->
UPDATED_TIME = #updatedTime#, <!-- 修改人名称 -->
UPDATED_NAME = #updatedName# <!-- 修改时间 -->
WHERE
ID = #id#
<include refid="authCondition" />
</update>
</sqlMap>
......@@ -209,7 +209,7 @@
</select>
<!-- 查询组织信息 -->
<select id="queryTedcm01" resultClass="com.baosight.iplat4j.common.ed.domain.TEDCM01">
<select id="queryTedcm01" resultClass="java.util.HashMap">
SELECT
ITEM_CODE AS "itemCode",
ITEM_CNAME AS "itemCname"
......
......@@ -3,6 +3,9 @@ package com.baosight.hpjx.util;
import com.baosight.hpjx.common.ErrorCodeEnum;
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.util.ExceptionUtil;
/**
* ErrorCodeUtils
......@@ -99,6 +102,25 @@ public class ErrorCodeUtils {
return detail;
}
public static void handleDeleteException(EiInfo inInfo, int i, Exception ex) {
inInfo.setMsgByKey("ep.0002", new String[]{String.valueOf(i + 1), I18nMessages.getText("label.delete", "删除"), ExceptionUtil.getRootCauseMessage(ex)});
inInfo.setDetailMsg(ex.toString());
throw new PlatException("E_Plat_DeleteError", ex, inInfo);
}
public static void handleUpdateException(EiInfo inInfo, int i, Exception ex) {
inInfo.setMsgByKey("ep.0002", new String[]{String.valueOf(i + 1), I18nMessages.getText("label.update", "修改"), ExceptionUtil.getRootCauseMessage(ex)});
inInfo.setDetailMsg(ex.toString());
throw new PlatException("E_Plat_UpdateError", ex, inInfo);
}
public static void handleInsertException(EiInfo inInfo, int i, Exception ex) {
inInfo.setMsgByKey("ep.0002", new String[]{String.valueOf(i + 1), I18nMessages.getText("label.insert", "新增"), ExceptionUtil.getRootCauseMessage(ex)});
inInfo.setDetailMsg(ex.toString());
throw new PlatException("E_Plat_InsertError", ex, inInfo);
}
private static final String SQL_ERROR_WORD1 = "SQLCODE=";
private static final String SQL_ERROR_WORD2 = "Error Code:";
}
\ No newline at end of file
......@@ -2443,6 +2443,21 @@ $(function () {
}
});
}
if (loginName !== "admin"){
var info = new EiInfo()
info.set("inqu_status-0-companyCode",loginName)
EiCommunicator.send("HPPZ009", "query", info, {
onSuccess: function (ei) {//返回结果集
if (ei.blocks.result !== undefined){
let results = ei.getBlock("result").getMappedRows()
$("#sidebar img").attr("src",downloadHref(results[0].docIdPc),results[0].projectEnv);
}
}, onFail: function (ei) {
}
}, {async: false});
}
})
function timedisplay() {
......@@ -2518,4 +2533,15 @@ function changepassword(formEname,formCname){
});
}
function downloadHref(docId,projectEnv) {
// S3地址有外网
// return IPLATUI.CONTEXT_PATH + ("run" == projectEnv ? ('/docFileDownload/' + docId)
// : ('/EU/DM/EUDM06.jsp?docId=' + docId));
// S3地址无外网
return IPLATUI.CONTEXT_PATH + ("run" == projectEnv ? ('/file/download/' + docId)
: ('/EU/DM/EUDM06.jsp?docId=' + docId));
}
......@@ -558,7 +558,6 @@
var theme = "${theme}";
</script>
<style>
.icon-badge {
......
......@@ -19,7 +19,7 @@ spring.servlet.multipart.file-size-threshold =0
componentEname=hpjx
projectName=hpjx
moduleName=ep
projectEnv=dev
projectEnv=run
platSchema=iplat
eplatSchema=EPLAT
lowcodedbSchema=lowcodedb
......@@ -34,9 +34,9 @@ enterpriseName=\u6B66\u6C49\u5B9D\u4FE1\u5927\u6570\u636E\u4E8B\u4E1A\u90E8
datasource.type=dbcp
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.24.1.94:3306/iplat?useSSL=false&useUnicode=true&characterEncoding=utf-8
jdbc.username=root
jdbc.password=fnvu~aKs9LTDYUxe
jdbc.url=jdbc:mysql://10.135.13.5:30005/iplat?useSSL=false&useUnicode=true&characterEncoding=utf-8
jdbc.username=dbprod32
jdbc.password=t9UrgcELp=
#jdbc.password=123456
jdbc.maxActive=20
jdbc.validationQuery=SELECT 1 FROM ${platSchema}.TEDFA00
......
......@@ -26,12 +26,12 @@ org.quartz.jobStore.isClustered = true
#\uFFFD\u02F4\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u077F\uFFFD\u05BE\u00FB\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u077F\uFFFD\uFFFD\uFFFD\u0635\uFFFD\uFFFD\uFFFD\u03E2
org.quartz.jobStore.clusterCheckinInterval = 20000
org.quartz.dataSource.appDS.driver = com.mysql.jdbc.Driver
org.quartz.dataSource.appDS.URL = jdbc:mysql://10.24.1.94:3306/iplat?useSSL=false&useUnicode=true&characterEncoding=utf-8
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 = root
org.quartz.dataSource.appDS.user = dbprod32
#org.quartz.dataSource.appDS.password =root
org.quartz.dataSource.appDS.password =fnvu~aKs9LTDYUxe
org.quartz.dataSource.appDS.password =t9UrgcELp=
org.quartz.dataSource.appDS.maxConnections = 30
#\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u05B1\uFFFD\uFFFD\uFFFD\uFFFD\u05BE\uFFFD\uFFFD\u00BC\uFFFD\uFFFD\uFFFD
......
......@@ -5,20 +5,56 @@ $(function () {
pageSizes: [10, 20, 50, 70, 100],
},
onSuccess: function (e) {
if(e.eiInfo.extAttr.methodName == 'save'
||e.eiInfo.extAttr.methodName == 'delete' ){
if(e.eiInfo.extAttr.methodName == 'save'||e.eiInfo.extAttr.methodName == 'delete' ){
query();
}
},
onAdd: function (e) {
e.preventDefault()
$("#type").val("update")
$("#companyName").val();
$("#loginPrefix").val();
$("#validFlag").val();
$("#PCfileDocId").val();
$("#APPfileDocId").val();
$("#remark").val();
$("#id").val();
$("#companyCode").val();
addCompany($("#insertGroup"))
},
onSave: function (e) {
// 阻止后台保存请求,使用自定义保存
e.preventDefault();
save();
//save();
},
onDelete: function (e) {
// 阻止后台删除请求,使用自定义删除
e.preventDefault();
deleteFunc();
},
/**
*
* @param e
* e.sender kendoGridresultGrid
* e.model kendo.data.Model
* e.row
* e.tr tr, jquery
*/
onRowClick: function (e) {
$("#type").val("update");
$("#companyCode").val(e.model.companyCode);
$("#companyName").val(e.model.companyName);
$("#loginPrefix").val(e.model.loginPrefix);
$("#validFlag").val(e.model.validFlag);
$("#PCfileDocId").val(e.model.docIdPc);
$("#APPfileDocId").val(e.model.docIdApp);
$("#remark").val(e.model.remark);
$("#id").val(e.model.id);
addCompany($("#insertGroup"))
/*WindowUtil({
"title": "",
"content": "<div class='kendo-del-message'>" + e.row + "</div>"
})*/
}
}
......@@ -26,10 +62,65 @@ $(function () {
$("#QUERY").on("click", query);
// 保存
$("#BTN_SAVE").on("click", save);
//$("#BTN_SAVE").on("click", save);
// 删除
$("#BTN_DELETE").on("click", deleteFunc);
IPLATUI.EFUpload = {
docIdApp: {
showFileList:false,
validation: {
allowedExtensions: [".jpg",".png",".gif"], //
maxFileSize: 900000,
minFileSize: 300
},
// 不支持格式提示信息
localization: {
invalidFileExtension: "文件格式不支持, 上传失败"
},
success: function(e) {
let docId = e.response.docId;
if (isBlank(docId)) {
return;
}
$("#APPfileDocId").val(docId);
NotificationUtil("附件上传成功");
//console.log($("#fileDocId").val())
//saveTemp(e);
/*try {
parent.JSColorbox.setValueCallback(e);
} catch (e){
}*/
},
},
docIdPc: {
showFileList:false,
validation: {
allowedExtensions: [".jpg",".png",".gif"], //
maxFileSize: 900000,
minFileSize: 300
},
// 不支持格式提示信息
localization: {
invalidFileExtension: "文件格式不支持, 上传失败"
},
success: function(e) {
let docId = e.response.docId;
if (isBlank(docId)) {
return;
}
$("#PCfileDocId").val(docId);
NotificationUtil("附件上传成功");
//console.log($("#fileDocId").val())
//saveTemp(e);
/*try {
parent.JSColorbox.setValueCallback(e);
} catch (e){
}*/
},
}
};
});
/**
......@@ -45,23 +136,83 @@ $(window).load(function () {
*/
let query = function () {
resultGrid.dataSource.page(1);
}
};
let save = function (){
var btnNode = $(this);
btnNode.attr("disabled", true);
var ei = new EiInfo();
let type = $("#type").val();
if (type === "update"){
ei.set("result-0-companyCode",$("#companyCode").val());
}
ei.set("result-0-companyName",$("#companyName").val());
ei.set("result-0-loginPrefix",$("#loginPrefix").val());
ei.set("result-0-validFlag",$("#validFlag").val());
ei.set("result-0-docIdPc",$("#PCfileDocId").val());
ei.set("result-0-docIdApp",$("#APPfileDocId").val());
ei.set("result-0-remark",$("#remark").val());
ei.set("result-0-id",$("#id").val());
// 调用请求 onSuccess 成功回掉函数
EiCommunicator.send("HPPZ009", "save", ei, {
onSuccess: function (ei) {
btnNode.attr("disabled", false);
$("#insertGroup").data("kendoWindow").close();
resultGrid.dataSource.page(1);
// onFail 表示失败回掉函数
}, onFail: function (ei) {
// 发生异常
btnNode.attr("disabled", false);
NotificationUtil(ei);
}
});
};
/**
* 保存
*/
let save = function () {
/*let save = function () {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
if (rows.length = 1) {
$("#type").val("update")
}
let result = new EiInfo();
let docId = e.response.docId;
let docName = e.response.docName;
let docSize = e.response.docSize;
let docTag = e.response.docTag;
let docUrl = e.response.docUrl;
result.set("result-0-docId",docId);
result.set("result-0-docName",docName);
result.set("result-0-docSize",docSize);
result.set("result-0-docTag",docTag);
result.set("result-0-realPath",docUrl);
EiCommunicator.send("HPXS003", "insert", result, {
onSuccess: function (ei) {
if (ei.getStatus() >= 0) {
if (ei.getStatus() == 0) {
NotificationUtil(ei, 'warning');
} else {
NotificationUtil(ei);
}
} else {
NotificationUtil(ei, "error");
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
resultGrid.dataSource.page(1);
},
onFail: function (ei) {
// 发生异常
NotificationUtil("执行失败,原因[" + ei + "]", "error");
}
}, {
async: false
});
/!*JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HPPZ009", "save", true);
}
});
}
});*!/
}*/
/**
* 删除
......@@ -78,3 +229,76 @@ let deleteFunc = function () {
}
});
}
/**
* 点击添加
*
* @param id
*/
function addCompany(id) {
let rows = resultGrid.getCheckedRows();
//打开弹窗
id.data("kendoWindow").open().center();
}
$("#update").click(function () {
var btnNode = $(this);
btnNode.attr("disabled", true);
// 创建 EiInfo
var ei = new EiInfo();
ei.setByNodeObject(document.body);
// 获取 数据
// 调用请求 onSuccess 成功回掉函数
EiCommunicator.send("HPPZ009", "update", ei, {
onSuccess: function (ei) {
btnNode.attr("disabled", false);
resultGrid.dataSource.page(1);
// onFail 表示失败回掉函数
}, onFail: function (ei) {
// 发生异常
btnNode.attr("disabled", false);
NotificationUtil(ei);
}
});
});
/**
* 附件上传回调
*
* @param e
*/
function addCompanyCallback(e) {
resultGrid.dataSource.page(1);
/*let result = new EiInfo();
let docId = e.response.docId;
let docName = e.response.docName;
let docSize = e.response.docSize;
let docTag = e.response.docTag;
let docUrl = e.response.docUrl;
result.set("result-0-docId",docId);
result.set("result-0-docName",docName);
result.set("result-0-docSize",docSize);
result.set("result-0-docTag",docTag);
result.set("result-0-realPath",docUrl);
EiCommunicator.send("HPXS003", "insert", result, {
onSuccess: function (ei) {
if (ei.getStatus() >= 0) {
if (ei.getStatus() == 0) {
NotificationUtil(ei, 'warning');
} else {
NotificationUtil(ei);
}
} else {
NotificationUtil(ei, "error");
}
resultGrid.dataSource.page(1);
},
onFail: function (ei) {
// 发生异常
NotificationUtil("执行失败,原因[" + ei + "]", "error");
}
}, {
async: false
});*/
}
......@@ -4,8 +4,7 @@
<%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<EF:EFPage title="企业管理">
<EF:EFPage title="企业管理">
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<EF:EFInput cname="企业编码:" ename="companyCode" blockId="inqu_status" row="0"/>
......@@ -16,6 +15,8 @@
<EF:EFRegion id="result" title="记录集">
<EF:EFGrid blockId="result" autoDraw="override" checkMode="row">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="docIdPc" cname="主键" hidden="true"/>
<EF:EFColumn ename="docIdApp" cname="主键" hidden="true"/>
<EF:EFColumn cname="企业编码" ename="companyCode" enable="false" width="120" align="center"/>
<EF:EFColumn cname="企业名称" ename="companyName" width="140" required="true"/>
<EF:EFColumn cname="登录前缀" ename="loginPrefix" width="100" align="center" readonly="true"/>
......@@ -33,4 +34,76 @@
<br/>
<span style='color: red;font-size: 13px;'>说明:新增企业时会同步新增企业管理员账户,账号和密码与企业编码相同</span>
</EF:EFRegion>
</EF:EFPage>
<EF:EFWindow id="insertGroup" top="100px" left="280px" width="38%" height="70%">
<form>
<div class="form-group row">
<label for="companyName" class="col-sm-2 col-form-label col-form-label-sm">企业名称</label>
<div class="col-sm-6">
<input type="text" class="form-control" id="companyName" required="required">
</div>
</div>
<div class="form-group row">
<label for="loginPrefix" class="col-sm-2 col-form-label col-form-label-sm">登录前缀</label>
<div class="col-sm-6">
<input type="text" class="form-control" id="loginPrefix">
</div>
</div>
<div class="form-group row">
<label for="validFlag" class="col-sm-2 col-form-label col-form-label-sm">是否启动</label>
<div class="col-sm-6">
<select class="form-control" id="validFlag">
<option value="1"></option>
<option value="0"></option>
</select>
</div>
</div>
<div class="form-group row">
<label for="docIdPc" class="col-sm-2 col-form-label">PClog上传</label>
<div class="col-sm-6">
<EF:EFUpload ename="docIdPc" cname="PC上传" docTag="hk_filePc" path="A"/>
<%--<input type="file" class="form-control" id="docIdPc">--%>
</div>
<input type="hidden" id="PCfileDocId" value="">
</div>
<div class="form-group row">
<label for="docIdApp" class="col-sm-2 col-form-label">APPlog上传</label>
<div class="col-sm-6">
<EF:EFUpload ename="docIdApp" cname="APP上传" docTag="hk_fileApp" path="A"/>
<%--<input type="file" class="form-control" accept="image/*" id="docIdApp">--%>
</div>
<input type="hidden" id="APPfileDocId" value="">
</div>
<div class="form-group row">
<label for="remark" class="col-sm-2 col-form-label col-form-label-sm">备注</label>
<div class="col-sm-6">
<input type="text" class="form-control" id="remark">
</div>
</div>
<input type="hidden" id="type" value="insert">
<input type="hidden" id="id" value="">
<input type="hidden" id="companyCode" value="">
<div class="form-group col-md-6 col-sm-6 col-sm-offset-9">
<button type="button" onclick="save()" class="btn btn-info">确认</button>
</div>
</form>
</EF:EFWindow>
<EF:EFWindow id="updateGroup" top="100px" left="280px" width="58%" height="80%">
<EF:EFRegion id="updateResult">
<EF:EFInput ename="companyName" colWidth="6" cname="企业名称"/>
<EF:EFInput ename="loginPrefix" colWidth="6" cname="登录前缀"/>
<EF:EFSelect ename="validFlag" cname="是否启动"
template="#=valueField#-#=textField#" valueTemplate="#=valueField#-#=textField#"
required="true" defaultValue="China"> <%--enable="false":不可下拉--%>
<EF:EFOptions blockId="made_country_block_id" textField="country_ch_name" valueField="country"/>
</EF:EFSelect>
<EF:EFUpload ename="uploadFilePc" cname="PC上传" docTag="hk_filePc" path="A"/>
<EF:EFUpload ename="uploadFileApp" cname="APP上传" docTag="hk_fileApp" path="A"/>
<EF:EFInput ename="remark" colWidth="6" cname="备注"/>
<EF:EFInput ename="PCfileDocId" cname="" hidden="true"/>
<EF:EFInput ename="APPfileDocId" cname="" hidden="true"/>
<EF:EFButton ename="update" cname="确认" layout="1" class="k-button"/>
</EF:EFRegion>
</EF:EFWindow>
</EF:EFPage>
......@@ -383,11 +383,30 @@ $(function () {
});
e.preventDefault();
} else {
openFileWindow.open();
//uploadFileWindow.open();
var parentId = IPLATUI.EFTree.materialTree.selectTreeNode.nodeId;
var parentPrdtName = IPLATUI.EFTree.materialTree.selectTreeNode.prdtName;
var projCode = IPLATUI.EFTree.materialTree.selectTreeNode.projCode;
var projName = IPLATUI.EFTree.materialTree.selectTreeNode.projName;
var lv = IPLATUI.EFTree.materialTree.selectTreeNode.lv;
JSColorbox.open({
href: "HPSC097?methodName=initLoad&inqu_status-0-id=route_001&inqu_status-0-parentId=" + parentId+"&inqu_status-0-projCode="+projCode+"&inqu_status-0-projName="+projName+"&inqu_status-0-parentPrdtName="+parentPrdtName,
title: "<div style='text-align: center;'>导入</div>",
width: "60%",
height: "50%",
callbackName: function () {
// 刷新列表
resultGrid.dataSource.page(1);
// 刷新树
updateTree();
// 关闭弹窗
JSColorbox.close();
}
});
}
}
});
IPLATUI.EFUpload = {
/* IPLATUI.EFUpload = {
fileUpload: {
showFileList: false,
upload: function (e) {
......@@ -399,10 +418,12 @@ $(function () {
var src;
var className;
if ("run" == projectEnv) {
src = e.response.docUrl + e.response.docType
//src = e.response.docUrl + e.response.docType
src = downloadHref(e.response.docId) + e.response.docType
className = e.response.groupId;
} else {
src = e.response.docUrl
//src = downloadHref(e.response.docId) + '.' + e.response.docUrl.split(".")[1];
className = e.response.docTag;
}
var parentId = IPLATUI.EFTree.materialTree.selectTreeNode.nodeId;
......@@ -442,13 +463,14 @@ $(function () {
IPLAT.NotificationUtil('导入失败!', "error");// 失败提示信息
}
}
}
}*/
$("#DOWNLOAD").on("click", function (e) {
var href = ctx + "\\HP\\template\\SC\\HPSC002_物料清单.xls";
window.location.href = href;
});
/**
* 生成模板
*/
......
......@@ -88,7 +88,7 @@
</div>
</div>
<%-- EEDM8010页面加载时,不会加载EEDM6000 (lazyload="true") --%>
<EF:EFWindow id="uploadFile" url="${ctx}/web/HPSC099" lazyload="true" refresh="true">
<%-- <EF:EFWindow id="uploadFile" url="${ctx}/web/HPSC099" lazyload="true" refresh="true">
</EF:EFWindow>
<EF:EFWindow id="openFile">
<EF:EFRegion id="upload" title="文件导入区">
......@@ -96,7 +96,15 @@
<EF:EFUpload ename="fileUpload" cname="导入" docTag="HPSC002" path="upload"/>
</EF:EFRegion>
</EF:EFWindow>
<EF:EFWindow id="openFile">
<EF:EFRegion id="upload" title="文件导入区">
<div id="button"></div>
<EF:EFInput cname="上传文件" blockId="inqu_status" ename="file" row="0" type="file" colWidth="3"/>
</EF:EFRegion>
</EF:EFWindow>--%>
<EF:EFWindow id="uploadFile" url="${ctx}/web/HPSC097" lazyload="true" refresh="true"/>
</EF:EFPage>
<script>
let ctx="${ctx}";
</script>
......
......@@ -365,12 +365,42 @@ function saveDetail(btn) {
if(flag) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
let reslu = JSUtils.submitGridsData("detail", "HPSC003", "updatePlanDetail", true);
console.log("修改保存:"+reslu);
//释放禁用按钮
btn.attr("disabled", false);
var info = new EiInfo();
info.addBlock(JSUtils.checkedRows2Block("detail"));
EiCommunicator.send("HPSC003", "updatePlanDetail", info, {
onSuccess: function (ei) {
if (ei.getStatus() >= 0) {
try {
console.log("回调查询:"+pageOffset)
query(pageOffset)
IPLAT.fillNode(document.getElementById(eiInfo.extAttr[EiConstant.EF_FORM_ENAME]),
ei
);
} catch (e) {
// TODO: handle exception
}
if (IPLAT.isAvailable("detail")) {
window['detailGrid'].setEiInfo(ei);
}
if (ei.getStatus() == 0) {
NotificationUtil(ei, 'warning');
} else {
NotificationUtil(ei);
}
} else {
NotificationUtil(ei, "error");
}
},
onFail: function (ei) {
// 发生异常
NotificationUtil("操作失败,原因[" + ei + "]", "error");
}
});
//let reslu = JSUtils.submitGridsData("detail", "HPSC003", "updatePlanDetail", true);
//释放禁用按钮
btn.attr("disabled", false);
}
});
}
......
......@@ -115,13 +115,13 @@ $(function () {
let filePath1 = item.filePath1;
let status = item.status;
let template = '';
if (filePath1) {
/* if (filePath1) {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="showUploadFile(' + filePath1 + ',\'WL\')" >物料附件清单</a>';
}
}*/
if (filePath1) {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="showUploadFile(' + filePath1 + ',\'XL\')" >下料附件清单</a>';
+ 'onclick="showUploadFile(' + item.id + ')" >下料附件清单</a>';
}
return template
}
......@@ -238,13 +238,12 @@ $(function () {
}
],
onSuccess: function (e) {
if(e.eiInfo.extAttr.methodName == 'update'
||e.eiInfo.extAttr.methodName == 'insert'
/* onSuccess: function (e) {
if(e.eiInfo.extAttr.methodName == 'save'
||e.eiInfo.extAttr.methodName == 'delete' ){
query();
queryDetail();
}
},
},*/
onSave: function (e) {
// 阻止默认请求,使用自定义保存
e.preventDefault();
......@@ -269,10 +268,34 @@ $(function () {
});
e.preventDefault();
} else {
openFileWindow.open();
//openFileWindow.open();
var productionOrderNo = rows[0].get('prodOrderNo');
var projCode = rows[0].get('projCode');
var projName = rows[0].get('projName');
JSColorbox.open({
href: "HPSC097?methodName=initLoad&inqu_status-0-id=route_002&inqu_status-0-productionOrderNo="+productionOrderNo+"&inqu_status-0-projCode="+projCode+"&inqu_status-0-projName="+projName,
title: "<div style='text-align: center;'>导入</div>",
width: "70%",
height: "70%",
callbackName: function () {
// 刷新列表
//resultGrid.dataSource.page(1);
var info = new EiInfo();
info.set("productionOrderNo",productionOrderNo);
EiCommunicator.send("HPSC006","queryDetail",info,{
onSuccess:function(ei){//返回结果集
detailGrid.setEiInfo(ei);
// 关闭弹窗
JSColorbox.close();
},onFail:function(ei){}
},{async:false});
}
});
}
});
IPLATUI.EFUpload = {
/* IPLATUI.EFUpload = {
fileUpload: {
showFileList: false,
upload: function (e) {
......@@ -323,7 +346,7 @@ $(function () {
IPLAT.NotificationUtil('导入失败!', "error");// 失败提示信息
}
}
}
}*/
$("#DOWNLOAD").on("click", function (e) {
var href = ctx + "\\HP\\template\\SC\\HPSC006_生产下料.xls";
......@@ -363,9 +386,9 @@ function reqDetails(projCode) {
height: "90%"
});
}
function showUploadFile(id,type) {
function showUploadFile(id) {
JSColorbox.open({
href: "HPSC002A?methodName=initLoad&inqu_status-0-bizType="+type+"&inqu_status-0-id=" + id,
href: "HPSC002A?methodName=initLoad&inqu_status-0-bizType=XL&inqu_status-0-id=" + id,
title: "<div style='text-align: center;'>附件清单</div>",
width: "80%",
height: "80%",
......@@ -381,26 +404,8 @@ function checkIn(id) {
callbackName: checkInCallback
});
}
checkInCallback = function () {
var block = detailGrid.getEiBlock();
var result = resultGrid.getCheckedRows()
if (rows.length < 1) {
message("请选择数据");
return;
}
if (block != null) {
block.setRows([]);
detailGrid.setEiBlock(block);
}
var info = new EiInfo()
var productionOrderNo = result[0]['prodOrderNo'];
info.set("productionOrderNo",productionOrderNo);
EiCommunicator.send("HPSC006","queryDetail",info,{
onSuccess:function(ei){//返回结果集
detailGrid.setEiInfo(ei);
},onFail:function(ei){}
},{async:false});
checkInCallback = function (e) {
detailGrid.setEiInfo(e);
}
let selectStock = function (id) {
JSColorbox.open({
......@@ -496,7 +501,7 @@ function saveFunc() {
if(flag) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGridsData("detail", "HPSC006", "insert", true,
JSUtils.submitGridsData("detail", "HPSC006", "save", true,
function (e) {
detailGrid.setEiInfo(e);
});
......
......@@ -28,6 +28,7 @@
<EF:EFGrid blockId="result" autoDraw="no" height="30vh" checkMode="row,single" >
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" width="100" enable="false" readonly="false"/>
<EF:EFColumn enable="false" ename="projCode" cname="项目号" />
<EF:EFColumn enable="false" ename="projName" cname="项目名称"/>
<EF:EFColumn enable="false" ename="prodOrderNo" cname="生产订单号"/>
......@@ -35,7 +36,7 @@
<EF:EFColumn enable="false" ename="partName" cname="零件名称"/>
<EF:EFColumn enable="false" ename="planCompletionDate" editType="date" dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']"
cname="计划完成日期"/>
<EF:EFColumn ename="operator" cname="操作" width="100" enable="false" readonly="false"/>
</EF:EFGrid>
</EF:EFRegion>
......
$(function () {
var factoryCodes = __eiInfo.getBlock("factory_code_block_id").getMappedRows();
var groupCodes = __eiInfo.getBlock("group_code_block_id").getMappedRows();
var userIds = __eiInfo.getBlock("user_id_block_id").getMappedRows();
var groupCodes = __eiInfo.getBlock("group_code1_block_id").getMappedRows();
var userIds = __eiInfo.getBlock("user_id1_block_id").getMappedRows();
var factoryCode = __eiInfo.getBlock("factory_code1_block_id").getMappedRows();
var groupName = __eiInfo.getBlock("group_name_block_id").getMappedRows();
var userName = __eiInfo.getBlock("user_name_block_id").getMappedRows();
$(".row").children().attr("class", "col-md-3");
......@@ -45,6 +48,9 @@ $(function () {
},{
field: "factoryCode",
title: "工厂",
filter: function (options) {
return factoryCode;
},
template: function (dataItem) {
for (let i = 0; i < factoryCodes.length; i++) {
if (factoryCodes[i]['valueField'] === dataItem['factoryCode']) {
......@@ -61,21 +67,21 @@ $(function () {
if(province) {
// 返回我们过滤后的数据集
/*return options.values[0][province];*/
return _.filter(options.values, function (item) {
return _.filter(groupCodes, function (item) {
return item["param1Field"]==province;
})
} else {
return [];
return groupCodes;
}
},
template: function (dataItem) {
for (let i = 0; i < groupCodes.length; i++) {
if (groupCodes[i]['valueField'] === dataItem['groupCode']) {
return groupCodes[i]['textField'];
for (let i = 0; i < groupName.length; i++) {
if (groupName[i]['valueField'] === dataItem['groupCode']) {
return groupName[i]['textField'];
}
}
return dataItem["groupCode"];
}
},
},{
field: "userId",
title: "员工",
......@@ -84,22 +90,21 @@ $(function () {
var groupCode = options.model['groupCode'];
if(province) {
// 返回我们过滤后的数据集
/*return options.values[0][province];*/
return _.filter(options.values, function (item) {
return _.filter(userIds, function (item) {
return item["param1Field"]==province && item["param2Field"]==groupCode;
})
} else {
return [];
return userIds;
}
},
template: function (dataItem) {
for (let i = 0; i < userIds.length; i++) {
if (userIds[i]['valueField'] === dataItem['userId']) {
return userIds[i]['textField'];
for (let i = 0; i < userName.length; i++) {
if (userName[i]['valueField'] === dataItem['userId']) {
return userName[i]['textField'];
}
}
return dataItem["userId"];
}
},
}],
loadComplete: function(grid) {
// 此 grid 对象
......@@ -108,12 +113,39 @@ $(function () {
// 判断父级节点是否发生变化
if (e.field == "factoryCode") {
loadChange(grid,e,"groupCode");
} else if (e.field == "groupCode") {
if (e.items[0].factoryCode.length===0){
loadChange(grid,e,"factoryCode");
}
else if (e.field == "groupCode") {
loadChange(grid,e,"userId");
}else if (e.field == "userId"){
if (e.items[0].groupCode.length===0){
loadChange(grid,e,"groupCode");
}
if (e.items[0].factoryCode.length===0){
loadChange(grid,e,"factoryCode");
}
}
});
},
afterEdit:function (e) {
if (e.field === "groupCode" && e.model["factoryCode"].length === 0){
for (let i = 0; i < groupName.length; i++) {
if (e.model[e.field] === groupName[i]["valueField"]){
e.model["factoryCode"]=groupName[i]["param1Field"]
break;
}
}
}else if (e.field === "userId" && e.model["groupCode"].length === 0){
for (let i = 0; i < userName.length; i++) {
if (e.model[e.field] === userName[i]["valueField"]){
//e.model["factoryCode"]=userName[i]["param1Field"]
e.model["groupCode"]=userName[i]["param2Field"]
break;
}
}
}
},
onAdd: function (e) {
//e.sender.dataSource.options.fields[4].values = factoryCode;
//e.sender.dataSource.options.fields[5].values = groupCode
......@@ -133,9 +165,7 @@ $(function () {
//saveResult(btnNode);
},
onSuccess: function (e) {
console.log("onSuccess:"+e)
if (e.eiInfo.extAttr.methodName == 'update'
|| e.eiInfo.extAttr.methodName == 'insert') {
if (e.eiInfo.extAttr.methodName == 'update' || e.eiInfo.extAttr.methodName == 'insert') {
query();
}
},
......@@ -163,6 +193,7 @@ $(function () {
var inInfo=new EiInfo();
var factoryCode=$("#inqu_status-0-factoryCode").val();
inInfo.set("factoryCode",factoryCode);
inInfo.set("groupType","prodGroup");
EiCommunicator.send("HPSC008", "queryFactoryCode", inInfo, {
onSuccess: function (ei) {
var input=$("#inqu_status-0-groupCode");
......@@ -186,6 +217,7 @@ $(function () {
inInfo.set("factoryCode",factoryCode);
var groupCode=$("#inqu_status-0-groupCode").val();
inInfo.set("groupCode",groupCode);
inInfo.set("groupType","prodGroup");
EiCommunicator.send("HPSC008", "queryGroupCode", inInfo, {
onSuccess: function (ei) {
var input=$("#inqu_status-0-userId");
......
......@@ -48,38 +48,38 @@
<EF:EFColumn ename="companyCode" cname="企业编码" hidden="true"/>
<EF:EFColumn ename="registerDate" cname="登记日期" width="160" align="center" editType="date" readonly="true"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true"/>
<EF:EFComboColumn ename="factoryCode" cname="工厂" blockName="factory_code1_block_id"
<EF:EFComboColumn ename="factoryCode" cname="工厂" blockName="factory_code_block_id"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" readonly="true" width="120" required="true"
align="center" filter="contains" sort="true">
</EF:EFComboColumn>
<EF:EFComboColumn ename="groupCode" cname="生产组" blockName="group_code1_block_id"
<EF:EFComboColumn ename="groupCode" cname="生产组" blockName="group_name_block_id"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" readonly="true" width="120" required="true"
align="center" filter="contains" sort="true">
</EF:EFComboColumn>
<EF:EFComboColumn ename="userId" cname="员工" blockName="user_id1_block_id"
<EF:EFComboColumn ename="userId" cname="员工" blockName="user_name_block_id"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" readonly="true" width="100" required="true"
maxLength="16" readonly="true" width="160" required="true"
align="center" filter="contains" sort="true">
</EF:EFComboColumn>
<EF:EFComboColumn ename="groupType" cname="生产类型"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" readonly="true" width="100" required="true"
maxLength="16" readonly="true" width="80" required="true"
align="center" filter="contains" sort="true">
<EF:EFCodeOption codeName="hpjx.hpjx.productionType" />
</EF:EFComboColumn>
<EF:EFColumn ename="prdtName" cname="产品" enable="true" width="160" align="center" required="true"/>
<EF:EFColumn ename="weight" cname="产量(T)" width="150" enable="true" format="{0:N3}" editType="text"
displayType="0.000" sort="true" align="right" readonly="true"
<EF:EFColumn ename="weight" cname="产量(T)" width="120" enable="true" format="{0:N3}" editType="text"
displayType="0.000" sort="true" align="right"
data-regex="/^-?[0-9]{1,16}([.][0-9]{1,3})?$/" maxLength="20" required="true"
data-errorprompt="请输入数字,该值最大可设置17位整数和3位小数!"
/>
<EF:EFColumn ename="remark" cname="备注" enable="true" width="200"/>
<EF:EFColumn ename="remark" cname="备注" enable="true" width="200" align="center"/>
</EF:EFGrid>
</EF:EFRegion>
......
<%--
Created by IntelliJ IDEA.
User: 1
Date: 2024/3/7
Time: 11:20
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:EFSelect cname="工厂" ename="factoryCode" blockId="inqu_status" row="0" colWidth="3"
filter="contains" defultValue="">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="factory_code_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFSelect cname="下料组" ename="groupCode" blockId="inqu_status" row="0" colWidth="3"
filter="contains" defultValue="">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="group_code_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFSelect cname="员工" ename="userId" blockId="inqu_status" row="0" colWidth="3"
filter="contains" defultValue="">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="user_id_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<%--<EF:EFSelect cname="是否删除" ename="deleteFlag" blockId="inqu_status" row="0" colWidth="3" defaultValue="0">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hpjx.hpjx.deleteFlag"/>
</EF:EFSelect>--%>
</div>
<div class="row">
<EF:EFDateSpan startCname="登记日期" endCname="至" blockId="inqu_status"
startName="createdDateFrom" endName="createdDateTo" row="0" role="date"
format="yyyy-MM-dd" satrtRatio="4:8" endRatio="4:8">
</EF:EFDateSpan>
</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="registerDate" cname="登记日期" width="160" align="center" editType="date" readonly="true"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true"/>
<EF:EFComboColumn ename="factoryCode" cname="工厂" blockName="factory_code1_block_id"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" readonly="true" width="120" required="true"
align="center" filter="contains" sort="true">
</EF:EFComboColumn>
<EF:EFComboColumn ename="groupCode" cname="下料组" blockName="group_name_block_id"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" readonly="true" width="120" required="true"
align="center" filter="contains" sort="true">
</EF:EFComboColumn>
<EF:EFComboColumn ename="userId" cname="员工" blockName="user_name_block_id"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" readonly="true" width="100" required="true"
align="center" filter="contains" sort="true">
</EF:EFComboColumn>
<%--<EF:EFComboColumn ename="groupType" cname="生产类型"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" readonly="true" width="100" required="true"
align="center" filter="contains" sort="true">
<EF:EFCodeOption codeName="hpjx.hpjx.productionType" />
</EF:EFComboColumn>--%>
<EF:EFColumn ename="content" cname="报工内容" enable="true" width="160" editType="textarea" align="center" required="true"/>
<EF:EFColumn ename="remark" cname="备注" enable="true" width="200" align="center"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
$(function () {
// 提交
$("#btn_upload").on("click", upload);
$("#cancel").on("click", cancel);
});
let cancel = function(){
parent.JSColorbox.close();
}
/**
* 上传文件
*/
let upload = function () {
let file = $("#inqu_status-0-file").val();
if(isBlank(file)){
message("请选择文件");
return;
}
let id = $("#inqu_status-0-id").val();
let parentId = $("#inqu_status-0-parentId").val();
let projCode = $("#inqu_status-0-projCode").val();
let projName = $("#inqu_status-0-projName").val();
let parentPrdtName = $("#inqu_status-0-parentPrdtName").val();
let productionOrderNo = $("#inqu_status-0-productionOrderNo").val();
let _IPLAT = IPLAT;
_IPLAT.progress($("body"), true);
let formData = new FormData();
if(id === 'route_001'){
formData.append("id", id);
formData.append("startRow", "1"); // 第几行开始读取
formData.append("parentId", parentId);
formData.append("projCode", projCode);
formData.append("projName", projName);
formData.append("parentPrdtName", parentPrdtName);
}
if(id === 'route_002'){
formData.append("id", id);
formData.append("startRow", "1"); // 第几行开始读取
formData.append("productionOrderNo", productionOrderNo);
formData.append("projCode", projCode);
formData.append("projName", projName);
}
formData.append("file", $("#inqu_status-0-file")[0].files[0]);
$.ajax({
url: IPLATUI.CONTEXT_PATH + '/doc/import/api',
type: 'POST',
// dataType: 'json',
data: formData,
async: true,
cache: false,
contentType: false,
processData: false,
success: function (res) {
_IPLAT.progress($("body"), false);
parent.JSColorbox.setValueCallback();
},
error: function (res) {
message(res.msg);
_IPLAT.progress($("body"), false);
}
});
}
<!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="upload" title="文件导入区">
<EF:EFInput ename="inqu_status-0-id" cname="服务Id" type="hidden"/>
<EF:EFInput ename="inqu_status-0-parentId" cname="父Id" type="hidden"/>
<EF:EFInput ename="inqu_status-0-projCode" cname="项目代码" type="hidden"/>
<EF:EFInput ename="inqu_status-0-projName" cname="项目名称" type="hidden"/>
<EF:EFInput ename="inqu_status-0-parentPrdtName" cname="项目部件名称" type="hidden"/>
<EF:EFInput ename="inqu_status-0-productionOrderNo" cname="生产订单号" type="hidden"/>
<EF:EFInput cname="上传文件" blockId="inqu_status" ename="file" row="0" type="file" />
<%--<button id="btn_upload" type="submit">提交</button>--%>
<%-- <EF:EFButton cname="提交" ename="btn_upload"></EF:EFButton>--%>
<div class="row">
<EF:EFButton ename="cancel" cname="取消" type="button" class="btn-align-right"/>
<EF:EFButton ename="btn_upload" cname="确认" type="button" class="btn-align-right"/>
</div>
</EF:EFRegion>
</EF:EFPage>
<script src="${ctx}/HP/SC/HPSC097.js"></script>
$(function () {
$(".row").children().attr("class", "col-md-3");
$("#QUERY").on("click", query);
// 附件上传
$("#UPLOAD_FILE").on("click", uploadFile);
IPLATUI.EFGrid = {
"result": {
pageable: {
pageSize: 10,
pageSizes: [10, 20, 30, 50, 100, 200],
},
columns: [{
field: "operator",
template: function (item) {
let auditStatus = item.status;
let template = '';
let docId = item.docId;
let docName = item.docName
if (item.docId != null){
template = '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'href="' + downloadHref(docId) + '" target="_blank">附件预览</a>';
}
return template;
}
},{
field: "docName",
title: "文件名称",
template: function (item) {
let docId = item.docId;
let docName = item.docName
let template = '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'href="' + downloadHref(docId) + '" target="_blank">'+docName+'</a>';
return template;
}
}],
loadComplete: function(grid) {
// 此 grid 对象
// 处理父子级联动,通过监听 change 事件,判断父级节点是否发生变化
grid.dataSource.bind("change", function(e) {
// 判断父级节点是否发生变化
if (e.field == "factoryCode") {
// cell_label 表示子级节点 ,that 表示此 grid
var cell_label = "groupCode",that = grid;
// locked 表示是否为固定列
var locked = that.isCellLocked(cell_label);
// tr 表示 locked 和非 locked 的行,index 表示此行的第几列
var tr,index;
// 获取此 model 元素信息
var item = e.items[0];
var _uid = item.uid;
if (locked) {
tr = $(".k-grid-content-locked tr[data-uid="+ _uid +"]");
index = $("th[data-field='"+cell_label+"']").data("index");
} else {
tr = $(".k-grid-content tr[data-uid="+ _uid +"]");
index = parseInt($("th[data-field='"+cell_label+"']").data("index")) - that.lockedHeader.find("th").length;
}
// 获取子 cell(td)
var td = tr.children("td:eq("+index+")");
// 触发 td.click 事件,
td.trigger("click");
}
});
},
onSave: function (e) {
// 阻止默认请求,使用自定义保存
//e.preventDefault();
//let btnNode = $(this);
//禁用按钮
//btnNode.attr("disabled", true);
//saveResult(btnNode);
},
onSuccess: function (e) {
if (e.eiInfo.extAttr.methodName == 'update'
|| e.eiInfo.extAttr.methodName == 'insert') {
query();
}
},
onRowClick: function (e) {
/*var block = detailGrid.getEiBlock();
if (block != null) {
block.setRows([]);
detailGrid.setEiBlock(block);
}
var info = new EiInfo()
var parentId = e.model['planInfoNo'];
info.set("parentId", parentId);
EiCommunicator.send("HPSC004", "queryDetail", info, {
onSuccess: function (ei) {//返回结果集
detailGrid.setEiInfo(ei);
}, onFail: function (ei) {
}
}, {async: false});*/
},
}
}
});
let query = function () { resultGrid.dataSource.page(1);}
/**
* 文件上传
*
* @param id
*/
function uploadFile(id) {
JSColorbox.open({
href: "HPXS099?methodName=initLoad",
title: "<div style='text-align: center;'>附件上传</div>",
width: "60%",
height: "50%",
callbackName: uploadFileCallback
});
}
/**
* 附件上传回调
*
* @param e
*/
function uploadFileCallback(e) {
let result = new EiInfo();
let docId = e.response.docId;
let docName = e.response.docName;
let docSize = e.response.docSize;
let docTag = e.response.docTag;
let docUrl = e.response.docUrl;
result.set("result-0-docId",docId);
result.set("result-0-docName",docName);
result.set("result-0-docSize",docSize);
result.set("result-0-docTag",docTag);
result.set("result-0-realPath",docUrl);
EiCommunicator.send("HPXS003", "insert", result, {
onSuccess: function (ei) {
if (ei.getStatus() >= 0) {
if (ei.getStatus() == 0) {
NotificationUtil(ei, 'warning');
} else {
NotificationUtil(ei);
}
} else {
NotificationUtil(ei, "error");
}
resultGrid.dataSource.page(1);
},
onFail: function (ei) {
// 发生异常
NotificationUtil("执行失败,原因[" + ei + "]", "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);
}
})
}
/**
* 日期判断
* @param model 当前数据map
* @param rows 数据集合list
* @returns {boolean} 结束时间是否大于开始时间
*/
function check_time(model,rows){
for (var i=0;i<rows.length;i++){
if (model.planInfoNo == rows[i][5]) {
var start_time = rows[i][22];
var end_time = rows[i][23];
if (end_time < start_time) {
return false;
}
}
}
return true;
}
\ No newline at end of file
<%--
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="企业log管理">
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<EF:EFInput cname="文件名称" blockId="inqu_status" ename="docName" row="0" colWidth="3"/>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row">
<EF:EFColumn ename="docId" primaryKey="true" cname="文件标识ID" hidden="true"/>
<EF:EFColumn ename="companyCode" cname="企业编码" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="120" align="center"/>
<EF:EFColumn cname="文件名称" ename="docName" align="center" width="150" readonly="true" required="false" enable="false"/>
<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>
$(function () {
IPLATUI.EFUpload = {
uploadFile: {
success: function(e) {
let docId = e.response.docId;
if (isBlank(docId)) {
return;
}
$("#fileDocId").val(docId);
NotificationUtil("附件上传成功");
//console.log($("#fileDocId").val())
//saveTemp(e);
try {
parent.JSColorbox.setValueCallback(e);
} catch (e){
}
},
}
};
});
\ No newline at end of file
<%--
Created by IntelliJ IDEA.
User: 1
Date: 2024/3/25
Time: 18:17
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="result">
<EF:EFUpload blockId="result" ename="uploadFile" docTag="hk_fileLog" path="log"/>
</EF:EFRegion>
<EF:EFInput ename="fileDocId" cname="" hidden="true"/>
</EF:EFPage>
\ No newline at end of file
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