Commit 6040ee37 by 宋祥

1.查询报错问题修复

parent 5a2ab32b
......@@ -22,8 +22,15 @@ public class HgScSqlConstant {
public static final String UPDATE_PROJ_NAME = "HGSC001.updateProjName";
}
/**
*
* @author:songx
* @date:2024/9/8,9:41
*/
public static class HgSc007 {
// get
public static final String GET = "HGSC007.get";
//app 查询生产任务
public static final String QUERY_APP = "HGSC007.queryApp";
}
......
package com.baosight.hggp.hg.sc.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.sb.domain.HGSB004A;
import com.baosight.hggp.hg.sc.domain.HGSC006A;
import com.baosight.hggp.hg.sc.domain.HGSC007;
import com.baosight.hggp.hg.sc.domain.HGSC008;
import com.baosight.hggp.hg.sc.domain.HGSC099;
import com.baosight.hggp.hg.sc.tools.HGSCTools;
import com.baosight.hggp.hg.zl.tools.HGZLTools;
import com.baosight.hggp.util.*;
import com.baosight.hggp.util.contants.ACConstants;
import com.baosight.iplat4j.core.ei.EiBlock;
import com.baosight.hggp.util.AssertUtils;
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.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.impl.ServiceEPBase;
import com.baosight.iplat4j.core.util.NumberUtils;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import org.springframework.beans.BeanUtils;
import java.math.BigDecimal;
import java.util.*;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Optional;
/**
......@@ -38,6 +39,7 @@ public class ServiceHGSC007A extends ServiceEPBase {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
String taskId = MapUtils.getString(queryMap, HGSC008.FIELD_task_id);
HGSC007 hgsc007 = HGSCTools.THGSC007.getById(Long.valueOf(taskId));
AssertUtils.isNull(hgsc007, String.format("任务【%s】不存在", taskId));
HGSC008 hgsc008 = new HGSC008();
BeanUtils.copyProperties(hgsc007,hgsc008);
......
......@@ -269,6 +269,13 @@
</dynamic>
</sql>
<select id="get" resultClass="com.baosight.hggp.hg.sc.domain.HGSC007">
SELECT
<include refid="column"/>
FROM ${hggpSchema}.HGSC007
WHERE ID = #id#
</select>
<select id="query" resultClass="com.baosight.hggp.hg.sc.domain.HGSC007">
SELECT
<include refid="column"/>
......
......@@ -1291,9 +1291,9 @@ public class HGSCTools {
return CollectionUtils.isEmpty(results) ? null : results;
}
public static List<HGSC006A> otherById(String orderCode,Long orderDetailId) {
public static List<HGSC006A> otherById(String orderCode, Long orderDetailId) {
AssertUtils.isEmpty(orderCode, "订单编号不能为空!");
AssertUtils.isTrue(Objects.isNull(orderDetailId)||orderDetailId<=0, "生产订单明细ID不能为空!");
AssertUtils.isTrue(Objects.isNull(orderDetailId) || orderDetailId <= 0, "生产订单明细ID不能为空!");
Map paramMap = new HashMap();
paramMap.put(HGSC006A.FIELD_order_code, orderCode);
paramMap.put(HGSC006A.FIELD_id, orderDetailId);
......@@ -1302,12 +1302,23 @@ public class HGSCTools {
}
}
public static class THGSC007{
public static HGSC007 getById(Long taskId){
AssertUtils.isTrue(Objects.isNull(taskId)||taskId<=0, "生产任务ID不能为空!");
HGSC007 results = (HGSC007)DaoBase.getInstance().get(HGSC007.QUERY, HGSC007.FIELD_id, taskId);
return results;
/**
* @author:songx
* @date:2024/9/8,9:41
*/
public static class THGSC007 {
/**
* get
*
* @param taskId
* @return
*/
public static HGSC007 getById(Long taskId) {
AssertUtils.isTrue(Objects.isNull(taskId) || taskId <= 0, "生产任务ID不能为空!");
return (HGSC007) DaoBase.getInstance().get(HgScSqlConstant.HgSc007.GET, HGSC007.FIELD_id, taskId);
}
/**
* 锁
*
......@@ -1339,28 +1350,30 @@ public class HGSCTools {
}
}
public static class THGSC008{
public static HGSC008 getById(Long taskId){
AssertUtils.isTrue(Objects.isNull(taskId)||taskId<=0, "报工单ID不能为空!");
HGSC008 results = (HGSC008)DaoBase.getInstance().get(HGSC008.QUERY, HGSC008.FIELD_id, taskId);
public static class THGSC008 {
public static HGSC008 getById(Long taskId) {
AssertUtils.isTrue(Objects.isNull(taskId) || taskId <= 0, "报工单ID不能为空!");
HGSC008 results = (HGSC008) DaoBase.getInstance().get(HGSC008.QUERY, HGSC008.FIELD_id, taskId);
return results;
}
public static List<HGSC008> getByTaskId(Long taskId){
AssertUtils.isTrue(Objects.isNull(taskId)||taskId<=0, "生产任务ID不能为空!");
List<HGSC008> results = DaoBase.getInstance().query(HGSC008.QUERY, new HashMap<String,Object>(){{put(HGSC008.FIELD_task_id, taskId);}});
public static List<HGSC008> getByTaskId(Long taskId) {
AssertUtils.isTrue(Objects.isNull(taskId) || taskId <= 0, "生产任务ID不能为空!");
List<HGSC008> results = DaoBase.getInstance().query(HGSC008.QUERY, new HashMap<String, Object>() {{
put(HGSC008.FIELD_task_id, taskId);
}});
return CollectionUtils.isEmpty(results) ? null : results;
}
public static HGSC008 add(EiInfo info){
public static HGSC008 add(EiInfo info) {
Map resultMap = EiInfoUtils.getFirstRow(info, EiConstant.resultBlock);
String taskId = MapUtils.getString(resultMap, HGSC008.FIELD_task_id);
HGSC007 hgsc007 = HGSCTools.THGSC007.getById(Long.valueOf(taskId));
HGSC008 hgsc008 = new HGSC008();
BeanUtils.copyProperties(hgsc007,hgsc008);
BeanUtils.copyProperties(hgsc007, hgsc008);
cleanBaseInfo(hgsc008);
hgsc008.setTaskId(hgsc007.getId());
hgsc008.setQuantity(NumberUtils.toInteger(resultMap.get(HGSC008.FIELD_quantity)));
......
......@@ -55,9 +55,11 @@
A.DEP_CODE = #authDepCode#
</isNotEmpty>
<!-- 仅本人和部门组合 -->
<isEqual prepend=" AND " property="authCombination" compareValue="1">
(A.CREATED_BY = #authOnlyPeople# OR A.DEP_CODE IN <iterate close=")" open="(" conjunction=","
property="authDepCodes">#authDepCodes[]#</iterate>)
<isEqual prepend=" AND " property="authCombination" compareValue="1" open="(" close=")">
A.CREATED_BY = #authOnlyPeople# OR A.DEP_CODE IN
<iterate close=")" open="(" conjunction="," property="authDepCodes">
#authDepCodes[]#
</iterate>
</isEqual>
<!-- 仅本人或部门 -->
<isNotEqual prepend=" AND " property="authCombination" compareValue="1">
......@@ -66,7 +68,9 @@
</isNotEmpty>
<isNotEmpty property="authDepCodes">
A.DEP_CODE IN
<iterate close=")" open="(" conjunction="," property="authDepCodes">#authDepCodes[]#</iterate>
<iterate close=")" open="(" conjunction="," property="authDepCodes">
#authDepCodes[]#
</iterate>
</isNotEmpty>
</isNotEqual>
</sql>
......
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