Commit d3fbebea by liuyang

2024-04-30 优化报工管理工厂下拉框排序和新增过滤

parent f670d693
......@@ -274,7 +274,7 @@
</update>
<select id="queryFactoryCodeBox" parameterClass="java.util.HashMap" resultClass="java.util.HashMap">
SELECT distinct
SELECT
FACTORY_CODE as "factoryCode",
FACTORY_NAME as "factoryName"
FROM ${platSchema}.txsog01
......@@ -283,7 +283,7 @@
COMPANY_CODE = #companyCode#
<!--and ORG_ID IN (<include refid="queryLoginNameBase"/>)-->
</isNotEmpty>
ORDER BY FACTORY_CODE,REC_CREATE_TIME desc
ORDER BY FACTORY_CODE asc ,REC_CREATE_TIME desc
</select>
<select id="queryGroupCodeBox" parameterClass="java.util.HashMap" resultClass="java.util.HashMap">
......
......@@ -6,10 +6,7 @@ import com.baosight.hpjx.core.constant.CommonConstant;
import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.hp.sc.domain.HPSC010;
import com.baosight.hpjx.hp.sc.domain.HPSC010A;
import com.baosight.hpjx.util.CommonMethod;
import com.baosight.hpjx.util.ErrorCodeUtils;
import com.baosight.hpjx.util.LogUtils;
import com.baosight.hpjx.util.StringUtil;
import com.baosight.hpjx.util.*;
import com.baosight.hpjx.util.contants.ACConstants;
import com.baosight.iplat4j.core.ei.EiBlock;
import com.baosight.iplat4j.core.ei.EiConstant;
......@@ -165,9 +162,7 @@ public class ServiceHPSC010 extends ServiceEPBase {
public void queryFactoryCode(EiInfo inInfo,Map<String,Object> queryMap){
List<HPSC010> hpsc010List = this.dao.query(HPSC010.QUERY,queryMap);
if (hpsc010List.size() > 0) {
inInfo.setDetailMsg("当前数据以存在,添加失败!");
throw new PlatException("E_Plat_InsertError",new Exception(),inInfo);
}
AssertUtils.isNotEmpty(hpsc010List, String.format("日期[%s]工厂数据以存在,添加失败!",
queryMap.get(HPSC010.FIELD_REGISTER_DATE)));
}
}
\ No newline at end of file
......@@ -154,6 +154,10 @@ public class ServiceHPSC096 extends ServiceEPBase {
for (Map map1:list) {
hpsc010A.setParentId((Long) map1.get(HPSC010.FIELD_ID));
}
/*BigDecimal result = hpsc010A.getWeightJh().add(hpsc010A.getWeight());*/
if (hpsc010A.getPrdtName().trim().length()==0){
continue;
}
DaoUtils.insert(HPSC010A.INSERT, hpsc010A);
}
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
......@@ -181,6 +185,7 @@ public class ServiceHPSC096 extends ServiceEPBase {
List<HPSC010A> listHpsc009 = new ArrayList<HPSC010A>();
if (listFactoryCode.size()>0){
queryMap.put(HPSC010.FIELD_FACTORY_CODE,listFactoryCode.get(0).get("factoryCode"));
queryMap.put(HPSC010.FIELD_DELETE_FLAG,CommonConstant.YesNo.NO_0);
queryMap.put("registerDates","select max(REGISTER_DATE) from hpjx.T_HPSC009 where COMPANY_CODE = '"+UserSessionUtils.getCompanyCode()+"' and FACTORY_CODE = '"+listFactoryCode.get(0).get("factoryCode")+"' AND DELETE_FLAG = 0");
listHpsc009 = this.dao.query(HPSC010A.QUERY,queryMap);
}
......@@ -223,10 +228,12 @@ public class ServiceHPSC096 extends ServiceEPBase {
List<HPSC010A> resultList = this.dao.query(HPSC010A.QUERY,new HashMap<String,Object>(){{
put(HPSC010A.FIELD_PARENT_ID,id);
put(HPSC010A.FIELD_GROUP_TYPE,"1");
put(HPSC010A.FIELD_DELETE_FLAG,CommonConstant.YesNo.NO_0);
}},EiConstant.defaultOffset,100);
List<HPSC010A> detailList = this.dao.query(HPSC010A.QUERY,new HashMap<String,Object>(){{
put(HPSC010A.FIELD_PARENT_ID,id);
put(HPSC010A.FIELD_GROUP_TYPE,"0");
put(HPSC010A.FIELD_DELETE_FLAG,CommonConstant.YesNo.NO_0);
}},EiConstant.defaultOffset,100);
Map queryMap = new HashMap();
queryMap.put("loginName", UserSession.getLoginName());
......
......@@ -364,7 +364,7 @@
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
CREATED_TIME desc
FACTORY_CODE desc
</isEmpty>
</dynamic>
......
......@@ -317,26 +317,26 @@
<select id="queryMax" parameterClass="java.util.HashMap" resultClass="java.util.HashMap">
SELECT
ID as "id", <!-- ID -->
COMPANY_CODE as "companyCode", <!-- 企业编码 -->
DEP_CODE as "depCode", <!-- 部门编码 -->
CREATED_BY as "createdBy", <!-- 创建人 -->
CREATED_NAME as "createdName", <!-- 创建名称 -->
MAX(CREATED_TIME) as "createdTime", <!-- 创建时间 -->
UPDATED_BY as "updatedBy", <!-- 修改人 -->
UPDATED_NAME as "updatedName", <!-- 修改名称 -->
UPDATED_TIME as "updatedTime", <!-- 修改时间 -->
DELETE_FLAG as "deleteFlag", <!-- 是否删除 0-否1-是 -->
REGISTER_DATE as "registerDate", <!-- 登记日期 -->
FACTORY_CODE as "factoryCode", <!-- 工厂代码 -->
WEIGHT as "weight", <!-- 产量 -->
USER_COUNT as "userCount" <!-- 用工人数 -->
ID as "id", <!-- ID -->
COMPANY_CODE as "companyCode", <!-- 企业编码 -->
DEP_CODE as "depCode", <!-- 部门编码 -->
CREATED_BY as "createdBy", <!-- 创建人 -->
CREATED_NAME as "createdName", <!-- 创建名称 -->
CREATED_TIME as "createdTime", <!-- 创建时间 -->
UPDATED_BY as "updatedBy", <!-- 修改人 -->
UPDATED_NAME as "updatedName", <!-- 修改名称 -->
UPDATED_TIME as "updatedTime", <!-- 修改时间 -->
DELETE_FLAG as "deleteFlag", <!-- 是否删除 0-否1-是 -->
REGISTER_DATE as "registerDate", <!-- 登记日期 -->
FACTORY_CODE as "factoryCode", <!-- 工厂代码 -->
WEIGHT as "weight", <!-- 产量 -->
USER_COUNT as "userCount" <!-- 用工人数 -->
FROM ${hpjxSchema}.T_HPSC008 WHERE 1=1
<include refid="authCondition" />
<isNotEmpty prepend=" AND " property="companyCode">
CREATED_TIME IN (
select MAX(CREATED_TIME)
from hpjx.T_HPSC008
from ${hpjxSchema}.T_HPSC008
where 1=1
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
......@@ -347,6 +347,12 @@
<isNotEmpty prepend=" AND " property="factoryCode">
FACTORY_CODE = #factoryCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deleteFlag">
DELETE_FLAG = #deleteFlag#
</isNotEmpty>
<isEmpty prepend=" AND " property="deleteFlag">
DELETE_FLAG = 0
</isEmpty>
)
</isNotEmpty>
<include refid="condition" />
......
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