Commit 96c8bb80 by liuyang

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

parents 33727bbc ac429dca
...@@ -16,9 +16,11 @@ import org.springframework.web.multipart.commons.CommonsMultipartFile; ...@@ -16,9 +16,11 @@ import org.springframework.web.multipart.commons.CommonsMultipartFile;
import java.io.IOException; import java.io.IOException;
import java.util.HashMap; import java.util.HashMap;
import java.util.Iterator;
import java.util.Map; import java.util.Map;
import net.sf.json.JSONObject; import net.sf.json.JSONObject;
import org.springframework.web.multipart.support.DefaultMultipartHttpServletRequest;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
...@@ -30,7 +32,7 @@ import javax.servlet.http.HttpServletRequest; ...@@ -30,7 +32,7 @@ import javax.servlet.http.HttpServletRequest;
@RestController @RestController
@RequestMapping({"/upload/file"}) @RequestMapping({"/upload/file"})
public class FileUploadController { public class FileUploadController {
/** /**
* 更具docId上传文件 * 更具docId上传文件
* *
...@@ -44,7 +46,11 @@ public class FileUploadController { ...@@ -44,7 +46,11 @@ public class FileUploadController {
JSONObject upload = new JSONObject(); JSONObject upload = new JSONObject();
String projectEnv = ProjectInfo.getProjectEnv(); String projectEnv = ProjectInfo.getProjectEnv();
if (CommonConstant.projectEnv.RUN.equalsIgnoreCase(projectEnv)) { if (CommonConstant.projectEnv.RUN.equalsIgnoreCase(projectEnv)) {
upload = UploadUtils.upload((CommonsMultipartFile)file); Iterator multiFileIterator = ((DefaultMultipartHttpServletRequest) request).getMultiFileMap().get("uploadFile").iterator();
while(multiFileIterator.hasNext()) {
CommonsMultipartFile multipartFile = (CommonsMultipartFile)multiFileIterator.next();
upload = UploadUtils.upload(multipartFile);
}
}else { }else {
upload = UploadUtils.uploadFile(request); upload = UploadUtils.uploadFile(request);
} }
...@@ -58,7 +64,7 @@ public class FileUploadController { ...@@ -58,7 +64,7 @@ public class FileUploadController {
return resultMap; return resultMap;
} }
} }
/** /**
* @param content * @param content
* @return * @return
...@@ -75,5 +81,5 @@ public class FileUploadController { ...@@ -75,5 +81,5 @@ public class FileUploadController {
return resultMap; return resultMap;
} }
} }
} }
...@@ -133,6 +133,27 @@ public class UserSessionUtils extends UserSession { ...@@ -133,6 +133,27 @@ public class UserSessionUtils extends UserSession {
} }
/** /**
* 获取登录用户的所有组
*
* @return
*/
public static List<String> getAllGroupCode() {
List<Org> orgs = HGXSTools.XsOrg.queryByUser();
if (CollectionUtils.isEmpty(orgs)) {
return new ArrayList<>();
}
List<String> prodGroupCodes = new ArrayList<>();
for (Org org : orgs) {
if (OrgTypeEnum.PROD_GROUP.getCode().equals(org.getOrgType())
|| OrgTypeEnum.CUT_GROUP.getCode().equals(org.getOrgType())
|| OrgTypeEnum.SYN_GROUP.getCode().equals(org.getOrgType())) {
prodGroupCodes.add(org.getOrgId());
}
}
return prodGroupCodes;
}
/**
* 获取登录用户所有角色 * 获取登录用户所有角色
* *
* @return * @return
......
package com.baosight.hggp.hg.sc.service; package com.baosight.hggp.hg.sc.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation; import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.dao.DaoBase; import com.baosight.hggp.core.dao.DaoBase;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.enums.OrgTypeEnum; import com.baosight.hggp.core.enums.OrgTypeEnum;
import com.baosight.hggp.core.security.UserSessionUtils; import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.constant.HGSqlConstant; import com.baosight.hggp.hg.constant.HGSqlConstant;
import com.baosight.hggp.hg.cw.tools.HGCWTools;
import com.baosight.hggp.hg.cw.vo.UserVO;
import com.baosight.hggp.hg.sb.domain.HGSB002;
import com.baosight.hggp.hg.sb.tools.HGSBTools; import com.baosight.hggp.hg.sb.tools.HGSBTools;
import com.baosight.hggp.hg.sc.domain.HGSC007; import com.baosight.hggp.hg.sc.domain.HGSC007;
import com.baosight.hggp.hg.xs.domain.Company; import com.baosight.hggp.hg.xs.domain.Company;
import com.baosight.hggp.hg.xs.domain.Factory; import com.baosight.hggp.hg.xs.domain.Factory;
import com.baosight.hggp.hg.xs.domain.Org; import com.baosight.hggp.hg.xs.domain.Org;
import com.baosight.hggp.hg.xs.tools.HGXSTools; import com.baosight.hggp.hg.xs.tools.HGXSTools;
import com.baosight.hggp.util.*; import com.baosight.hggp.util.DateUtil;
import com.baosight.hggp.util.EiInfoUtils;
import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.MapUtils;
import com.baosight.hggp.util.StringUtil;
import com.baosight.hggp.util.contants.ACConstants; import com.baosight.hggp.util.contants.ACConstants;
import com.baosight.iplat4j.core.ei.EiBlock; import com.baosight.iplat4j.core.ei.EiBlock;
import com.baosight.iplat4j.core.ei.EiConstant; import com.baosight.iplat4j.core.ei.EiConstant;
...@@ -26,225 +25,236 @@ import com.baosight.iplat4j.core.service.impl.ServiceEPBase; ...@@ -26,225 +25,236 @@ import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import java.util.*; import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.function.Function; import java.util.function.Function;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
* @author Zhang JiHui * @author Zhang JiHui
* @version 1.0 2024/5/24 * @version 1.0 2024/5/24
*/ */
public class ServiceHGSC007 extends ServiceEPBase { public class ServiceHGSC007 extends ServiceEPBase {
@OperationLogAnnotation(operModul = "生产任务", operType = "查询", operDesc = "初始化页面") public static List<Map<String, Object>> getOrg() {
public EiInfo initLoad(EiInfo inInfo) { List<Map<String, Object>> list = new ArrayList<>();
try { List<Org> orgList = HGXSTools.XsOrg.queryByUser();
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGSC007().eiMetadata); if (CollectionUtils.isNotEmpty(orgList)) {
for (Org org : orgList) {
Map<String, Object> objectMap = new HashMap<>();
if (!org.getOrgType().equals(OrgTypeEnum.COMPANY.getCode())) {
//Org org1 = HGXSTools.XsOrg.queryCompany(org.getOrgId());
objectMap.put(Org.FIELD_FACTORY_CODE, org.getFactoryCode());
objectMap.put(Org.FIELD_FACTORY_NAME, org.getFactoryName());
} else {
Map<String, Object> map = new HashMap<String, Object>();
map.put(Org.FIELD_PARENT_ORG_ID, org.getOrgId());
List<Map> results = DaoBase.getInstance().query(HGSqlConstant.HgXsOrg.QUERY_BY_FACTORY, map);
if (results.size() > 0) {
Map org1 = results.get(0);
objectMap.put(Org.FIELD_FACTORY_CODE, org1.get(Org.FIELD_ORG_ID));
objectMap.put(Org.FIELD_FACTORY_NAME, org1.get(Org.FIELD_ORG_CNAME));
}
}
list.add(objectMap);
}
}
return list;
}
@OperationLogAnnotation(operModul = "生产任务", operType = "查询", operDesc = "初始化页面")
public EiInfo initLoad(EiInfo inInfo) {
try {
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGSC007().eiMetadata);
// inInfo = super.query(inInfo, HGSC007.QUERY, new HGSC007()); // inInfo = super.query(inInfo, HGSC007.QUERY, new HGSC007());
} catch (PlatException e) { } catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败"); LogUtils.setDetailMsg(inInfo, e, "初始化失败");
} }
return inInfo; return inInfo;
} }
/* /**
* 查询*/ * 查询
@OperationLogAnnotation(operModul = "生产任务", operType = "查询", operDesc = "查询") *
public EiInfo query(EiInfo inInfo) { * @param inInfo
try { * @return
EiBlock block = inInfo.getBlock(EiConstant.queryBlock); */
String creatTime = block.getCellStr(ACConstants.ROW_CODE_0, HGSC007.FIELD_created_time); @OperationLogAnnotation(operModul = "生产任务", operType = "查询", operDesc = "查询")
if (StringUtils.isNotBlank(creatTime)) { public EiInfo query(EiInfo inInfo) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0,HGSC007.FIELD_created_time, StringUtil.removeHorizontalLine(creatTime)); try {
} Map queryMap = EiInfoUtils.getFirstRow(inInfo);
String creatTime = MapUtils.getString(queryMap, HGSC007.FIELD_created_time);
inInfo = super.query(inInfo,HGSC007.QUERY,new HGSC007() ); if (StringUtils.isNotBlank(creatTime)) {
queryMap.put(HGSC007.FIELD_created_time, StringUtil.removeHorizontalLine(creatTime));
} catch (PlatException e) { }
LogUtils.setDetailMsg(inInfo, e, "查询失败"); // 仅查询自己所在组的任务
} queryMap.put("groupCodes", UserSessionUtils.getAllGroupCode());
return inInfo; inInfo = super.query(inInfo, HGSC007.QUERY, new HGSC007());
} } catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
@OperationLogAnnotation(operModul = "生产任务", operType = "查询", operDesc = "APP查询数量") return inInfo;
public Integer count(EiInfo inInfo) { }
Integer count = null;
try { @OperationLogAnnotation(operModul = "生产任务", operType = "查询", operDesc = "APP查询数量")
EiBlock block = inInfo.getBlock(EiConstant.queryBlock); public Integer count(EiInfo inInfo) {
String creatTime = block.getCellStr(ACConstants.ROW_CODE_0, HGSC007.FIELD_created_time); Integer count = null;
if (StringUtils.isNotBlank(creatTime)) { try {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0,HGSC007.FIELD_created_time, StringUtil.removeHorizontalLine(creatTime)); EiBlock block = inInfo.getBlock(EiConstant.queryBlock);
} String creatTime = block.getCellStr(ACConstants.ROW_CODE_0, HGSC007.FIELD_created_time);
Map paramMap = EiInfoUtils.getFirstRow(inInfo); if (StringUtils.isNotBlank(creatTime)) {
count = super.count(HGSC007.COUNT,paramMap); inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSC007.FIELD_created_time,
StringUtil.removeHorizontalLine(creatTime));
} catch (PlatException e) { }
LogUtils.setDetailMsg(inInfo, e, "查询失败"); Map paramMap = EiInfoUtils.getFirstRow(inInfo);
} count = super.count(HGSC007.COUNT, paramMap);
return count;
} } catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
@OperationLogAnnotation(operModul = "生产任务", operType = "APP查询公司", operDesc = "APP查询当前登陆用户角色所属公司") }
public List<Company> getRoleCompany(EiInfo inInfo) { return count;
List<Company> companyList = UserSessionUtils.getRoleCompany(); }
return companyList;
} @OperationLogAnnotation(operModul = "生产任务", operType = "APP查询公司", operDesc = "APP查询当前登陆用户角色所属公司")
public List<Company> getRoleCompany(EiInfo inInfo) {
@OperationLogAnnotation(operModul = "生产任务", operType = "APP查询工厂", operDesc = "APP查询当前登录用户角色所属工厂") List<Company> companyList = UserSessionUtils.getRoleCompany();
public List<Factory> getRoleFactory(EiInfo inInfo) { return companyList;
List<Org> factoryCodes = new ArrayList<>(); }
try {
List<String> roleCompanyCode = HGSBTools.getRoleCompanyCode(); @OperationLogAnnotation(operModul = "生产任务", operType = "APP查询工厂", operDesc = "APP查询当前登录用户角色所属工厂")
Optional.ofNullable(roleCompanyCode).orElse(new ArrayList<>()).stream().forEach( code -> { public List<Factory> getRoleFactory(EiInfo inInfo) {
factoryCodes.addAll(HGXSTools.XsOrg.queryByParent(code,OrgTypeEnum.FACTORY.getCode())); List<Org> factoryCodes = new ArrayList<>();
}); try {
//List<Map<String,Object>> mapList = getOrg(); List<String> roleCompanyCode = HGSBTools.getRoleCompanyCode();
//factoryCodes.addAll(mapList); Optional.ofNullable(roleCompanyCode).orElse(new ArrayList<>()).stream().forEach(code -> {
}catch (Exception e){ factoryCodes.addAll(HGXSTools.XsOrg.queryByParent(code, OrgTypeEnum.FACTORY.getCode()));
LogUtils.setDetailMsg(inInfo,e,"APP查询工厂失败"); });
} //List<Map<String,Object>> mapList = getOrg();
return factoryCodes.stream().filter(o-> com.baosight.hggp.util.StringUtils.equals(o.getOrgType(),OrgTypeEnum.FACTORY.getCode())).map(item -> new Factory(item.getCompanyCode(),item.getCompanyName(),item.getFactoryCode(),item.getFactoryName())).collect(Collectors.collectingAndThen( //factoryCodes.addAll(mapList);
Collectors.toMap(Factory::getFactoryCode, Function.identity(), (oldValue, newValue) -> oldValue), } catch (Exception e) {
// 将Map转回List LogUtils.setDetailMsg(inInfo, e, "APP查询工厂失败");
m -> new ArrayList<>(m.values()) }
)); return factoryCodes.stream()
} .filter(o -> com.baosight.hggp.util.StringUtils.equals(o.getOrgType(), OrgTypeEnum.FACTORY.getCode()))
.map(item -> new Factory(item.getCompanyCode(), item.getCompanyName(), item.getFactoryCode(),
/** item.getFactoryName())).collect(Collectors.collectingAndThen(
* app查询工序累计产量 Collectors.toMap(Factory::getFactoryCode, Function.identity(),
*/ (oldValue, newValue) -> oldValue),
@OperationLogAnnotation(operModul = "生产任务", operType = "APP查询工序累计产量", operDesc = "APP查询工序累计产量") // 将Map转回List
public EiInfo getProcessSumWt(EiInfo inInfo) { m -> new ArrayList<>(m.values())
try { ));
EiBlock queryRow = inInfo.getBlock(EiConstant.queryBlock); }
//UserVO userVO = HGCWTools.HgCw002.getUserCompany();
/**
* app查询工序累计产量
*/
@OperationLogAnnotation(operModul = "生产任务", operType = "APP查询工序累计产量", operDesc = "APP查询工序累计产量")
public EiInfo getProcessSumWt(EiInfo inInfo) {
try {
EiBlock queryRow = inInfo.getBlock(EiConstant.queryBlock);
//UserVO userVO = HGCWTools.HgCw002.getUserCompany();
/*String companyCode = queryRow.getCellStr(ACConstants.ROW_CODE_0,HGSC007.FIELD_company_code); /*String companyCode = queryRow.getCellStr(ACConstants.ROW_CODE_0,HGSC007.FIELD_company_code);
if (StringUtils.isEmpty(companyCode)) { if (StringUtils.isEmpty(companyCode)) {
queryRow.setCell(ACConstants.ROW_CODE_0,HGSC007.FIELD_company_code,userVO.getUsercode()); queryRow.setCell(ACConstants.ROW_CODE_0,HGSC007.FIELD_company_code,userVO.getUsercode());
}*/ }*/
inInfo = super.query(inInfo,HGSC007.QUERY_SUM_WT); inInfo = super.query(inInfo, HGSC007.QUERY_SUM_WT);
} catch (PlatException e) { } catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败"); LogUtils.setDetailMsg(inInfo, e, "查询失败");
} }
return inInfo; return inInfo;
} }
/** /**
* app查询工序产量 * app查询工序产量
*/ */
@OperationLogAnnotation(operModul = "生产任务", operType = "APP查询工序产量", operDesc = "APP查询工序产量") @OperationLogAnnotation(operModul = "生产任务", operType = "APP查询工序产量", operDesc = "APP查询工序产量")
public EiInfo getProcessWt(EiInfo inInfo) { public EiInfo getProcessWt(EiInfo inInfo) {
try { try {
EiBlock queryRow = inInfo.getBlock(EiConstant.queryBlock); EiBlock queryRow = inInfo.getBlock(EiConstant.queryBlock);
/*UserVO userVO = HGCWTools.HgCw002.getUserCompany(); /*UserVO userVO = HGCWTools.HgCw002.getUserCompany();
String companyCode = queryRow.getCellStr(ACConstants.ROW_CODE_0,HGSC007.FIELD_company_code); String companyCode = queryRow.getCellStr(ACConstants.ROW_CODE_0,HGSC007.FIELD_company_code);
if (StringUtils.isEmpty(companyCode)) { if (StringUtils.isEmpty(companyCode)) {
queryRow.setCell(ACConstants.ROW_CODE_0,HGSC007.FIELD_company_code,userVO.getUsercode()); queryRow.setCell(ACConstants.ROW_CODE_0,HGSC007.FIELD_company_code,userVO.getUsercode());
}*/ }*/
inInfo = super.query(inInfo,HGSC007.QUERY_WT); inInfo = super.query(inInfo, HGSC007.QUERY_WT);
} catch (PlatException e) { } catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败"); LogUtils.setDetailMsg(inInfo, e, "查询失败");
} }
return inInfo; return inInfo;
} }
/** /**
* app查询工序日产量 * app查询工序日产量
*/ */
@OperationLogAnnotation(operModul = "生产任务", operType = "APP查询工序日产量", operDesc = "APP查询工序日产量") @OperationLogAnnotation(operModul = "生产任务", operType = "APP查询工序日产量", operDesc = "APP查询工序日产量")
public EiInfo getProcessDayWt(EiInfo inInfo) { public EiInfo getProcessDayWt(EiInfo inInfo) {
try { try {
EiBlock queryRow = inInfo.getBlock(EiConstant.queryBlock); EiBlock queryRow = inInfo.getBlock(EiConstant.queryBlock);
//UserVO userVO = HGCWTools.HgCw002.getUserCompany(); //UserVO userVO = HGCWTools.HgCw002.getUserCompany();
//String companyCode = queryRow.getCellStr(ACConstants.ROW_CODE_0,HGSC007.FIELD_company_code); //String companyCode = queryRow.getCellStr(ACConstants.ROW_CODE_0,HGSC007.FIELD_company_code);
String endDate = queryRow.getCellStr(ACConstants.ROW_CODE_0,ACConstants.SQL_END_DATE); String endDate = queryRow.getCellStr(ACConstants.ROW_CODE_0, ACConstants.SQL_END_DATE);
if (StringUtils.isNotEmpty(endDate)) { if (StringUtils.isNotEmpty(endDate)) {
String startDate = DateUtil.dateSubStr(endDate,-7); String startDate = DateUtil.dateSubStr(endDate, -7);
queryRow.setCell(ACConstants.ROW_CODE_0,ACConstants.SQL_START_DATE,startDate); queryRow.setCell(ACConstants.ROW_CODE_0, ACConstants.SQL_START_DATE, startDate);
} }
/*if (StringUtils.isEmpty(companyCode)) { /*if (StringUtils.isEmpty(companyCode)) {
queryRow.setCell(ACConstants.ROW_CODE_0,HGSC007.FIELD_company_code,userVO.getUsercode()); queryRow.setCell(ACConstants.ROW_CODE_0,HGSC007.FIELD_company_code,userVO.getUsercode());
}*/ }*/
inInfo = super.query(inInfo,HGSC007.QUERY_DAY_WT); inInfo = super.query(inInfo, HGSC007.QUERY_DAY_WT);
} catch (PlatException e) { } catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败"); LogUtils.setDetailMsg(inInfo, e, "查询失败");
} }
return inInfo; return inInfo;
} }
/** /**
* app查询工序日产量 * app查询工序日产量
*/ */
@OperationLogAnnotation(operModul = "生产任务", operType = "APP查询工序日产量", operDesc = "APP查询工序日产量") @OperationLogAnnotation(operModul = "生产任务", operType = "APP查询工序日产量", operDesc = "APP查询工序日产量")
public EiInfo getProcessMonthWt(EiInfo inInfo) { public EiInfo getProcessMonthWt(EiInfo inInfo) {
try { try {
EiBlock queryRow = inInfo.getBlock(EiConstant.queryBlock); EiBlock queryRow = inInfo.getBlock(EiConstant.queryBlock);
//UserVO userVO = HGCWTools.HgCw002.getUserCompany(); //UserVO userVO = HGCWTools.HgCw002.getUserCompany();
//String companyCode = queryRow.getCellStr(ACConstants.ROW_CODE_0,HGSC007.FIELD_company_code); //String companyCode = queryRow.getCellStr(ACConstants.ROW_CODE_0,HGSC007.FIELD_company_code);
String endDate = queryRow.getCellStr(ACConstants.ROW_CODE_0,ACConstants.SQL_END_DATE); String endDate = queryRow.getCellStr(ACConstants.ROW_CODE_0, ACConstants.SQL_END_DATE);
if (StringUtils.isNotEmpty(endDate)) { if (StringUtils.isNotEmpty(endDate)) {
String startDate = DateUtil.getMonthOfDays(endDate,-6,DateUtil.DATE8_PATTERN); String startDate = DateUtil.getMonthOfDays(endDate, -6, DateUtil.DATE8_PATTERN);
queryRow.setCell(ACConstants.ROW_CODE_0,ACConstants.SQL_START_DATE,startDate); queryRow.setCell(ACConstants.ROW_CODE_0, ACConstants.SQL_START_DATE, startDate);
} }
/*if (StringUtils.isEmpty(companyCode)) { /*if (StringUtils.isEmpty(companyCode)) {
queryRow.setCell(ACConstants.ROW_CODE_0,HGSC007.FIELD_company_code,userVO.getUsercode()); queryRow.setCell(ACConstants.ROW_CODE_0,HGSC007.FIELD_company_code,userVO.getUsercode());
}*/ }*/
inInfo = super.query(inInfo,HGSC007.QUERY_MONTH_WT); inInfo = super.query(inInfo, HGSC007.QUERY_MONTH_WT);
} catch (PlatException e) { } catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败"); LogUtils.setDetailMsg(inInfo, e, "查询失败");
} }
return inInfo; return inInfo;
} }
/** /**
* app查询工序产量 * app查询工序产量
*/ */
@OperationLogAnnotation(operModul = "生产任务", operType = "APP查询项目产量", operDesc = "APP查询项目产量") @OperationLogAnnotation(operModul = "生产任务", operType = "APP查询项目产量", operDesc = "APP查询项目产量")
public EiInfo getProjCodeWt(EiInfo inInfo) { public EiInfo getProjCodeWt(EiInfo inInfo) {
try { try {
EiBlock queryRow = inInfo.getBlock(EiConstant.queryBlock); EiBlock queryRow = inInfo.getBlock(EiConstant.queryBlock);
//UserVO userVO = HGCWTools.HgCw002.getUserCompany(); //UserVO userVO = HGCWTools.HgCw002.getUserCompany();
//Map queryRow = EiInfoUtils.getFirstRow(inInfo); //Map queryRow = EiInfoUtils.getFirstRow(inInfo);
/*String companyCode = queryRow.getCellStr(ACConstants.ROW_CODE_0,HGSC007.FIELD_company_code); /*String companyCode = queryRow.getCellStr(ACConstants.ROW_CODE_0,HGSC007.FIELD_company_code);
if (StringUtils.isEmpty(companyCode)) { if (StringUtils.isEmpty(companyCode)) {
queryRow.setCell(ACConstants.ROW_CODE_0,HGSC007.FIELD_company_code,userVO.getUsercode()); queryRow.setCell(ACConstants.ROW_CODE_0,HGSC007.FIELD_company_code,userVO.getUsercode());
}*/ }*/
inInfo = super.query(inInfo,HGSC007.QUERY_PROJ_CODE_WT); inInfo = super.query(inInfo, HGSC007.QUERY_PROJ_CODE_WT);
} catch (PlatException e) { } catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败"); LogUtils.setDetailMsg(inInfo, e, "查询失败");
} }
return inInfo; return inInfo;
} }
public static List<Map<String,Object>> getOrg() {
List<Map<String,Object>> list = new ArrayList<>();
List<Org> orgList = HGXSTools.XsOrg.queryByUser();
if (CollectionUtils.isNotEmpty(orgList)) {
for (Org org: orgList) {
Map<String,Object> objectMap = new HashMap<>();
if (!org.getOrgType().equals(OrgTypeEnum.COMPANY.getCode())) {
//Org org1 = HGXSTools.XsOrg.queryCompany(org.getOrgId());
objectMap.put(Org.FIELD_FACTORY_CODE,org.getFactoryCode());
objectMap.put(Org.FIELD_FACTORY_NAME,org.getFactoryName());
} else {
Map<String, Object> map = new HashMap<String, Object>();
map.put(Org.FIELD_PARENT_ORG_ID, org.getOrgId());
List<Map> results = DaoBase.getInstance().query(HGSqlConstant.HgXsOrg.QUERY_BY_FACTORY,map);
if (results.size()>0) {
Map org1 = results.get(0);
objectMap.put(Org.FIELD_FACTORY_CODE,org1.get(Org.FIELD_ORG_ID));
objectMap.put(Org.FIELD_FACTORY_NAME,org1.get(Org.FIELD_ORG_CNAME));
}
}
list.add(objectMap);
}
}
return list;
}
} }
<?xml version="1.0" encoding="UTF-8"?> <?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 <!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://www.ibatis.com/dtd/sql-map-2.dtd">
Generate time : 2024-05-23 17:55:59
Version : 1.0
schema : hggp
tableName : HGSC007
id BIGINT NOT NULL primarykey,
order_id BIGINT NOT NULL,
order_detail_id BIGINT NOT NULL,
tech_flow_id BIGINT,
tech_flow_name BIGINT,
invent_process_id BIGINT,
process_code VARCHAR,
process_name VARCHAR,
process_order BIGINT,
company_code VARCHAR NOT NULL,
company_name VARCHAR NOT NULL,
dep_code VARCHAR,
dep_name VARCHAR,
proj_code VARCHAR,
proj_name VARCHAR,
task_code VARCHAR,
product_type TINYINT,
product_code VARCHAR,
product_name VARCHAR,
plan_start_date VARCHAR,
plan_end_date VARCHAR,
factory_code VARCHAR,
factory_name VARCHAR,
group_code VARCHAR,
group_name VARCHAR,
complete_date VARCHAR,
quantity TINYINT,
finish_quantity TINYINT,
unfinish_quantity TINYINT,
single_weight DECIMAL,
total_weight DECIMAL,
finish_weight DECIMAL,
unfinish_weight DECIMAL,
account_code VARCHAR NOT NULL,
created_by VARCHAR,
created_name VARCHAR,
created_time VARCHAR,
updated_by VARCHAR,
updated_name VARCHAR,
updated_time VARCHAR
-->
<sqlMap namespace="HGSC007"> <sqlMap namespace="HGSC007">
<sql id="condition"> <sql id="condition">
...@@ -184,6 +139,13 @@ ...@@ -184,6 +139,13 @@
ifnull(complete_date,'') != '' ifnull(complete_date,'') != ''
</isEqual> </isEqual>
</sql> </sql>
<sql id="customCondition">
<isNotEmpty prepend=" AND " property="groupCodes">
GROUP_CODE IN <iterate close=")" open="(" conjunction="," property="groupCodes">#groupCodes[]#</iterate>
</isNotEmpty>
</sql>
<sql id="appCondition"> <sql id="appCondition">
<!-- 无权限时使用 --> <!-- 无权限时使用 -->
<isNotEmpty prepend=" AND " property="authDepCode"> <isNotEmpty prepend=" AND " property="authDepCode">
......
...@@ -108,7 +108,7 @@ ...@@ -108,7 +108,7 @@
$orderBy$ $orderBy$
</isNotEmpty> </isNotEmpty>
<isEmpty property="orderBy"> <isEmpty property="orderBy">
ID desc ID DESC
</isEmpty> </isEmpty>
</dynamic> </dynamic>
</sql> </sql>
......
package com.baosight.hggp.hg.wd.tools; package com.baosight.hggp.hg.wd.tools;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoBase; import com.baosight.hggp.core.dao.DaoBase;
import com.baosight.hggp.core.dao.DaoUtils; import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.hg.sb.domain.HGSB002;
import com.baosight.hggp.hg.wd.constant.HgWdSqlConstant; import com.baosight.hggp.hg.wd.constant.HgWdSqlConstant;
import com.baosight.hggp.hg.wd.domain.HGWD001; import com.baosight.hggp.hg.wd.domain.HGWD001;
import com.baosight.hggp.hg.wd.domain.HGWD001A; import com.baosight.hggp.hg.wd.domain.HGWD001A;
import com.baosight.hggp.util.AssertUtils; import com.baosight.hggp.util.AssertUtils;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import java.util.HashMap; import java.util.HashMap;
...@@ -32,7 +29,7 @@ public class HGWDTools { ...@@ -32,7 +29,7 @@ public class HGWDTools {
* @return * @return
*/ */
public static HGWD001 get(String fileId) { public static HGWD001 get(String fileId) {
AssertUtils.isNull(fileId, "文件ID不能为空"); AssertUtils.isEmpty(fileId, "文件ID不能为空");
Map queryMap = new HashMap(); Map queryMap = new HashMap();
queryMap.put(HGWD001.FIELD_FILE_ID, fileId); queryMap.put(HGWD001.FIELD_FILE_ID, fileId);
List<HGWD001> results = DaoBase.getInstance().query(HGWD001.QUERY, queryMap); List<HGWD001> results = DaoBase.getInstance().query(HGWD001.QUERY, queryMap);
...@@ -57,7 +54,7 @@ public class HGWDTools { ...@@ -57,7 +54,7 @@ public class HGWDTools {
* @param fileId * @param fileId
*/ */
public static void previewIncr(String fileId) { public static void previewIncr(String fileId) {
AssertUtils.isNull(fileId, "文件ID不能为空"); AssertUtils.isEmpty(fileId, "文件ID不能为空");
Map queryMap = new HashMap(); Map queryMap = new HashMap();
queryMap.put(HGWD001.FIELD_FILE_ID, fileId); queryMap.put(HGWD001.FIELD_FILE_ID, fileId);
DaoUtils.update(HgWdSqlConstant.HgWd001.PREVIEW_INCR, queryMap); DaoUtils.update(HgWdSqlConstant.HgWd001.PREVIEW_INCR, queryMap);
...@@ -69,7 +66,7 @@ public class HGWDTools { ...@@ -69,7 +66,7 @@ public class HGWDTools {
* @param fileId * @param fileId
*/ */
public static void downloadIncr(String fileId) { public static void downloadIncr(String fileId) {
AssertUtils.isNull(fileId, "文件ID不能为空"); AssertUtils.isEmpty(fileId, "文件ID不能为空");
Map queryMap = new HashMap(); Map queryMap = new HashMap();
queryMap.put(HGWD001.FIELD_FILE_ID, fileId); queryMap.put(HGWD001.FIELD_FILE_ID, fileId);
DaoUtils.update(HgWdSqlConstant.HgWd001.DOWNLOAD_INCR, queryMap); DaoUtils.update(HgWdSqlConstant.HgWd001.DOWNLOAD_INCR, queryMap);
......
...@@ -21,7 +21,7 @@ $(function () { ...@@ -21,7 +21,7 @@ $(function () {
}, { }, {
field: "docVersion", field: "docVersion",
template: function (model) { template: function (model) {
return "V" + model.docVersion; return "v" + model.docVersion;
} }
}], }],
loadComplete: function (grid) { loadComplete: function (grid) {
......
...@@ -34,6 +34,8 @@ ...@@ -34,6 +34,8 @@
<EF:EFColumn ename="docVersion" cname="版本号" enable="false" width="100" align="center"/> <EF:EFColumn ename="docVersion" cname="版本号" enable="false" width="100" align="center"/>
<EF:EFColumn ename="docId" cname="文件号" enable="false" width="120" align="center" hidden="true"/> <EF:EFColumn ename="docId" cname="文件号" enable="false" width="120" align="center" hidden="true"/>
<EF:EFColumn ename="docName" cname="文件附件名称" enable="false" width="100" align="left"/> <EF:EFColumn ename="docName" cname="文件附件名称" enable="false" width="100" align="left"/>
<EF:EFColumn ename="previewNum" cname="预览次数" enable="false" width="100" align="right"/>
<EF:EFColumn ename="downloadNum" cname="下载次数" enable="false" width="100" align="right"/>
</EF:EFGrid> </EF:EFGrid>
</EF:EFRegion> </EF:EFRegion>
......
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