Commit 84e67b8b by 宋祥

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

parents 0864165b 803e53fd
package com.baosight.hpjx.aspect.annotation;
import com.baosight.hpjx.aspect.domain.TCPReceive;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.web.controller.WebDispatchController;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
@CrossOrigin
@RestController
@RequestMapping("/tcp")
public class TCPController extends WebDispatchController {
private final static Logger logger = LoggerFactory.getLogger(DocController.class);
@RequestMapping(value = "/receive/api", method = RequestMethod.POST)
public void tcpReceive(TCPReceive tcpReceive) {
logger.info("receive tcp deviceNo: " + tcpReceive.getDeviceNo());
logger.info("receive tcp msgType: " + tcpReceive.getMsgType());
logger.info("receive tcp msgContent: " + tcpReceive.getMsgContent());
}
}
package com.baosight.hpjx.aspect.domain;
public class TCPReceive {
private String deviceNo;
private String msgType;
private String msgContent;
public String getDeviceNo() {
return deviceNo;
}
public void setDeviceNo(String deviceNo) {
this.deviceNo = deviceNo;
}
public String getMsgType() {
return msgType;
}
public void setMsgType(String msgType) {
this.msgType = msgType;
}
public String getMsgContent() {
return msgContent;
}
public void setMsgContent(String msgContent) {
this.msgContent = msgContent;
}
}
......@@ -351,6 +351,12 @@ public enum DdynamicEnum {
*/
GROUP_RECORD1_BLOCK_ID("group_record_block_id","orgId","orgCname","HPSC010.queryGroupComboBox"),
FACTORY_CODE_BOX_BLOCK_ID("factoryCodeBox_block_id","factoryCode","factoryName","HPSB003.queryFactoryCodeBox"),
GROUP_CODE_BOX_BLOCK_ID("groupCodeBox_block_id","groupCode","groupName","factoryCode","factoryName","HPSB003.queryGroupCodeBox"),
USER_ID_BOX_BLOCK_ID("userIdBox_block_id","userId","userName","HPSB003.queryUserIdBox"),
/**
* 模块:工人管理
* 用途:工人管理下拉框
......
package com.baosight.hpjx.controller;
import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.equipment.hp.domain.CutterbarStatus;
import com.baosight.hpjx.equipment.hp.domain.CutterbarWarning;
import com.baosight.hpjx.equipment.hp.domain.CutterbarWarningBase;
import com.baosight.hpjx.hp.sb.domain.HPSB001;
import com.baosight.hpjx.hp.sb.domain.HPSB002;
import com.baosight.hpjx.hp.sb.domain.HPSB00A;
import com.baosight.hpjx.util.StringUtils;
import com.baosight.hpjx.xml.XmlUtils;
import com.baosight.iplat4j.core.service.impl.ServiceBase;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import java.util.List;
@Controller
@CrossOrigin
@RequestMapping({"/log/information"})
public class LogInformationController extends ServiceBase {
@RequestMapping({"/analysis"})
public String logAnalysis(@PathVariable HPSB00A hpsb00A) {
HPSB002 hpsb002 = new HPSB002();
HPSB001 hpsb001 = new HPSB001();
//解析设备状态
List<CutterbarStatus> cutterbarStatusList = XmlUtils.readXml(hpsb00A.getEquipmentType(), CutterbarStatus.class);
//解析数据内容
List<CutterbarWarningBase> cutterbarWarningBaseList = XmlUtils.readXml(hpsb00A.getDataContent(), CutterbarWarningBase.class);
CutterbarWarning cutterbarWarning = new CutterbarWarning();
if (CollectionUtils.isNotEmpty(cutterbarWarningBaseList)) {
cutterbarWarning = CutterbarWarning.convertBase(cutterbarWarningBaseList.get(0));
}
if (cutterbarStatusList.get(0).getStatus() == 1) {
hpsb001.setId(StringUtils.uuid());
hpsb001.setErrorCode(cutterbarWarning.getErrorCode());
hpsb001.setPrio(cutterbarWarning.getPrio());
hpsb001.setProgramNo(cutterbarWarning.getProgramNo());
hpsb001.setRowno(cutterbarWarning.getRowNo());
hpsb001.setGotoRowNone(cutterbarWarning.getGotoRowNone());
hpsb001.setFileName(cutterbarWarning.getFileName());
hpsb001.setEquipmentCode(hpsb00A.getEquipmentCode());
hpsb001.setEquipmentType(cutterbarStatusList.get(0).getStatus().toString());
DaoUtils.insert("HPSB001.insert", hpsb001);
return "设备异常日志记录成功";
}
hpsb002.setId(StringUtils.uuid());
hpsb002.setProgramNo(cutterbarWarning.getProgramNo());
hpsb002.setErrorCode(cutterbarWarning.getErrorCode());
hpsb002.setPrio(cutterbarWarning.getPrio());
hpsb002.setRowno(cutterbarWarning.getRowNo());
hpsb002.setGotoRowNone(cutterbarWarning.getGotoRowNone());
hpsb002.setFileName(cutterbarWarning.getFileName());
hpsb002.setEquipmentCode(hpsb00A.getEquipmentCode());
hpsb002.setEquipmentType(cutterbarStatusList.get(0).getStatus().toString());
DaoUtils.insert("HPSB002.insert", hpsb002);
return "设备日志记录成功";
}
}
......@@ -24,6 +24,7 @@ import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import java.math.BigDecimal;
import java.text.DecimalFormat;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
......@@ -107,7 +108,9 @@ public class ServiceHPKC004A extends ServiceEPBase {
newKc004.setSaleNo(SequenceGenerator.getNextSequence(HPConstant.SequenceId.HPKC004_SALE_NO));
newKc004.setReceiptDate(DateUtils.shortDate());
newKc004.setAmount(applyAmount);
newKc004.setWeight(applyAmount.multiply(dbKc011.getUnitWeight()).divide(new BigDecimal("1000")));
DecimalFormat decimalFormat = new DecimalFormat("#.000");
BigDecimal totalWt = new BigDecimal(decimalFormat.format(applyAmount.multiply(dbKc011.getUnitWeight()).divide(new BigDecimal("1000"))));
newKc004.setWeight(totalWt);
newKc004.setRemark(applyRemark);
newKc004.setKcId(kcId);
newKc004.setIsPrint(CommonConstant.YesNo.NO_0);
......
......@@ -113,7 +113,7 @@
SELECT <include refid="column"/>
FROM hpjx.T_HPKC011 a
JOIN hpjx.T_HPSC001 b on a.PROJ_CODE = b.PROJ_CODE
WHERE 1=1
WHERE 1=1 AND a.AMOUNT!=0
<include refid="condition"/>
<include refid="customCondition"/>
<dynamic prepend="ORDER BY">
......@@ -147,7 +147,7 @@
SELECT <include refid="column"/>
FROM hpjx.T_HPKC011 a
JOIN hpjx.T_HPSC001 b on a.PROJ_CODE = b.PROJ_CODE
WHERE 1=1
WHERE 1=1 AND a.AMOUNT!=0
<include refid="condition"/>
<include refid="customCondition"/>
</select>
......@@ -156,7 +156,7 @@
SELECT COUNT(*)
FROM hpjx.T_HPKC011 a
JOIN hpjx.T_HPSC001 b on a.PROJ_CODE = b.PROJ_CODE
WHERE 1=1
WHERE 1=1 AND a.AMOUNT!=0
<include refid="condition"/>
<include refid="customCondition"/>
</select>
......
......@@ -92,8 +92,11 @@ public class ServiceHPMT001 extends ServiceBase {
resultMap.put("targetWt_s", 0);//目标环比值
resultMap.put("target_s_qoq", 0);//目标环比
} else {
resultMap.put("targetWt_s", row3.get(0).get("targetWt"));
BigDecimal targetWt = (BigDecimal) row1.get(0).get("targetWt");
resultMap.put("targetWt_s", row3.get(0).get("targetWt"));
BigDecimal targetWt = BigDecimal.ZERO;
if(row1.get(0).get("targetWt")!=null){
targetWt = (BigDecimal) row1.get(0).get("targetWt");
}
BigDecimal targetWt2 = (BigDecimal) row3.get(0).get("targetWt");
resultMap.put("target_s_qoq", targetWt.subtract(targetWt2).divide(targetWt2,BigDecimal.ROUND_UP).
multiply(new BigDecimal(100)).doubleValue());
......
......@@ -4,7 +4,7 @@
<select id="pmOverview1" resultClass="java.util.HashMap">
SELECT
CAST(SUM(NUM*UNIT_WT) AS DECIMAL(15,3)) AS targetWt
CAST(SUM(NUM*UNIT_WT)/1000 AS DECIMAL(15,3)) AS targetWt
FROM
hpjx.t_hpsc004
WHERE
......
......@@ -12,11 +12,11 @@
from (select
(select sum(USER_COUNT)
FROM hpjx.t_hpsc008
where COMPANY_CODE = #companyCode# and REGISTER_DATE = #date# and FACTORY_CODE = #factorycode# ) as YGL,
where DELETE_FLAG = 0 and COMPANY_CODE = #companyCode# and REGISTER_DATE = #date# and FACTORY_CODE = #factorycode# ) as YGL,
0 as JHCL,
(select sum(WEIGHT)
FROM hpjx.t_hpsc008
where COMPANY_CODE = #companyCode# and REGISTER_DATE = #date# and FACTORY_CODE = #factorycode# ) as SJCL
where DELETE_FLAG = 0 and COMPANY_CODE = #companyCode# and REGISTER_DATE = #date# and FACTORY_CODE = #factorycode# ) as SJCL
from dual) a
</select>
......@@ -29,10 +29,10 @@
else concat(format(ifnull(SJCL,0)/ifnull(YGL,0),2),'T') end as LJRJCL
from (select
(select sum(USER_COUNT) FROM hpjx.t_hpsc008
where COMPANY_CODE = #companyCode# and left(REGISTER_DATE,6) = left(#date#,6) and REGISTER_DATE <![CDATA[<=]]> #date# and FACTORY_CODE = #factorycode# ) as YGL,
where DELETE_FLAG = 0 and COMPANY_CODE = #companyCode# and left(REGISTER_DATE,6) = left(#date#,6) and REGISTER_DATE <![CDATA[<=]]> #date# and FACTORY_CODE = #factorycode# ) as YGL,
0 as JHCL,
(select sum(WEIGHT) FROM hpjx.t_hpsc008
where COMPANY_CODE = #companyCode# and left(REGISTER_DATE,6) = left(#date#,6) and REGISTER_DATE <![CDATA[<=]]> #date# and FACTORY_CODE = #factorycode# ) as SJCL
where DELETE_FLAG = 0 and COMPANY_CODE = #companyCode# and left(REGISTER_DATE,6) = left(#date#,6) and REGISTER_DATE <![CDATA[<=]]> #date# and FACTORY_CODE = #factorycode# ) as SJCL
from dual) a
</select>
......@@ -46,13 +46,13 @@
from (select
(select
sum(USER_COUNT)
FROM hpjx.t_hpsc008
where COMPANY_CODE = #companyCode# and left(REGISTER_DATE,6) = left(#date#,4) and REGISTER_DATE <![CDATA[<=]]> #date# and FACTORY_CODE = #factorycode# ) as YGL,
from hpjx.t_hpsc008
where DELETE_FLAG = 0 and COMPANY_CODE = #companyCode# and left(REGISTER_DATE,4) = left(#date#,4) and REGISTER_DATE <![CDATA[<=]]> #date# and FACTORY_CODE = #factorycode# ) as YGL,
0 as JHCL,
(select
sum(WEIGHT)
FROM hpjx.t_hpsc008
where COMPANY_CODE = #companyCode# and left(REGISTER_DATE,6) = left(#date#,4) and REGISTER_DATE <![CDATA[<=]]> #date# and FACTORY_CODE = #factorycode# ) as SJCL
from hpjx.t_hpsc008
where DELETE_FLAG = 0 and COMPANY_CODE = #companyCode# and left(REGISTER_DATE,4) = left(#date#,4) and REGISTER_DATE <![CDATA[<=]]> #date# and FACTORY_CODE = #factorycode# ) as SJCL
from dual) a
</select>
......@@ -62,14 +62,14 @@
concat(format(ifnull(JH,0),2),'T') as JH,
concat(format(ifnull(ZH,0),2),'T') as ZH
from (select
(select sum(WEIGHT) FROM hpjx.T_HPXS001
where GROUP_TYPE = '2' and COMPANY_CODE = #companyCode# and REGISTER_DATE = #date# and FACTORY_CODE = #factorycode#
(select sum(WEIGHT) FROM hpjx.t_hpsc009
where DELETE_FLAG = 0 and COMPANY_CODE = #companyCode# and REGISTER_DATE = #date# and FACTORY_CODE = #factorycode#
group by FACTORY_CODE) as ZP,
(select sum(WEIGHT) FROM hpjx.T_HPXS001
where GROUP_TYPE = '1' and COMPANY_CODE = #companyCode# and REGISTER_DATE = #date# and FACTORY_CODE = #factorycode#
(select sum(WEIGHT_JH) FROM hpjx.t_hpsc009
where DELETE_FLAG = 0 and COMPANY_CODE = #companyCode# and REGISTER_DATE = #date# and FACTORY_CODE = #factorycode#
group by FACTORY_CODE) as JH,
(select sum(WEIGHT)/2 FROM hpjx.T_HPXS001
where COMPANY_CODE = #companyCode# and REGISTER_DATE = #date# and FACTORY_CODE = #factorycode#
(select sum(ifnull(WEIGHT,0)+ifnull(WEIGHT_JH,0))/2 FROM hpjx.t_hpsc009
where DELETE_FLAG = 0 and COMPANY_CODE = #companyCode# and REGISTER_DATE = #date# and FACTORY_CODE = #factorycode#
group by FACTORY_CODE) as ZH
from dual) a
</select>
......@@ -91,13 +91,13 @@
join iplat.TXSOG01 b on a.ORG_ID = b.PARENT_ORG_ID
join iplat.TXSOG01 c on b.ORG_ID = c.PARENT_ORG_ID
where a.ORG_TYPE = 'factory' and b.ORG_TYPE = 'dept' and c.ORG_TYPE = 'prodGroup' and a.IS_DELETED = 0 and b.IS_DELETED =0 and c.IS_DELETED = 0) a
left join hpjx.T_HPXS001 b on b.FACTORY_CODE = a.FACTORY_CODE and b.GROUP_CODE = a.GROUP_CODE and b.COMPANY_CODE = #companyCode# and b.REGISTER_DATE = #date# and b.FACTORY_CODE = #factorycode# and b.GROUP_TYPE = '2'
left join hpjx.t_hpsc009 b on b.FACTORY_CODE = a.FACTORY_CODE and b.GROUP_CODE = a.GROUP_CODE and b.COMPANY_CODE = #companyCode# and b.REGISTER_DATE = #date# and b.FACTORY_CODE = #factorycode# and b.DELETE_FLAG = 0
group by a.GROUP_NAME,b.GROUP_TYPE
union all
select
'加焊' as SERIES,
a.GROUP_NAME as X,
ifnull(sum(WEIGHT),0) as VALUE,
ifnull(sum(WEIGHT_JH),0) as VALUE,
case when right(a.GROUP_NAME,2) = '一组' then 1
when right(a.GROUP_NAME,2) = '二组' then 2
when right(a.GROUP_NAME,2) = '三组' then 3
......@@ -108,13 +108,13 @@
join iplat.TXSOG01 b on a.ORG_ID = b.PARENT_ORG_ID
join iplat.TXSOG01 c on b.ORG_ID = c.PARENT_ORG_ID
where a.ORG_TYPE = 'factory' and b.ORG_TYPE = 'dept' and c.ORG_TYPE = 'prodGroup' and a.IS_DELETED = 0 and b.IS_DELETED =0 and c.IS_DELETED = 0) a
left join hpjx.T_HPXS001 b on b.FACTORY_CODE = a.FACTORY_CODE and b.GROUP_CODE = a.GROUP_CODE and b.COMPANY_CODE = #companyCode# and b.REGISTER_DATE = #date# and b.FACTORY_CODE = #factorycode# and b.GROUP_TYPE = '1'
left join hpjx.t_hpsc009 b on b.FACTORY_CODE = a.FACTORY_CODE and b.GROUP_CODE = a.GROUP_CODE and b.COMPANY_CODE = #companyCode# and b.REGISTER_DATE = #date# and b.FACTORY_CODE = #factorycode# and b.DELETE_FLAG = 0
group by a.GROUP_NAME,b.GROUP_TYPE
union all
select
'综合' as SERIES,
a.GROUP_NAME as X,
ifnull(sum(WEIGHT),0)/2 as VALUE,
sum(ifnull(WEIGHT,0)+ifnull(WEIGHT_JH,0))/2 as VALUE,
case when right(a.GROUP_NAME,2) = '一组' then 1
when right(a.GROUP_NAME,2) = '二组' then 2
when right(a.GROUP_NAME,2) = '三组' then 3
......@@ -125,7 +125,7 @@
join iplat.TXSOG01 b on a.ORG_ID = b.PARENT_ORG_ID
join iplat.TXSOG01 c on b.ORG_ID = c.PARENT_ORG_ID
where a.ORG_TYPE = 'factory' and b.ORG_TYPE = 'dept' and c.ORG_TYPE = 'prodGroup' and a.IS_DELETED = 0 and b.IS_DELETED =0 and c.IS_DELETED = 0) a
left join hpjx.T_HPXS001 b on b.FACTORY_CODE = a.FACTORY_CODE and b.GROUP_CODE = a.GROUP_CODE and b.COMPANY_CODE = #companyCode# and b.REGISTER_DATE = #date# and b.FACTORY_CODE = #factorycode#
left join hpjx.t_hpsc009 b on b.FACTORY_CODE = a.FACTORY_CODE and b.GROUP_CODE = a.GROUP_CODE and b.COMPANY_CODE = #companyCode# and b.REGISTER_DATE = #date# and b.FACTORY_CODE = #factorycode# and b.DELETE_FLAG = 0
group by a.GROUP_NAME) a
order by SORT,SORT1 asc
</select>
......@@ -138,7 +138,7 @@
join iplat.TXSOG01 b on a.ORG_ID = b.PARENT_ORG_ID
join iplat.TXSOG01 c on b.ORG_ID = c.PARENT_ORG_ID
where a.ORG_TYPE = 'factory' and b.ORG_TYPE = 'dept' and c.ORG_TYPE = 'prodGroup' and a.IS_DELETED = 0 and b.IS_DELETED =0 and c.IS_DELETED = 0) a
left join hpjx.T_HPXS001 b on a.GROUP_CODE = b.GROUP_CODE and b.REGISTER_DATE = #date#
left join hpjx.t_hpsc009 b on a.GROUP_CODE = b.GROUP_CODE and b.REGISTER_DATE = #date# and b.DELETE_FLAG = 0
where a.COMPANY_CODE = #companyCode# and a.FACTORY_CODE = #factorycode#
group by a.GROUP_NAME,a.GROUP_CODE
order by a.GROUP_CODE
......@@ -150,7 +150,7 @@
select
a.GROUP_NAME as SERIES,
concat(substring(replace(date_sub(str_to_date(#date#,'%Y%m%d'), INTERVAL 4 day),'-',''),5,2),'/',substring(replace(date_sub(str_to_date(#date#,'%Y%m%d'), INTERVAL 4 day),'-',''),7,2)) as X,
ifnull(sum(WEIGHT),0) as VALUE
sum(ifnull(WEIGHT,0)+ifnull(WEIGHT_JH,0))/2 as VALUE
,replace(date_sub(str_to_date(#date#,'%Y%m%d'), INTERVAL 4 day),'-','') as date,
case when right(a.GROUP_NAME,2) = '一组' then 1
when right(a.GROUP_NAME,2) = '二组' then 2
......@@ -161,14 +161,14 @@
join iplat.TXSOG01 b on a.ORG_ID = b.PARENT_ORG_ID
join iplat.TXSOG01 c on b.ORG_ID = c.PARENT_ORG_ID
where a.ORG_TYPE = 'factory' and b.ORG_TYPE = 'dept' and c.ORG_TYPE = 'prodGroup' and a.IS_DELETED = 0 and b.IS_DELETED =0 and c.IS_DELETED = 0) a
left join hpjx.T_HPXS001 b on b.FACTORY_CODE = a.FACTORY_CODE and b.GROUP_CODE = a.GROUP_CODE and b.COMPANY_CODE = #companyCode#
left join hpjx.t_hpsc009 b on b.FACTORY_CODE = a.FACTORY_CODE and b.GROUP_CODE = a.GROUP_CODE and b.COMPANY_CODE = #companyCode# and b.DELETE_FLAG = 0
and b.REGISTER_DATE = replace(date_sub(str_to_date(#date#,'%Y%m%d'), INTERVAL 4 day),'-','') and b.FACTORY_CODE = #factorycode#
group by a.GROUP_NAME,b.REGISTER_DATE
union all
select
a.GROUP_NAME as SERIES,
concat(substring(replace(date_sub(str_to_date(#date#,'%Y%m%d'), INTERVAL 3 day),'-',''),5,2),'/',substring(replace(date_sub(str_to_date(#date#,'%Y%m%d'), INTERVAL 3 day),'-',''),7,2)) as X,
ifnull(sum(WEIGHT),0) as VALUE
sum(ifnull(WEIGHT,0)+ifnull(WEIGHT_JH,0))/2 as VALUE
,replace(date_sub(str_to_date(#date#,'%Y%m%d'), INTERVAL 3 day),'-','') as date,
case when right(a.GROUP_NAME,2) = '一组' then 1
when right(a.GROUP_NAME,2) = '二组' then 2
......@@ -179,14 +179,14 @@
join iplat.TXSOG01 b on a.ORG_ID = b.PARENT_ORG_ID
join iplat.TXSOG01 c on b.ORG_ID = c.PARENT_ORG_ID
where a.ORG_TYPE = 'factory' and b.ORG_TYPE = 'dept' and c.ORG_TYPE = 'prodGroup' and a.IS_DELETED = 0 and b.IS_DELETED =0 and c.IS_DELETED = 0) a
left join hpjx.T_HPXS001 b on b.FACTORY_CODE = a.FACTORY_CODE and b.GROUP_CODE = a.GROUP_CODE and b.COMPANY_CODE = #companyCode#
left join hpjx.t_hpsc009 b on b.FACTORY_CODE = a.FACTORY_CODE and b.GROUP_CODE = a.GROUP_CODE and b.COMPANY_CODE = #companyCode# and b.DELETE_FLAG = 0
and b.REGISTER_DATE = replace(date_sub(str_to_date(#date#,'%Y%m%d'), INTERVAL 3 day),'-','') and b.FACTORY_CODE = #factorycode#
group by a.GROUP_NAME,b.REGISTER_DATE
union all
select
a.GROUP_NAME as SERIES,
concat(substring(replace(date_sub(str_to_date(#date#,'%Y%m%d'), INTERVAL 2 day),'-',''),5,2),'/',substring(replace(date_sub(str_to_date(#date#,'%Y%m%d'), INTERVAL 2 day),'-',''),7,2)) as X,
ifnull(sum(WEIGHT),0) as VALUE
sum(ifnull(WEIGHT,0)+ifnull(WEIGHT_JH,0))/2 as VALUE
,replace(date_sub(str_to_date(#date#,'%Y%m%d'), INTERVAL 2 day),'-','') as date,
case when right(a.GROUP_NAME,2) = '一组' then 1
when right(a.GROUP_NAME,2) = '二组' then 2
......@@ -197,14 +197,14 @@
join iplat.TXSOG01 b on a.ORG_ID = b.PARENT_ORG_ID
join iplat.TXSOG01 c on b.ORG_ID = c.PARENT_ORG_ID
where a.ORG_TYPE = 'factory' and b.ORG_TYPE = 'dept' and c.ORG_TYPE = 'prodGroup' and a.IS_DELETED = 0 and b.IS_DELETED =0 and c.IS_DELETED = 0) a
left join hpjx.T_HPXS001 b on b.FACTORY_CODE = a.FACTORY_CODE and b.GROUP_CODE = a.GROUP_CODE and b.COMPANY_CODE = #companyCode#
left join hpjx.t_hpsc009 b on b.FACTORY_CODE = a.FACTORY_CODE and b.GROUP_CODE = a.GROUP_CODE and b.COMPANY_CODE = #companyCode# and b.DELETE_FLAG = 0
and b.REGISTER_DATE = replace(date_sub(str_to_date(#date#,'%Y%m%d'), INTERVAL 2 day),'-','') and b.FACTORY_CODE = #factorycode#
group by a.GROUP_NAME,b.REGISTER_DATE
union all
select
a.GROUP_NAME as SERIES,
concat(substring(replace(date_sub(str_to_date(#date#,'%Y%m%d'), INTERVAL 1 day),'-',''),5,2),'/',substring(replace(date_sub(str_to_date(#date#,'%Y%m%d'), INTERVAL 1 day),'-',''),7,2)) as X,
ifnull(sum(WEIGHT),0) as VALUE
sum(ifnull(WEIGHT,0)+ifnull(WEIGHT_JH,0))/2 as VALUE
,replace(date_sub(str_to_date(#date#,'%Y%m%d'), INTERVAL 1 day),'-','') as date,
case when right(a.GROUP_NAME,2) = '一组' then 1
when right(a.GROUP_NAME,2) = '二组' then 2
......@@ -215,14 +215,14 @@
join iplat.TXSOG01 b on a.ORG_ID = b.PARENT_ORG_ID
join iplat.TXSOG01 c on b.ORG_ID = c.PARENT_ORG_ID
where a.ORG_TYPE = 'factory' and b.ORG_TYPE = 'dept' and c.ORG_TYPE = 'prodGroup' and a.IS_DELETED = 0 and b.IS_DELETED =0 and c.IS_DELETED = 0) a
left join hpjx.T_HPXS001 b on b.FACTORY_CODE = a.FACTORY_CODE and b.GROUP_CODE = a.GROUP_CODE and b.COMPANY_CODE = #companyCode#
left join hpjx.t_hpsc009 b on b.FACTORY_CODE = a.FACTORY_CODE and b.GROUP_CODE = a.GROUP_CODE and b.COMPANY_CODE = #companyCode# and b.DELETE_FLAG = 0
and b.REGISTER_DATE = replace(date_sub(str_to_date(#date#,'%Y%m%d'), INTERVAL 1 day),'-','') and b.FACTORY_CODE = #factorycode#
group by a.GROUP_NAME,b.REGISTER_DATE
union all
select
a.GROUP_NAME as SERIES,
concat(substring(#date#,5,2),'/',substring(#date#,7,2)) as X,
ifnull(sum(WEIGHT),0) as VALUE
sum(ifnull(WEIGHT,0)+ifnull(WEIGHT_JH,0))/2 as VALUE
,#date# as date,
case when right(a.GROUP_NAME,2) = '一组' then 1
when right(a.GROUP_NAME,2) = '二组' then 2
......@@ -233,7 +233,7 @@
join iplat.TXSOG01 b on a.ORG_ID = b.PARENT_ORG_ID
join iplat.TXSOG01 c on b.ORG_ID = c.PARENT_ORG_ID
where a.ORG_TYPE = 'factory' and b.ORG_TYPE = 'dept' and c.ORG_TYPE = 'prodGroup' and a.IS_DELETED = 0 and b.IS_DELETED =0 and c.IS_DELETED = 0) a
left join hpjx.T_HPXS001 b on b.FACTORY_CODE = a.FACTORY_CODE and b.GROUP_CODE = a.GROUP_CODE and b.COMPANY_CODE = #companyCode#
left join hpjx.t_hpsc009 b on b.FACTORY_CODE = a.FACTORY_CODE and b.GROUP_CODE = a.GROUP_CODE and b.COMPANY_CODE = #companyCode# and b.DELETE_FLAG = 0
and b.REGISTER_DATE = #date# and b.FACTORY_CODE = #factorycode#
group by a.GROUP_NAME
) a
......@@ -242,9 +242,11 @@
<select id="queryPmXMinfo" resultClass="java.util.HashMap">
select
select a.PROJ_NAME,a.JHDATE,a.JHCL,a.SJCL,a.SCJD,a.FHJD
from (select
a.PROJ_NAME,
concat(left(max(a.PLAN_COMPLETION_DATE),4),'年',substring(max(a.PLAN_COMPLETION_DATE),5,2),'月',right(max(a.PLAN_COMPLETION_DATE),2),'日') as JHDATE,
a.DELIVERY_DATE,
concat(left(max(a.PLAN_COMPLETION_DATE),4),'/',substring(max(a.PLAN_COMPLETION_DATE),5,2),'/',right(max(a.PLAN_COMPLETION_DATE),2)) as JHDATE,
concat(format(ifnull(sum(b.NUM*b.UNIT_WT ),0),2),'吨') as JHCL,
concat(format(ifnull(sum(c.WEIGHT),0),2),'吨') as SJCL,
concat(format((ifnull( sum( c.WEIGHT ), 0 ) / ifnull( sum( b.NUM*b.UNIT_WT ), 0 ) * 100),2),'%') as SCJD,
......@@ -254,7 +256,8 @@
left join hpjx.T_HPkC003 c on c.PROD_ORDER_NO = b.PROD_ORDER_NO
left join hpjx.T_HPkC004 d on d.PROD_NO = b.PROD_ORDER_NO
where a.COMPANY_CODE = #companyCode# and c.FACTORY_CODE = #factorycode#
group by a.PROJ_NAME
group by a.PROJ_NAME) a
where left(a.SCJD,3) <![CDATA[<>]]> '100' and left(a.FHJD,3) <![CDATA[<>]]> '100' and a.DELIVERY_DATE > DATE_FORMAT(DATE_SUB(CURRENT_DATE(), INTERVAL 3 MONTH), '%Y%m%d')
</select>
<select id="queryPmCompanyInfo" resultClass="java.util.HashMap">
......@@ -266,7 +269,7 @@
<select id="queryMaxDate" parameterClass="java.util.HashMap" resultClass="java.util.HashMap">
SELECT
MAX(REGISTER_DATE) as "registerDate" <!-- 最新登记日期 -->
FROM ${hpjxSchema}.T_HPXS001
FROM ${hpjxSchema}.t_hpsc008
WHERE 1=1 AND DELETE_FLAG = 0
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
......
/**
* Generate time : 2024-04-12 16:36:52
* Version : 1.0
*/
package com.baosight.hpjx.hp.sb.domain;
import com.baosight.iplat4j.core.util.NumberUtils;
import com.baosight.iplat4j.core.ei.EiColumn;
import com.baosight.iplat4j.core.data.DaoEPBase;
import java.util.HashMap;
import java.util.Map;
import com.baosight.iplat4j.core.util.StringUtils;
/**
* THpsb001
*
*/
public class HPSB001 extends DaoEPBase {
private String id = " "; /* ID*/
private String errorCode = " "; /* 异常编码*/
private String prio = " "; /* 异常登记*/
private String programNo = " "; /* 程序号*/
private String rowno = " "; /* 行号*/
private String gotoRowNone = " "; /* 不存在跳转行*/
private String fileName = " "; /* 文件名*/
private String equipmentType = " "; /* 设备状态*/
private String equipmentCode = " "; /* 设备编码*/
private String createdBy = " "; /* 创建人*/
private String createdName = " "; /* 创建人名称*/
private String createdTime = " "; /* 创建时间*/
private String updatedBy = " "; /* 更新人*/
private String updatedName = " "; /* 更新人名称*/
private String updatedTime = " "; /* 更新时间*/
private Integer deleteFlag = Integer.valueOf(0); /* 是否删除0.否1.是*/
/**
* initialize the metadata
*/
public void initMetaData() {
EiColumn eiColumn;
eiColumn = new EiColumn("id");
eiColumn.setPrimaryKey(true);
eiColumn.setDescName("ID");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("errorCode");
eiColumn.setDescName("异常编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("prio");
eiColumn.setDescName("异常登记");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("programNo");
eiColumn.setDescName("程序号");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("rowno");
eiColumn.setDescName("行号");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("gotoRowNone");
eiColumn.setDescName("不存在跳转行");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("fileName");
eiColumn.setDescName("文件名");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("equipmentType");
eiColumn.setDescName("设备状态");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("equipmentCode");
eiColumn.setDescName("设备编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("createdBy");
eiColumn.setDescName("创建人");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("createdName");
eiColumn.setDescName("创建人名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("createdTime");
eiColumn.setDescName("创建时间");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("updatedBy");
eiColumn.setDescName("更新人");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("updatedName");
eiColumn.setDescName("更新人名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("updatedTime");
eiColumn.setDescName("更新时间");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("deleteFlag");
eiColumn.setDescName("是否删除0.否1.是");
eiMetadata.addMeta(eiColumn);
}
/**
* the constructor
*/
public HPSB001() {
initMetaData();
}
/**
* get the id - ID
* @return the id
*/
public String getId() {
return this.id;
}
/**
* set the id - ID
*/
public void setId(String id) {
this.id = id;
}
/**
* get the errorCode - 异常编码
* @return the errorCode
*/
public String getErrorCode() {
return this.errorCode;
}
/**
* set the errorCode - 异常编码
*/
public void setErrorCode(String errorCode) {
this.errorCode = errorCode;
}
/**
* get the prio - 异常登记
* @return the prio
*/
public String getPrio() {
return this.prio;
}
/**
* set the prio - 异常登记
*/
public void setPrio(String prio) {
this.prio = prio;
}
/**
* get the programNo - 程序号
* @return the programNo
*/
public String getProgramNo() {
return this.programNo;
}
/**
* set the programNo - 程序号
*/
public void setProgramNo(String programNo) {
this.programNo = programNo;
}
/**
* get the rowno - 行号
* @return the rowno
*/
public String getRowno() {
return this.rowno;
}
/**
* set the rowno - 行号
*/
public void setRowno(String rowno) {
this.rowno = rowno;
}
/**
* get the gotoRowNone - 不存在跳转行
* @return the gotoRowNone
*/
public String getGotoRowNone() {
return this.gotoRowNone;
}
/**
* set the gotoRowNone - 不存在跳转行
*/
public void setGotoRowNone(String gotoRowNone) {
this.gotoRowNone = gotoRowNone;
}
/**
* get the fileName - 文件名
* @return the fileName
*/
public String getFileName() {
return this.fileName;
}
/**
* set the fileName - 文件名
*/
public void setFileName(String fileName) {
this.fileName = fileName;
}
/**
* get the equipmentType - 设备状态
* @return the equipmentType
*/
public String getEquipmentType() {
return this.equipmentType;
}
/**
* set the equipmentType - 设备状态
*/
public void setEquipmentType(String equipmentType) {
this.equipmentType = equipmentType;
}
/**
* get the equipmentCode - 设备编码
* @return the equipmentCode
*/
public String getEquipmentCode() {
return this.equipmentCode;
}
/**
* set the equipmentCode - 设备编码
*/
public void setEquipmentCode(String equipmentCode) {
this.equipmentCode = equipmentCode;
}
/**
* get the createdBy - 创建人
* @return the createdBy
*/
public String getCreatedBy() {
return this.createdBy;
}
/**
* set the createdBy - 创建人
*/
public void setCreatedBy(String createdBy) {
this.createdBy = createdBy;
}
/**
* get the createdName - 创建人名称
* @return the createdName
*/
public String getCreatedName() {
return this.createdName;
}
/**
* set the createdName - 创建人名称
*/
public void setCreatedName(String createdName) {
this.createdName = createdName;
}
/**
* get the createdTime - 创建时间
* @return the createdTime
*/
public String getCreatedTime() {
return this.createdTime;
}
/**
* set the createdTime - 创建时间
*/
public void setCreatedTime(String createdTime) {
this.createdTime = createdTime;
}
/**
* get the updatedBy - 更新人
* @return the updatedBy
*/
public String getUpdatedBy() {
return this.updatedBy;
}
/**
* set the updatedBy - 更新人
*/
public void setUpdatedBy(String updatedBy) {
this.updatedBy = updatedBy;
}
/**
* get the updatedName - 更新人名称
* @return the updatedName
*/
public String getUpdatedName() {
return this.updatedName;
}
/**
* set the updatedName - 更新人名称
*/
public void setUpdatedName(String updatedName) {
this.updatedName = updatedName;
}
/**
* get the updatedTime - 更新时间
* @return the updatedTime
*/
public String getUpdatedTime() {
return this.updatedTime;
}
/**
* set the updatedTime - 更新时间
*/
public void setUpdatedTime(String updatedTime) {
this.updatedTime = updatedTime;
}
/**
* get the deleteFlag - 是否删除0.否1.是
* @return the deleteFlag
*/
public Integer getDeleteFlag() {
return this.deleteFlag;
}
/**
* set the deleteFlag - 是否删除0.否1.是
*/
public void setDeleteFlag(Integer deleteFlag) {
this.deleteFlag = deleteFlag;
}
/**
* get the value from Map
*/
public void fromMap(Map map) {
setId(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("id")), id));
setErrorCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("errorCode")), errorCode));
setPrio(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("prio")), prio));
setProgramNo(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("programNo")), programNo));
setRowno(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("rowno")), rowno));
setGotoRowNone(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("gotoRowNone")), gotoRowNone));
setFileName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("fileName")), fileName));
setEquipmentType(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("equipmentType")), equipmentType));
setEquipmentCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("equipmentCode")), equipmentCode));
setCreatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("createdBy")), createdBy));
setCreatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("createdName")), createdName));
setCreatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("createdTime")), createdTime));
setUpdatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("updatedBy")), updatedBy));
setUpdatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("updatedName")), updatedName));
setUpdatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("updatedTime")), updatedTime));
setDeleteFlag(NumberUtils.toInteger(StringUtils.toString(map.get("deleteFlag")), deleteFlag));
}
/**
* set the value to Map
*/
public Map toMap() {
Map map = new HashMap();
map.put("id",StringUtils.toString(id, eiMetadata.getMeta("id")));
map.put("errorCode",StringUtils.toString(errorCode, eiMetadata.getMeta("errorCode")));
map.put("prio",StringUtils.toString(prio, eiMetadata.getMeta("prio")));
map.put("programNo",StringUtils.toString(programNo, eiMetadata.getMeta("programNo")));
map.put("rowno",StringUtils.toString(rowno, eiMetadata.getMeta("rowno")));
map.put("gotoRowNone",StringUtils.toString(gotoRowNone, eiMetadata.getMeta("gotoRowNone")));
map.put("fileName",StringUtils.toString(fileName, eiMetadata.getMeta("fileName")));
map.put("equipmentType",StringUtils.toString(equipmentType, eiMetadata.getMeta("equipmentType")));
map.put("equipmentCode",StringUtils.toString(equipmentCode, eiMetadata.getMeta("equipmentCode")));
map.put("createdBy",StringUtils.toString(createdBy, eiMetadata.getMeta("createdBy")));
map.put("createdName",StringUtils.toString(createdName, eiMetadata.getMeta("createdName")));
map.put("createdTime",StringUtils.toString(createdTime, eiMetadata.getMeta("createdTime")));
map.put("updatedBy",StringUtils.toString(updatedBy, eiMetadata.getMeta("updatedBy")));
map.put("updatedName",StringUtils.toString(updatedName, eiMetadata.getMeta("updatedName")));
map.put("updatedTime",StringUtils.toString(updatedTime, eiMetadata.getMeta("updatedTime")));
map.put("deleteFlag",StringUtils.toString(deleteFlag, eiMetadata.getMeta("deleteFlag")));
return map;
}
}
\ No newline at end of file
/**
* Generate time : 2024-04-12 16:36:57
* Version : 1.0
*/
package com.baosight.hpjx.hp.sb.domain;
import com.baosight.iplat4j.core.util.NumberUtils;
import com.baosight.iplat4j.core.ei.EiColumn;
import com.baosight.iplat4j.core.data.DaoEPBase;
import java.util.HashMap;
import java.util.Map;
import com.baosight.iplat4j.core.util.StringUtils;
/**
* THpsb002
*
*/
public class HPSB002 extends DaoEPBase {
private String id = " "; /* ID*/
private String programNo = " "; /* 程序号*/
private String rowno = " "; /* 行号*/
private String gotoRowNone = " "; /* 不存在跳转行*/
private String fileName = " "; /* 文件名*/
private String equipmentType = " "; /* 设备状态*/
private String equipmentCode = " "; /* 设备编码*/
private String createdBy = " "; /* 创建人*/
private String createdName = " "; /* 创建人名称*/
private String createdTime = " "; /* 创建时间*/
private String updatedBy = " "; /* 更新人*/
private String updatedName = " "; /* 更新人名称*/
private String updatedTime = " "; /* 更新时间*/
private Integer deleteFlag = Integer.valueOf(0); /* 是否删除0.否1.是*/
private String errorCode = " "; /* 异常编码*/
private String prio = " "; /* 异常登记*/
/**
* initialize the metadata
*/
public void initMetaData() {
EiColumn eiColumn;
eiColumn = new EiColumn("id");
eiColumn.setPrimaryKey(true);
eiColumn.setDescName("ID");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("programNo");
eiColumn.setDescName("程序号");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("rowno");
eiColumn.setDescName("行号");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("gotoRowNone");
eiColumn.setDescName("不存在跳转行");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("fileName");
eiColumn.setDescName("文件名");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("equipmentType");
eiColumn.setDescName("设备状态");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("equipmentCode");
eiColumn.setDescName("设备编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("createdBy");
eiColumn.setDescName("创建人");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("createdName");
eiColumn.setDescName("创建人名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("createdTime");
eiColumn.setDescName("创建时间");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("updatedBy");
eiColumn.setDescName("更新人");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("updatedName");
eiColumn.setDescName("更新人名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("updatedTime");
eiColumn.setDescName("更新时间");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("deleteFlag");
eiColumn.setDescName("是否删除0.否1.是");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("errorCode");
eiColumn.setDescName("异常编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("prio");
eiColumn.setDescName("异常登记");
eiMetadata.addMeta(eiColumn);
}
/**
* the constructor
*/
public HPSB002() {
initMetaData();
}
/**
* get the id - ID
* @return the id
*/
public String getId() {
return this.id;
}
/**
* set the id - ID
*/
public void setId(String id) {
this.id = id;
}
/**
* get the programNo - 程序号
* @return the programNo
*/
public String getProgramNo() {
return this.programNo;
}
/**
* set the programNo - 程序号
*/
public void setProgramNo(String programNo) {
this.programNo = programNo;
}
/**
* get the rowno - 行号
* @return the rowno
*/
public String getRowno() {
return this.rowno;
}
/**
* set the rowno - 行号
*/
public void setRowno(String rowno) {
this.rowno = rowno;
}
/**
* get the gotoRowNone - 不存在跳转行
* @return the gotoRowNone
*/
public String getGotoRowNone() {
return this.gotoRowNone;
}
/**
* set the gotoRowNone - 不存在跳转行
*/
public void setGotoRowNone(String gotoRowNone) {
this.gotoRowNone = gotoRowNone;
}
/**
* get the fileName - 文件名
* @return the fileName
*/
public String getFileName() {
return this.fileName;
}
/**
* set the fileName - 文件名
*/
public void setFileName(String fileName) {
this.fileName = fileName;
}
/**
* get the equipmentType - 设备状态
* @return the equipmentType
*/
public String getEquipmentType() {
return this.equipmentType;
}
/**
* set the equipmentType - 设备状态
*/
public void setEquipmentType(String equipmentType) {
this.equipmentType = equipmentType;
}
/**
* get the equipmentCode - 设备编码
* @return the equipmentCode
*/
public String getEquipmentCode() {
return this.equipmentCode;
}
/**
* set the equipmentCode - 设备编码
*/
public void setEquipmentCode(String equipmentCode) {
this.equipmentCode = equipmentCode;
}
/**
* get the createdBy - 创建人
* @return the createdBy
*/
public String getCreatedBy() {
return this.createdBy;
}
/**
* set the createdBy - 创建人
*/
public void setCreatedBy(String createdBy) {
this.createdBy = createdBy;
}
/**
* get the createdName - 创建人名称
* @return the createdName
*/
public String getCreatedName() {
return this.createdName;
}
/**
* set the createdName - 创建人名称
*/
public void setCreatedName(String createdName) {
this.createdName = createdName;
}
/**
* get the createdTime - 创建时间
* @return the createdTime
*/
public String getCreatedTime() {
return this.createdTime;
}
/**
* set the createdTime - 创建时间
*/
public void setCreatedTime(String createdTime) {
this.createdTime = createdTime;
}
/**
* get the updatedBy - 更新人
* @return the updatedBy
*/
public String getUpdatedBy() {
return this.updatedBy;
}
/**
* set the updatedBy - 更新人
*/
public void setUpdatedBy(String updatedBy) {
this.updatedBy = updatedBy;
}
/**
* get the updatedName - 更新人名称
* @return the updatedName
*/
public String getUpdatedName() {
return this.updatedName;
}
/**
* set the updatedName - 更新人名称
*/
public void setUpdatedName(String updatedName) {
this.updatedName = updatedName;
}
/**
* get the updatedTime - 更新时间
* @return the updatedTime
*/
public String getUpdatedTime() {
return this.updatedTime;
}
/**
* set the updatedTime - 更新时间
*/
public void setUpdatedTime(String updatedTime) {
this.updatedTime = updatedTime;
}
/**
* get the deleteFlag - 是否删除0.否1.是
* @return the deleteFlag
*/
public Integer getDeleteFlag() {
return this.deleteFlag;
}
/**
* set the deleteFlag - 是否删除0.否1.是
*/
public void setDeleteFlag(Integer deleteFlag) {
this.deleteFlag = deleteFlag;
}
/**
* get the errorCode - 异常编码
* @return the errorCode
*/
public String getErrorCode() {
return this.errorCode;
}
/**
* set the errorCode - 异常编码
*/
public void setErrorCode(String errorCode) {
this.errorCode = errorCode;
}
/**
* get the prio - 异常登记
* @return the prio
*/
public String getPrio() {
return this.prio;
}
/**
* set the prio - 异常登记
*/
public void setPrio(String prio) {
this.prio = prio;
}
/**
* get the value from Map
*/
public void fromMap(Map map) {
setId(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("id")), id));
setProgramNo(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("programNo")), programNo));
setRowno(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("rowno")), rowno));
setGotoRowNone(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("gotoRowNone")), gotoRowNone));
setFileName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("fileName")), fileName));
setEquipmentType(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("equipmentType")), equipmentType));
setEquipmentCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("equipmentCode")), equipmentCode));
setCreatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("createdBy")), createdBy));
setCreatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("createdName")), createdName));
setCreatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("createdTime")), createdTime));
setUpdatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("updatedBy")), updatedBy));
setUpdatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("updatedName")), updatedName));
setUpdatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("updatedTime")), updatedTime));
setDeleteFlag(NumberUtils.toInteger(StringUtils.toString(map.get("deleteFlag")), deleteFlag));
setErrorCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("errorCode")), errorCode));
setPrio(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("prio")), prio));
}
/**
* set the value to Map
*/
public Map toMap() {
Map map = new HashMap();
map.put("id",StringUtils.toString(id, eiMetadata.getMeta("id")));
map.put("programNo",StringUtils.toString(programNo, eiMetadata.getMeta("programNo")));
map.put("rowno",StringUtils.toString(rowno, eiMetadata.getMeta("rowno")));
map.put("gotoRowNone",StringUtils.toString(gotoRowNone, eiMetadata.getMeta("gotoRowNone")));
map.put("fileName",StringUtils.toString(fileName, eiMetadata.getMeta("fileName")));
map.put("equipmentType",StringUtils.toString(equipmentType, eiMetadata.getMeta("equipmentType")));
map.put("equipmentCode",StringUtils.toString(equipmentCode, eiMetadata.getMeta("equipmentCode")));
map.put("createdBy",StringUtils.toString(createdBy, eiMetadata.getMeta("createdBy")));
map.put("createdName",StringUtils.toString(createdName, eiMetadata.getMeta("createdName")));
map.put("createdTime",StringUtils.toString(createdTime, eiMetadata.getMeta("createdTime")));
map.put("updatedBy",StringUtils.toString(updatedBy, eiMetadata.getMeta("updatedBy")));
map.put("updatedName",StringUtils.toString(updatedName, eiMetadata.getMeta("updatedName")));
map.put("updatedTime",StringUtils.toString(updatedTime, eiMetadata.getMeta("updatedTime")));
map.put("deleteFlag",StringUtils.toString(deleteFlag, eiMetadata.getMeta("deleteFlag")));
map.put("errorCode",StringUtils.toString(errorCode, eiMetadata.getMeta("errorCode")));
map.put("prio",StringUtils.toString(prio, eiMetadata.getMeta("prio")));
return map;
}
}
\ No newline at end of file
package com.baosight.hpjx.hp.sb.domain;
import com.baosight.iplat4j.core.util.NumberUtils;
import com.baosight.iplat4j.core.ei.EiColumn;
import com.baosight.iplat4j.core.data.DaoEPBase;
import java.util.HashMap;
import java.util.Map;
import com.baosight.iplat4j.core.util.StringUtils;
/**
* Project: <br>
* Title:THpsb003.java <br>
* Description: <br>
*
* Copyrigth:Baosight Software LTD.co Copyright (c) 2019. <br>
*
* @version 1.0
* @history 2024-04-02 10:36:28 create
*/
public class HPSB003 extends DaoEPBase {
private static final long serialVersionUID = 1L;
public static final String FIELD_ID = "id"; /* ID*/
public static final String FIELD_COMPANY_CODE = "companyCode"; /* 公司编码*/
public static final String FIELD_DEP_CODE = "depCode"; /* 部门编码*/
public static final String FIELD_CREATED_BY = "createdBy"; /* 创建人*/
public static final String FIELD_CREATED_NAME = "createdName"; /* 创建人名称*/
public static final String FIELD_CREATED_TIME = "createdTime"; /* 创建时间*/
public static final String FIELD_UPDATED_BY = "updatedBy"; /* 修改人*/
public static final String FIELD_UPDATED_NAME = "updatedName"; /* 修改人名称*/
public static final String FIELD_UPDATED_TIME = "updatedTime"; /* 修改时间*/
public static final String FIELD_DELETE_FLAG = "deleteFlag"; /* 是否删除 0-否1-是*/
public static final String FIELD_FACTORY_CODE = "factoryCode"; /* 工厂代码(公司名称)*/
public static final String FIELD_GROUP_CODE = "groupCode"; /* 生产组代码(设备区域)*/
public static final String FIELD_DEVICE_TYPE = "deviceType"; /* 设备类型*/
public static final String FIELD_DEVICE_CODE = "deviceCode"; /* 设备编码*/
public static final String FIELD_DEVICE_NAME = "deviceName"; /* 设备名称*/
public static final String FIELD_DEVICE_MODEL = "deviceModel"; /* 设备型号*/
public static final String FIELD_PURCHASE_DATE = "purchaseDate"; /* 购置日期*/
public static final String FIELD_MAINTAIN_DATE = "maintainDate"; /* 保养日期*/
public static final String FIELD_DEVICE_USER_ID = "deviceUserId"; /* 设备负责人*/
public static final String FIELD_DEVICE_STATUS = "deviceStatus"; /* 设备状态 0-停止 1-启用*/
public static final String COL_ID = "ID"; /* ID*/
public static final String COL_COMPANY_CODE = "COMPANY_CODE"; /* 公司编码*/
public static final String COL_DEP_CODE = "DEP_CODE"; /* 部门编码*/
public static final String COL_CREATED_BY = "CREATED_BY"; /* 创建人*/
public static final String COL_CREATED_NAME = "CREATED_NAME"; /* 创建人名称*/
public static final String COL_CREATED_TIME = "CREATED_TIME"; /* 创建时间*/
public static final String COL_UPDATED_BY = "UPDATED_BY"; /* 修改人*/
public static final String COL_UPDATED_NAME = "UPDATED_NAME"; /* 修改人名称*/
public static final String COL_UPDATED_TIME = "UPDATED_TIME"; /* 修改时间*/
public static final String COL_DELETE_FLAG = "DELETE_FLAG"; /* 是否删除 0-否1-是*/
public static final String COL_FACTORY_CODE = "FACTORY_CODE"; /* 工厂代码(公司名称)*/
public static final String COL_GROUP_CODE = "GROUP_CODE"; /* 生产组代码(设备区域)*/
public static final String COL_DEVICE_TYPE = "DEVICE_TYPE"; /* 设备类型*/
public static final String COL_DEVICE_CODE = "DEVICE_CODE"; /* 设备编码*/
public static final String COL_DEVICE_NAME = "DEVICE_NAME"; /* 设备名称*/
public static final String COL_DEVICE_MODEL = "DEVICE_MODEL"; /* 设备型号*/
public static final String COL_PURCHASE_DATE = "PURCHASE_DATE"; /* 购置日期*/
public static final String COL_MAINTAIN_DATE = "MAINTAIN_DATE"; /* 保养日期*/
public static final String COL_DEVICE_USER_ID = "DEVICE_USER_ID"; /* 设备负责人*/
public static final String COL_DEVICE_STATUS = "DEVICE_STATUS"; /* 设备状态 0-停止 1-启用*/
public static final String QUERY = "HPSB003.query";
public static final String COUNT = "HPSB003.count";
public static final String INSERT = "HPSB003.insert";
public static final String UPDATE = "HPSB003.update";
public static final String DELETE = "HPSB003.delete";
public static final String DELETE_FLAG = "HPSB003.deleteFlag";
public static final String UPDATE_DEVICE_STATUS = "HPSB003.updateDeviceStatus";
private Long id; /* ID*/
private String companyCode = " "; /* 公司编码*/
private String depCode = " "; /* 部门编码*/
private String createdBy = " "; /* 创建人*/
private String createdName = " "; /* 创建人名称*/
private String createdTime = " "; /* 创建时间*/
private String updatedBy = " "; /* 修改人*/
private String updatedName = " "; /* 修改人名称*/
private String updatedTime = " "; /* 修改时间*/
private Integer deleteFlag = 0; /* 是否删除 0-否1-是*/
private String factoryCode = " "; /* 工厂代码(公司名称)*/
private String groupCode = " "; /* 生产组代码(设备区域)*/
private String deviceType = " "; /* 设备类型*/
private String deviceCode = " "; /* 设备编码*/
private String deviceName = " "; /* 设备名称*/
private String deviceModel = " "; /* 设备型号*/
private String purchaseDate = " "; /* 购置日期*/
private String maintainDate = " "; /* 保养日期*/
private String deviceUserId = " "; /* 设备负责人*/
private Integer deviceStatus = 0; /* 设备状态 0-停止 1-启用*/
/**
* initialize the metadata.
*/
public void initMetaData() {
EiColumn eiColumn;
eiColumn = new EiColumn(FIELD_ID);
eiColumn.setPrimaryKey(true);
eiColumn.setDescName("ID");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_COMPANY_CODE);
eiColumn.setDescName("公司编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DEP_CODE);
eiColumn.setDescName("部门编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CREATED_BY);
eiColumn.setDescName("创建人");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CREATED_NAME);
eiColumn.setDescName("创建人名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CREATED_TIME);
eiColumn.setDescName("创建时间");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_UPDATED_BY);
eiColumn.setDescName("修改人");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_UPDATED_NAME);
eiColumn.setDescName("修改人名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_UPDATED_TIME);
eiColumn.setDescName("修改时间");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DELETE_FLAG);
eiColumn.setDescName("是否删除 0-否1-是");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_FACTORY_CODE);
eiColumn.setDescName("工厂代码(公司名称)");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_GROUP_CODE);
eiColumn.setDescName("生产组代码(设备区域)");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DEVICE_TYPE);
eiColumn.setDescName("设备类型");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DEVICE_CODE);
eiColumn.setDescName("设备编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DEVICE_NAME);
eiColumn.setDescName("设备名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DEVICE_MODEL);
eiColumn.setDescName("设备型号");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_PURCHASE_DATE);
eiColumn.setDescName("购置日期");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_MAINTAIN_DATE);
eiColumn.setDescName("保养日期");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DEVICE_USER_ID);
eiColumn.setDescName("设备负责人");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DEVICE_STATUS);
eiColumn.setDescName("设备状态 0-停止 1-启用");
eiMetadata.addMeta(eiColumn);
}
/**
* the constructor.
*/
public HPSB003() {
initMetaData();
}
/**
* get the id - ID.
* @return the id
*/
public Long getId() {
return this.id;
}
/**
* set the id - ID.
*
* @param id - ID
*/
public void setId(Long id) {
this.id = id;
}
/**
* get the companyCode - 公司编码.
* @return the companyCode
*/
public String getCompanyCode() {
return this.companyCode;
}
/**
* set the companyCode - 公司编码.
*
* @param companyCode - 公司编码
*/
public void setCompanyCode(String companyCode) {
this.companyCode = companyCode;
}
/**
* get the depCode - 部门编码.
* @return the depCode
*/
public String getDepCode() {
return this.depCode;
}
/**
* set the depCode - 部门编码.
*
* @param depCode - 部门编码
*/
public void setDepCode(String depCode) {
this.depCode = depCode;
}
/**
* get the createdBy - 创建人.
* @return the createdBy
*/
public String getCreatedBy() {
return this.createdBy;
}
/**
* set the createdBy - 创建人.
*
* @param createdBy - 创建人
*/
public void setCreatedBy(String createdBy) {
this.createdBy = createdBy;
}
/**
* get the createdName - 创建人名称.
* @return the createdName
*/
public String getCreatedName() {
return this.createdName;
}
/**
* set the createdName - 创建人名称.
*
* @param createdName - 创建人名称
*/
public void setCreatedName(String createdName) {
this.createdName = createdName;
}
/**
* get the createdTime - 创建时间.
* @return the createdTime
*/
public String getCreatedTime() {
return this.createdTime;
}
/**
* set the createdTime - 创建时间.
*
* @param createdTime - 创建时间
*/
public void setCreatedTime(String createdTime) {
this.createdTime = createdTime;
}
/**
* get the updatedBy - 修改人.
* @return the updatedBy
*/
public String getUpdatedBy() {
return this.updatedBy;
}
/**
* set the updatedBy - 修改人.
*
* @param updatedBy - 修改人
*/
public void setUpdatedBy(String updatedBy) {
this.updatedBy = updatedBy;
}
/**
* get the updatedName - 修改人名称.
* @return the updatedName
*/
public String getUpdatedName() {
return this.updatedName;
}
/**
* set the updatedName - 修改人名称.
*
* @param updatedName - 修改人名称
*/
public void setUpdatedName(String updatedName) {
this.updatedName = updatedName;
}
/**
* get the updatedTime - 修改时间.
* @return the updatedTime
*/
public String getUpdatedTime() {
return this.updatedTime;
}
/**
* set the updatedTime - 修改时间.
*
* @param updatedTime - 修改时间
*/
public void setUpdatedTime(String updatedTime) {
this.updatedTime = updatedTime;
}
/**
* get the deleteFlag - 是否删除 0-否1-是.
* @return the deleteFlag
*/
public Integer getDeleteFlag() {
return this.deleteFlag;
}
/**
* set the deleteFlag - 是否删除 0-否1-是.
*
* @param deleteFlag - 是否删除 0-否1-是
*/
public void setDeleteFlag(Integer deleteFlag) {
this.deleteFlag = deleteFlag;
}
/**
* get the factoryCode - 工厂代码(公司名称).
* @return the factoryCode
*/
public String getFactoryCode() {
return this.factoryCode;
}
/**
* set the factoryCode - 工厂代码(公司名称).
*
* @param factoryCode - 工厂代码(公司名称)
*/
public void setFactoryCode(String factoryCode) {
this.factoryCode = factoryCode;
}
/**
* get the groupCode - 生产组代码(设备区域).
* @return the groupCode
*/
public String getGroupCode() {
return this.groupCode;
}
/**
* set the groupCode - 生产组代码(设备区域).
*
* @param groupCode - 生产组代码(设备区域)
*/
public void setGroupCode(String groupCode) {
this.groupCode = groupCode;
}
/**
* get the deviceType - 设备类型.
* @return the deviceType
*/
public String getDeviceType() {
return this.deviceType;
}
/**
* set the deviceType - 设备类型.
*
* @param deviceType - 设备类型
*/
public void setDeviceType(String deviceType) {
this.deviceType = deviceType;
}
/**
* get the deviceCode - 设备编码.
* @return the deviceCode
*/
public String getDeviceCode() {
return this.deviceCode;
}
/**
* set the deviceCode - 设备编码.
*
* @param deviceCode - 设备编码
*/
public void setDeviceCode(String deviceCode) {
this.deviceCode = deviceCode;
}
/**
* get the deviceName - 设备名称.
* @return the deviceName
*/
public String getDeviceName() {
return this.deviceName;
}
/**
* set the deviceName - 设备名称.
*
* @param deviceName - 设备名称
*/
public void setDeviceName(String deviceName) {
this.deviceName = deviceName;
}
/**
* get the deviceModel - 设备型号.
* @return the deviceModel
*/
public String getDeviceModel() {
return this.deviceModel;
}
/**
* set the deviceModel - 设备型号.
*
* @param deviceModel - 设备型号
*/
public void setDeviceModel(String deviceModel) {
this.deviceModel = deviceModel;
}
/**
* get the purchaseDate - 购置日期.
* @return the purchaseDate
*/
public String getPurchaseDate() {
return this.purchaseDate;
}
/**
* set the purchaseDate - 购置日期.
*
* @param purchaseDate - 购置日期
*/
public void setPurchaseDate(String purchaseDate) {
this.purchaseDate = purchaseDate;
}
/**
* get the maintainDate - 保养日期.
* @return the maintainDate
*/
public String getMaintainDate() {
return this.maintainDate;
}
/**
* set the maintainDate - 保养日期.
*
* @param maintainDate - 保养日期
*/
public void setMaintainDate(String maintainDate) {
this.maintainDate = maintainDate;
}
/**
* get the deviceUserId - 设备负责人.
* @return the deviceUserId
*/
public String getDeviceUserId() {
return this.deviceUserId;
}
/**
* set the deviceUserId - 设备负责人.
*
* @param deviceUserId - 设备负责人
*/
public void setDeviceUserId(String deviceUserId) {
this.deviceUserId = deviceUserId;
}
/**
* get the deviceStatus - 设备状态 0-停止 1-启用.
* @return the deviceStatus
*/
public Integer getDeviceStatus() {
return this.deviceStatus;
}
/**
* set the deviceStatus - 设备状态 0-停止 1-启用.
*
* @param deviceStatus - 设备状态 0-停止 1-启用
*/
public void setDeviceStatus(Integer deviceStatus) {
this.deviceStatus = deviceStatus;
}
/**
* get the value from Map.
*
* @param map - source data map
*/
@Override
public void fromMap(Map map) {
//TODO id cannot generate automatically ,BigInteger dont support
setId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_ID)), id));
setCompanyCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_COMPANY_CODE)), companyCode));
setDepCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DEP_CODE)), depCode));
setCreatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_BY)), createdBy));
setCreatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_NAME)), createdName));
setCreatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_TIME)), createdTime));
setUpdatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_BY)), updatedBy));
setUpdatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_NAME)), updatedName));
setUpdatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_TIME)), updatedTime));
setDeleteFlag(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_DELETE_FLAG)), deleteFlag));
setFactoryCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_FACTORY_CODE)), factoryCode));
setGroupCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_GROUP_CODE)), groupCode));
setDeviceType(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DEVICE_TYPE)), deviceType));
setDeviceCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DEVICE_CODE)), deviceCode));
setDeviceName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DEVICE_NAME)), deviceName));
setDeviceModel(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DEVICE_MODEL)), deviceModel));
setPurchaseDate(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PURCHASE_DATE)), purchaseDate));
setMaintainDate(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_MAINTAIN_DATE)), maintainDate));
setDeviceUserId(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DEVICE_USER_ID)), deviceUserId));
setDeviceStatus(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_DEVICE_STATUS)), deviceStatus));
}
/**
* set the value to Map.
*/
@Override
public Map toMap() {
Map map = new HashMap();
map.put(FIELD_ID, StringUtils.toString(id, eiMetadata.getMeta(FIELD_ID)));
map.put(FIELD_COMPANY_CODE, StringUtils.toString(companyCode, eiMetadata.getMeta(FIELD_COMPANY_CODE)));
map.put(FIELD_DEP_CODE, StringUtils.toString(depCode, eiMetadata.getMeta(FIELD_DEP_CODE)));
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)));
map.put(FIELD_CREATED_TIME, StringUtils.toString(createdTime, eiMetadata.getMeta(FIELD_CREATED_TIME)));
map.put(FIELD_UPDATED_BY, StringUtils.toString(updatedBy, eiMetadata.getMeta(FIELD_UPDATED_BY)));
map.put(FIELD_UPDATED_NAME, StringUtils.toString(updatedName, eiMetadata.getMeta(FIELD_UPDATED_NAME)));
map.put(FIELD_UPDATED_TIME, StringUtils.toString(updatedTime, eiMetadata.getMeta(FIELD_UPDATED_TIME)));
map.put(FIELD_DELETE_FLAG, StringUtils.toString(deleteFlag, eiMetadata.getMeta(FIELD_DELETE_FLAG)));
map.put(FIELD_FACTORY_CODE, StringUtils.toString(factoryCode, eiMetadata.getMeta(FIELD_FACTORY_CODE)));
map.put(FIELD_GROUP_CODE, StringUtils.toString(groupCode, eiMetadata.getMeta(FIELD_GROUP_CODE)));
map.put(FIELD_DEVICE_TYPE, StringUtils.toString(deviceType, eiMetadata.getMeta(FIELD_DEVICE_TYPE)));
map.put(FIELD_DEVICE_CODE, StringUtils.toString(deviceCode, eiMetadata.getMeta(FIELD_DEVICE_CODE)));
map.put(FIELD_DEVICE_NAME, StringUtils.toString(deviceName, eiMetadata.getMeta(FIELD_DEVICE_NAME)));
map.put(FIELD_DEVICE_MODEL, StringUtils.toString(deviceModel, eiMetadata.getMeta(FIELD_DEVICE_MODEL)));
map.put(FIELD_PURCHASE_DATE, StringUtils.toString(purchaseDate, eiMetadata.getMeta(FIELD_PURCHASE_DATE)));
map.put(FIELD_MAINTAIN_DATE, StringUtils.toString(maintainDate, eiMetadata.getMeta(FIELD_MAINTAIN_DATE)));
map.put(FIELD_DEVICE_USER_ID, StringUtils.toString(deviceUserId, eiMetadata.getMeta(FIELD_DEVICE_USER_ID)));
map.put(FIELD_DEVICE_STATUS, StringUtils.toString(deviceStatus, eiMetadata.getMeta(FIELD_DEVICE_STATUS)));
return map;
}
}
/**
* Generate time : 2024-04-12 9:11:51
* Version : 1.0
*/
package com.baosight.hpjx.hp.sb.domain;
import com.baosight.iplat4j.core.data.DaoEPBase;
import com.baosight.iplat4j.core.ei.EiColumn;
import com.baosight.iplat4j.core.util.NumberUtils;
import com.baosight.iplat4j.core.util.StringUtils;
import lombok.Data;
import java.util.HashMap;
import java.util.Map;
/**
* HPSB00A
*
*/
@Data
public class HPSB00A extends DaoEPBase {
private String equipmentCode = " "; /* 设备编码*/
private String equipmentType = " "; /* 设备状态*/
private String dataContent = " "; /* 数据内容*/
}
\ No newline at end of file
package com.baosight.hpjx.hp.sb.service;
import com.baosight.hpjx.aspect.annotation.OperationLogAnnotation;
import com.baosight.hpjx.hp.sb.domain.HPSB001;
import com.baosight.iplat4j.core.ei.EiBlock;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.service.impl.ServiceBase;
import com.baosight.iplat4j.core.web.threadlocal.UserSession;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Map;
/**
*
*/
public class ServiceHPSB001 extends ServiceBase {
/**
* 画面初始化.
*/
@OperationLogAnnotation(operModul = "设备异常日志",operType = "查询",operDesc = "初始化")
public EiInfo initLoad(EiInfo inInfo) {
HPSB001 hpsb001 = new HPSB001();
EiInfo outInfo = super.initLoad(inInfo, hpsb001);
outInfo.addBlock(EiConstant.resultBlock).addBlockMeta(hpsb001.eiMetadata);
return inInfo;
}
/**
* 查询操作.
*/
@OperationLogAnnotation(operModul = "设备异常日志",operType = "查询",operDesc = "查询")
@Override
public EiInfo query(EiInfo inInfo) {
/* 调用EI查询方法.*/
EiInfo outInfo = super.query(inInfo, "HPSB001.query", new HPSB001());
return outInfo;
}
/**
* 新增操作.
*/
@OperationLogAnnotation(operModul = "设备异常日志",operType = "新增",operDesc = "新增")
@Override
public EiInfo insert(EiInfo inInfo) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
try {
HPSB001 hpsb001 = new HPSB001();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
for (int i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
hpsb001.fromMap(map);
hpsb001.setCreatedBy(UserSession.getUserId());
hpsb001.setCreatedTime(sdf.format(new Date()));
hpsb001.setUpdatedBy(null);
hpsb001.setUpdatedTime(null);
this.dao.insert("HPSB001.insert", hpsb001.toMap());
}
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsg("新增成功!");
} catch (PlatException e) {
e.printStackTrace();
inInfo.setStatus(EiConstant.STATUS_FAILURE);
inInfo.setMsg("新增失败!原因参见详细错误描述!");
inInfo.setDetailMsg(e.getMessage());
logError("新增失败", e.getMessage());
return inInfo;
}
return query(inInfo);
}
/**
* 修改操作.
*/
@OperationLogAnnotation(operModul = "设备异常日志",operType = "修改",operDesc = "修改")
public EiInfo update(EiInfo inInfo) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
try {
HPSB001 hpsb001 = new HPSB001();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
for (int i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
hpsb001.fromMap(map);
hpsb001.setUpdatedBy(UserSession.getUserId());
hpsb001.setUpdatedTime(sdf.format(new Date()));
this.dao.update("HPSB001.update", hpsb001.toMap());
}
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsg("修改成功!");
} catch (PlatException e) {
inInfo.setStatus(EiConstant.STATUS_FAILURE);
inInfo.setMsg("操作失败!原因参见详细错误描述!");
inInfo.setDetailMsg(e.getMessage());
logError("修改失败", e.getMessage());
return inInfo;
}
return query(inInfo);
}
/**
* 删除操作.
*/
@OperationLogAnnotation(operModul = "设备异常日志",operType = "删除",operDesc = "删除")
public EiInfo delete(EiInfo eiInfo) {
HPSB001 hpsb001 = new HPSB001();
EiBlock eiBlock = eiInfo.getBlock(EiConstant.resultBlock);
try {
for (int i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
hpsb001.fromMap(map);
this.dao.delete("HPSB001.delete", hpsb001.toMap());
}
} catch (PlatException e) {
eiInfo.setStatus(EiConstant.STATUS_FAILURE);
eiInfo.setMsg("删除失败,原因参见详细错误描述!");
eiInfo.setDetailMsg(e.getMessage());
logError("删除失败!", e.getMessage());
return eiInfo;
}
eiInfo.setStatus(EiConstant.STATUS_SUCCESS);
eiInfo.setMsg("删除成功!");
return eiInfo;
}
}
package com.baosight.hpjx.hp.sb.service;
import com.baosight.hpjx.aspect.annotation.OperationLogAnnotation;
import com.baosight.hpjx.hp.sb.domain.HPSB002;
import com.baosight.iplat4j.core.ei.EiBlock;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.service.impl.ServiceBase;
import com.baosight.iplat4j.core.web.threadlocal.UserSession;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Map;
/**
*
*/
public class ServiceHPSB002 extends ServiceBase {
/**
* 画面初始化.
*/
@OperationLogAnnotation(operModul = "设备日志",operType = "查询",operDesc = "初始化")
public EiInfo initLoad(EiInfo inInfo) {
HPSB002 hpsb002 = new HPSB002();
EiInfo outInfo = super.initLoad(inInfo, hpsb002);
outInfo.addBlock(EiConstant.resultBlock).addBlockMeta(hpsb002.eiMetadata);
return inInfo;
}
/**
* 查询操作.
*/
@OperationLogAnnotation(operModul = "设备日志",operType = "查询",operDesc = "查询")
@Override
public EiInfo query(EiInfo inInfo) {
/* 调用EI查询方法.*/
EiInfo outInfo = super.query(inInfo, "HPSB002.query", new HPSB002());
return outInfo;
}
/**
* 新增操作.
*/
@OperationLogAnnotation(operModul = "设备日志",operType = "新增",operDesc = "新增")
@Override
public EiInfo insert(EiInfo inInfo) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
try {
HPSB002 hpsb002 = new HPSB002();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
for (int i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
hpsb002.fromMap(map);
hpsb002.setCreatedBy(UserSession.getUserId());
hpsb002.setCreatedTime(sdf.format(new Date()));
hpsb002.setUpdatedBy(null);
hpsb002.setUpdatedTime(null);
this.dao.insert("HPSB002.insert", hpsb002.toMap());
}
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsg("新增成功!");
} catch (PlatException e) {
e.printStackTrace();
inInfo.setStatus(EiConstant.STATUS_FAILURE);
inInfo.setMsg("新增失败!原因参见详细错误描述!");
inInfo.setDetailMsg(e.getMessage());
logError("新增失败", e.getMessage());
return inInfo;
}
return query(inInfo);
}
/**
* 修改操作.
*/
@OperationLogAnnotation(operModul = "设备日志",operType = "修改",operDesc = "修改")
public EiInfo update(EiInfo inInfo) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
try {
HPSB002 hpsb002 = new HPSB002();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
for (int i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
hpsb002.fromMap(map);
hpsb002.setUpdatedBy(UserSession.getUserId());
hpsb002.setUpdatedTime(sdf.format(new Date()));
this.dao.update("HPSB002.update", hpsb002.toMap());
}
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsg("修改成功!");
} catch (PlatException e) {
inInfo.setStatus(EiConstant.STATUS_FAILURE);
inInfo.setMsg("操作失败!原因参见详细错误描述!");
inInfo.setDetailMsg(e.getMessage());
logError("修改失败", e.getMessage());
return inInfo;
}
return query(inInfo);
}
/**
* 删除操作.
*/
@OperationLogAnnotation(operModul = "设备日志",operType = "删除",operDesc = "删除")
public EiInfo delete(EiInfo eiInfo) {
HPSB002 hpsb002 = new HPSB002();
EiBlock eiBlock = eiInfo.getBlock(EiConstant.resultBlock);
try {
for (int i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
hpsb002.fromMap(map);
this.dao.delete("HPSB002.delete", hpsb002.toMap());
}
} catch (PlatException e) {
eiInfo.setStatus(EiConstant.STATUS_FAILURE);
eiInfo.setMsg("删除失败,原因参见详细错误描述!");
eiInfo.setDetailMsg(e.getMessage());
logError("删除失败!", e.getMessage());
return eiInfo;
}
eiInfo.setStatus(EiConstant.STATUS_SUCCESS);
eiInfo.setMsg("删除成功!");
return eiInfo;
}
}
package com.baosight.hpjx.hp.sb.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.constant.HPConstant;
import com.baosight.hpjx.hp.pz.domain.HPPZ002;
import com.baosight.hpjx.hp.sb.domain.HPSB003;
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;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.resource.I18nMessages;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @author LiuYang
* @version 1.0 2024/4/8
*/
public class ServiceHPSB003 extends ServiceEPBase {
@Override
public EiInfo initLoad(EiInfo inInfo) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HPSB003.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
final EiInfo outEiInfo = super.query(inInfo, HPSB003.QUERY, new HPSB003());
//拼接名称 包含逻辑删除数据
CommonMethod.initBlock(outEiInfo,
Arrays.asList(DdynamicEnum.FACTORY_CODE_BOX_BLOCK_ID,DdynamicEnum.GROUP_CODE_BOX_BLOCK_ID,DdynamicEnum.USER_ID_BOX_BLOCK_ID),
new HashMap<String,Object>(){}
);
return outEiInfo;
}
@Override
public EiInfo query(EiInfo inInfo) {
EiBlock block = inInfo.getBlock(EiConstant.queryBlock);
String purchaseDate = block.getCellStr(ACConstants.ROW_CODE_0,HPSB003.FIELD_PURCHASE_DATE);
if (!purchaseDate.isEmpty()) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0,HPSB003.FIELD_PURCHASE_DATE, StringUtil.removeHorizontalLine(purchaseDate));
}
inInfo.setCell(EiConstant.queryBlock,ACConstants.ROW_CODE_0, HPSB003.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
return super.query(inInfo, HPSB003.QUERY,new HPSB003());
}
@OperationLogAnnotation(operModul = "设备管理",operType = "删除",operDesc = "删除操作")
@Override
public EiInfo delete(EiInfo inInfo) {
int i = 0;
try {
HPSB003 hpsb001 = new HPSB003();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
for (i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
hpsb001.fromMap(map);
hpsb001.setDeleteFlag(CommonConstant.YesNo.YES_1);
DaoUtils.update(HPSB003.DELETE_FLAG, hpsb001);
}
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) {
int i = 0;
try {
HPSB003 hpsb001 = new HPSB003();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
for (i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
hpsb001.fromMap(map);
hpsb001.setDeleteFlag(CommonConstant.YesNo.NO_0);
DaoUtils.update(HPSB003.UPDATE, hpsb001);
}
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 = "修改设备状态操作")
public EiInfo updateDeviceStatus(EiInfo inInfo) {
int i = 0;
try {
HPSB003 hpsb001 = new HPSB003();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
for (i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
hpsb001.fromMap(map);
DaoUtils.update(HPSB003.UPDATE_DEVICE_STATUS, hpsb001);
}
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 = "操作")
public EiInfo save(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 写入数据
for (int i = 0; i < resultRows.size(); i++) {
HPSB003 hpsb003 = new HPSB003();
hpsb003.fromMap(resultRows.get(i));
if (hpsb003.getId() == null || hpsb003.getId() == 0) {
this.add(hpsb003);
} else {
this.modify(hpsb003);
}
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 新增操作
*/
public void add(HPSB003 hpsb003) {
queryDeviceCode(hpsb003);
DaoUtils.insert(HPSB003.INSERT, hpsb003);
}
/**
* 修改操作
*/
public void modify(HPSB003 hpsb003) {
DaoUtils.update(HPSB003.UPDATE, hpsb003);
}
@OperationLogAnnotation(operModul = "设备管理",operType = "新增",operDesc = "新增操作")
@Override
public EiInfo insert(EiInfo inInfo) {
int i = 0;
try {
HPSB003 hpsb001 = new HPSB003();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
for (i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
hpsb001.fromMap(map);
hpsb001.setDeleteFlag(CommonConstant.YesNo.NO_0);
Map<String,Object> queryMap = new HashMap<>();
queryDeviceCode(hpsb001);
DaoUtils.insert(HPSB003.INSERT, hpsb001);
}
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsgByKey("ep.1000", new String[]{String.valueOf(i), I18nMessages.getText("label.insert", "新增")});
} catch (PlatException e) {
e.printStackTrace();
ErrorCodeUtils.handleInsertException(inInfo,i,e);
logError("新增失败", e.getMessage());
return inInfo;
}
return inInfo;
}
public EiInfo queryFactoryCode(EiInfo inInfo) {
final String companyCode = UserSessionUtils.getCompanyCode();
String factoryCode = inInfo.getString(HPSB003.FIELD_FACTORY_CODE);
//String groupType = inInfo.getString(HPSC008.FIELD_GROUP_TYPE);
CommonMethod.initBlock(inInfo,
Arrays.asList(DdynamicEnum.GROUP_CODE_BOX_BLOCK_ID),
new HashMap<String,Object>(){{
put(HPSB003.FIELD_COMPANY_CODE,companyCode);
put(HPSB003.FIELD_FACTORY_CODE,factoryCode);
}});
return inInfo;
}
public void queryDeviceCode(HPSB003 hpsb001){
Map<String,Object> map = new HashMap<>();
map.put(HPSB003.FIELD_FACTORY_CODE,hpsb001.getFactoryCode());
map.put("deviceCodeStr",hpsb001.getDeviceCode());
map.put(HPSB003.FIELD_DELETE_FLAG,hpsb001.getDeleteFlag());
List<HPSB003> hpsb003List = this.dao.query(HPSB003.QUERY,map);
AssertUtils.isNotEmpty(hpsb003List, String.format("设备编码[%s]在当前工厂已存在,添加失败", map.get(HPSB003.FIELD_DEVICE_CODE)));
}
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://www.ibatis.com/dtd/sql-map-2.dtd">
<!-- table information
Generate time : 2024-04-12 16:36:52
Version : 1.0
tableName :hpjx.t_hpsb001
ID VARCHAR NOT NULL primarykey,
ERROR_CODE VARCHAR,
PRIO VARCHAR,
PROGRAM_NO VARCHAR,
ROWNO VARCHAR,
GOTO_ROW_NONE VARCHAR,
FILE_NAME VARCHAR,
EQUIPMENT_TYPE VARCHAR,
EQUIPMENT_CODE VARCHAR,
CREATED_BY VARCHAR,
CREATED_NAME VARCHAR,
CREATED_TIME VARCHAR,
UPDATED_BY VARCHAR,
UPDATED_NAME VARCHAR,
UPDATED_TIME VARCHAR,
DELETE_FLAG TINYINT
-->
<sqlMap namespace="HPSB001">
<select id="query" parameterClass="java.util.HashMap"
resultClass="com.baosight.hpjx.hp.sb.domain.HPSB001">
SELECT
ID as "id", <!-- ID -->
ERROR_CODE as "errorCode", <!-- 异常编码 -->
PRIO as "prio", <!-- 异常登记 -->
PROGRAM_NO as "programNo", <!-- 程序号 -->
ROWNO as "rowno", <!-- 行号 -->
GOTO_ROW_NONE as "gotoRowNone", <!-- 不存在跳转行 -->
FILE_NAME as "fileName", <!-- 文件名 -->
EQUIPMENT_TYPE as "equipmentType", <!-- 设备状态 -->
EQUIPMENT_CODE as "equipmentCode", <!-- 设备编码 -->
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.是 -->
FROM hpjx.t_hpsb001 WHERE 1=1
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
ID asc
</isEmpty>
</dynamic>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM hpjx.t_hpsb001 WHERE 1=1
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
</select>
<!--
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="errorCode">
ERROR_CODE = #errorCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="prio">
PRIO = #prio#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="programNo">
PROGRAM_NO = #programNo#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="rowno">
ROWNO = #rowno#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="gotoRowNone">
GOTO_ROW_NONE = #gotoRowNone#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="fileName">
FILE_NAME = #fileName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="equipmentType">
EQUIPMENT_TYPE = #equipmentType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="equipmentCode">
EQUIPMENT_CODE = #equipmentCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
CREATED_BY = #createdBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdName">
CREATED_NAME = #createdName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
CREATED_TIME = #createdTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy">
UPDATED_BY = #updatedBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedName">
UPDATED_NAME = #updatedName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime">
UPDATED_TIME = #updatedTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deleteFlag">
DELETE_FLAG = #deleteFlag#
</isNotEmpty>
-->
<insert id="insert">
INSERT INTO hpjx.t_hpsb001 (ID, <!-- ID -->
ERROR_CODE, <!-- 异常编码 -->
PRIO, <!-- 异常登记 -->
PROGRAM_NO, <!-- 程序号 -->
ROWNO, <!-- 行号 -->
GOTO_ROW_NONE, <!-- 不存在跳转行 -->
FILE_NAME, <!-- 文件名 -->
EQUIPMENT_TYPE, <!-- 设备状态 -->
EQUIPMENT_CODE, <!-- 设备编码 -->
CREATED_BY, <!-- 创建人 -->
CREATED_NAME, <!-- 创建人名称 -->
CREATED_TIME, <!-- 创建时间 -->
UPDATED_BY, <!-- 更新人 -->
UPDATED_NAME, <!-- 更新人名称 -->
UPDATED_TIME, <!-- 更新时间 -->
DELETE_FLAG <!-- 是否删除0.否1.是 -->
)
VALUES (#id#, #errorCode#, #prio#, #programNo#, #rowno#, #gotoRowNone#, #fileName#, #equipmentType#, #equipmentCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #deleteFlag#)
</insert>
<delete id="delete">
DELETE FROM hpjx.t_hpsb001 WHERE
ID = #id#
</delete>
<update id="update">
UPDATE hpjx.t_hpsb001
SET
ERROR_CODE = #errorCode#, <!-- 异常编码 -->
PRIO = #prio#, <!-- 异常登记 -->
PROGRAM_NO = #programNo#, <!-- 程序号 -->
ROWNO = #rowno#, <!-- 行号 -->
GOTO_ROW_NONE = #gotoRowNone#, <!-- 不存在跳转行 -->
FILE_NAME = #fileName#, <!-- 文件名 -->
EQUIPMENT_TYPE = #equipmentType#, <!-- 设备状态 -->
EQUIPMENT_CODE = #equipmentCode#, <!-- 设备编码 -->
CREATED_BY = #createdBy#, <!-- 创建人 -->
CREATED_NAME = #createdName#, <!-- 创建人名称 -->
CREATED_TIME = #createdTime#, <!-- 创建时间 -->
UPDATED_BY = #updatedBy#, <!-- 更新人 -->
UPDATED_NAME = #updatedName#, <!-- 更新人名称 -->
UPDATED_TIME = #updatedTime#, <!-- 更新时间 -->
DELETE_FLAG = #deleteFlag# <!-- 是否删除0.否1.是 -->
WHERE
ID = #id#
</update>
</sqlMap>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://www.ibatis.com/dtd/sql-map-2.dtd">
<!-- table information
Generate time : 2024-04-12 16:36:57
Version : 1.0
tableName :hpjx.t_hpsb002
ID VARCHAR NOT NULL primarykey,
PROGRAM_NO VARCHAR,
ROWNO VARCHAR,
GOTO_ROW_NONE VARCHAR,
FILE_NAME VARCHAR,
EQUIPMENT_TYPE VARCHAR,
EQUIPMENT_CODE VARCHAR,
CREATED_BY VARCHAR,
CREATED_NAME VARCHAR,
CREATED_TIME VARCHAR,
UPDATED_BY VARCHAR,
UPDATED_NAME VARCHAR,
UPDATED_TIME VARCHAR,
DELETE_FLAG TINYINT,
ERROR_CODE VARCHAR,
PRIO VARCHAR
-->
<sqlMap namespace="HPSB002">
<select id="query" parameterClass="java.util.HashMap"
resultClass="com.baosight.hpjx.hp.sb.domain.HPSB002">
SELECT
ID as "id", <!-- ID -->
PROGRAM_NO as "programNo", <!-- 程序号 -->
ROWNO as "rowno", <!-- 行号 -->
GOTO_ROW_NONE as "gotoRowNone", <!-- 不存在跳转行 -->
FILE_NAME as "fileName", <!-- 文件名 -->
EQUIPMENT_TYPE as "equipmentType", <!-- 设备状态 -->
EQUIPMENT_CODE as "equipmentCode", <!-- 设备编码 -->
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.是 -->
ERROR_CODE as "errorCode", <!-- 异常编码 -->
PRIO as "prio" <!-- 异常登记 -->
FROM hpjx.t_hpsb002 WHERE 1=1
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
ID asc
</isEmpty>
</dynamic>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM hpjx.t_hpsb002 WHERE 1=1
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
</select>
<!--
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="programNo">
PROGRAM_NO = #programNo#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="rowno">
ROWNO = #rowno#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="gotoRowNone">
GOTO_ROW_NONE = #gotoRowNone#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="fileName">
FILE_NAME = #fileName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="equipmentType">
EQUIPMENT_TYPE = #equipmentType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="equipmentCode">
EQUIPMENT_CODE = #equipmentCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
CREATED_BY = #createdBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdName">
CREATED_NAME = #createdName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
CREATED_TIME = #createdTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy">
UPDATED_BY = #updatedBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedName">
UPDATED_NAME = #updatedName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime">
UPDATED_TIME = #updatedTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deleteFlag">
DELETE_FLAG = #deleteFlag#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="errorCode">
ERROR_CODE = #errorCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="prio">
PRIO = #prio#
</isNotEmpty>
-->
<insert id="insert">
INSERT INTO hpjx.t_hpsb002 (ID, <!-- ID -->
PROGRAM_NO, <!-- 程序号 -->
ROWNO, <!-- 行号 -->
GOTO_ROW_NONE, <!-- 不存在跳转行 -->
FILE_NAME, <!-- 文件名 -->
EQUIPMENT_TYPE, <!-- 设备状态 -->
EQUIPMENT_CODE, <!-- 设备编码 -->
CREATED_BY, <!-- 创建人 -->
CREATED_NAME, <!-- 创建人名称 -->
CREATED_TIME, <!-- 创建时间 -->
UPDATED_BY, <!-- 更新人 -->
UPDATED_NAME, <!-- 更新人名称 -->
UPDATED_TIME, <!-- 更新时间 -->
DELETE_FLAG, <!-- 是否删除0.否1.是 -->
ERROR_CODE, <!-- 异常编码 -->
PRIO <!-- 异常登记 -->
)
VALUES (#id#, #programNo#, #rowno#, #gotoRowNone#, #fileName#, #equipmentType#, #equipmentCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #deleteFlag#, #errorCode#, #prio#)
</insert>
<delete id="delete">
DELETE FROM hpjx.t_hpsb002 WHERE
ID = #id#
</delete>
<update id="update">
UPDATE hpjx.t_hpsb002
SET
PROGRAM_NO = #programNo#, <!-- 程序号 -->
ROWNO = #rowno#, <!-- 行号 -->
GOTO_ROW_NONE = #gotoRowNone#, <!-- 不存在跳转行 -->
FILE_NAME = #fileName#, <!-- 文件名 -->
EQUIPMENT_TYPE = #equipmentType#, <!-- 设备状态 -->
EQUIPMENT_CODE = #equipmentCode#, <!-- 设备编码 -->
CREATED_BY = #createdBy#, <!-- 创建人 -->
CREATED_NAME = #createdName#, <!-- 创建人名称 -->
CREATED_TIME = #createdTime#, <!-- 创建时间 -->
UPDATED_BY = #updatedBy#, <!-- 更新人 -->
UPDATED_NAME = #updatedName#, <!-- 更新人名称 -->
UPDATED_TIME = #updatedTime#, <!-- 更新时间 -->
DELETE_FLAG = #deleteFlag#, <!-- 是否删除0.否1.是 -->
ERROR_CODE = #errorCode#, <!-- 异常编码 -->
PRIO = #prio# <!-- 异常登记 -->
WHERE
ID = #id#
</update>
</sqlMap>
\ No newline at end of file
<?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">
<sqlMap namespace="HPSB003">
<sql id="authCondition">
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCodes">
DEP_CODE IN <iterate close=")" open="(" conjunction="," property="depCodes">#depCodes[]#</iterate>
</isNotEmpty>
</sql>
<sql id="condition">
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
CREATED_BY = #createdBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdName">
CREATED_NAME = #createdName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
CREATED_TIME = #createdTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy">
UPDATED_BY = #updatedBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedName">
UPDATED_NAME = #updatedName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime">
UPDATED_TIME = #updatedTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deleteFlag">
DELETE_FLAG = #deleteFlag#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryCode">
FACTORY_CODE = #factoryCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="groupCode">
GROUP_CODE = #groupCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deviceType">
DEVICE_TYPE = #deviceType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deviceCode">
DEVICE_CODE LIKE CONCAT('%', #deviceCode#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deviceName">
DEVICE_NAME LIKE CONCAT('%', #deviceName#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deviceModel">
DEVICE_MODEL = #deviceModel#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="purchaseDate">
PURCHASE_DATE = #purchaseDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="maintainDate">
MAINTAIN_DATE = #maintainDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deviceUserId">
DEVICE_USER_ID = #deviceUserId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deviceStatus">
DEVICE_STATUS = #deviceStatus#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deviceCodeStr">
DEVICE_CODE = #deviceCodeStr#
</isNotEmpty>
</sql>
<!--根据companyCode获取用户绑定的组织的工厂编码-->
<sql id="queryFactoryCodeBase">
SELECT DISTINCT FACTORY_CODE
FROM ${platSchema}.txsog01
WHERE IS_DELETED = '0'
and COMPANY_CODE = #companyCode#
and ORG_ID in (<include refid="queryLoginNameBase"/>)
</sql>
<!--根据companyCode获取用户绑定的组织机构ID-->
<sql id="queryLoginNameBase">
select ORG_ID from ${platSchema}.txsog02 T2 inner join ${platSchema}.xs_user xu on t2.USER_ID = xu.USER_ID
where xu.COMPANY_CODE = #companyCode#
order by T2.REC_CREATE_TIME desc
</sql>
<select id="query" parameterClass="java.util.HashMap"
resultClass="com.baosight.hpjx.hp.sb.domain.HPSB003">
SELECT
ID as "id", <!-- ID -->
COMPANY_CODE as "companyCode", <!-- 公司编码 -->
DEP_CODE as "depCode", <!-- 部门编码 -->
CREATED_BY as "createdBy", <!-- 创建人 -->
CREATED_NAME as "createdName", <!-- 创建人名称 -->
CREATED_TIME as "createdTime", <!-- 创建时间 -->
UPDATED_BY as "updatedBy", <!-- 修改人 -->
UPDATED_NAME as "updatedName", <!-- 修改人名称 -->
UPDATED_TIME as "updatedTime", <!-- 修改时间 -->
DELETE_FLAG as "deleteFlag", <!-- 是否删除 0-否1-是 -->
FACTORY_CODE as "factoryCode", <!-- 工厂代码(公司名称) -->
GROUP_CODE as "groupCode", <!-- 生产组代码(设备区域) -->
DEVICE_TYPE as "deviceType", <!-- 设备类型 -->
DEVICE_CODE as "deviceCode", <!-- 设备编码 -->
DEVICE_NAME as "deviceName", <!-- 设备名称 -->
DEVICE_MODEL as "deviceModel", <!-- 设备型号 -->
PURCHASE_DATE as "purchaseDate", <!-- 购置日期 -->
MAINTAIN_DATE as "maintainDate", <!-- 保养日期 -->
DEVICE_USER_ID as "deviceUserId", <!-- 设备负责人 -->
DEVICE_STATUS as "deviceStatus" <!-- 设备状态 0-停止 1-启用 -->
FROM ${hpjxSchema}.T_HPSB003 WHERE 1=1
<include refid="authCondition"/>
<include refid="condition" />
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
FACTORY_CODE,GROUP_CODE,PURCHASE_DATE DESC,CREATED_TIME DESC
</isEmpty>
</dynamic>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hpjxSchema}.T_HPSB003 WHERE 1=1
<include refid="authCondition"/>
<include refid="condition" />
</select>
<!--
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
CREATED_BY = #createdBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdName">
CREATED_NAME = #createdName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
CREATED_TIME = #createdTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy">
UPDATED_BY = #updatedBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedName">
UPDATED_NAME = #updatedName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime">
UPDATED_TIME = #updatedTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deleteFlag">
DELETE_FLAG = #deleteFlag#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryCode">
FACTORY_CODE = #factoryCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="groupCode">
GROUP_CODE = #groupCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deviceType">
DEVICE_TYPE = #deviceType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deviceCode">
DEVICE_CODE = #deviceCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deviceName">
DEVICE_NAME = #deviceName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deviceModel">
DEVICE_MODEL = #deviceModel#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="purchaseDate">
PURCHASE_DATE = #purchaseDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="maintainDate">
MAINTAIN_DATE = #maintainDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deviceUserId">
DEVICE_USER_ID = #deviceUserId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deviceStatus">
DEVICE_STATUS = #deviceStatus#
</isNotEmpty>
-->
<insert id="insert">
INSERT INTO ${hpjxSchema}.T_HPSB003 (ID, <!-- ID -->
COMPANY_CODE, <!-- 公司编码 -->
DEP_CODE, <!-- 部门编码 -->
CREATED_BY, <!-- 创建人 -->
CREATED_NAME, <!-- 创建人名称 -->
CREATED_TIME, <!-- 创建时间 -->
UPDATED_BY, <!-- 修改人 -->
UPDATED_NAME, <!-- 修改人名称 -->
UPDATED_TIME, <!-- 修改时间 -->
DELETE_FLAG, <!-- 是否删除 0-否1-是 -->
FACTORY_CODE, <!-- 工厂代码(公司名称) -->
GROUP_CODE, <!-- 生产组代码(设备区域) -->
DEVICE_TYPE, <!-- 设备类型 -->
DEVICE_CODE, <!-- 设备编码 -->
DEVICE_NAME, <!-- 设备名称 -->
DEVICE_MODEL, <!-- 设备型号 -->
PURCHASE_DATE, <!-- 购置日期 -->
MAINTAIN_DATE, <!-- 保养日期 -->
DEVICE_USER_ID, <!-- 设备负责人 -->
DEVICE_STATUS <!-- 设备状态 0-停止 1-启用 -->
)
VALUES (#id#, #companyCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #deleteFlag#, #factoryCode#, #groupCode#, #deviceType#, #deviceCode#, #deviceName#, #deviceModel#, #purchaseDate#, #maintainDate#, #deviceUserId#, #deviceStatus#)
</insert>
<delete id="delete">
DELETE FROM ${hpjxSchema}.T_HPSB003 WHERE
ID = #id#
</delete>
<update id="deleteFlag">
UPDATE ${hpjxSchema}.T_HPSB003
SET
DELETE_FLAG = #deleteFlag#, <!-- 是否删除0:否1.是 -->
UPDATED_BY = #updatedBy#, <!-- 修改人 -->
UPDATED_TIME = #updatedTime#, <!-- 修改人名称 -->
UPDATED_NAME = #updatedName# <!-- 修改时间 -->
WHERE
ID = #id#
</update>
<update id="update">
UPDATE ${hpjxSchema}.T_HPSB003
SET
COMPANY_CODE = #companyCode#, <!-- 公司编码 -->
DEP_CODE = #depCode#, <!-- 部门编码 -->
CREATED_BY = #createdBy#, <!-- 创建人 -->
CREATED_NAME = #createdName#, <!-- 创建人名称 -->
CREATED_TIME = #createdTime#, <!-- 创建时间 -->
UPDATED_BY = #updatedBy#, <!-- 修改人 -->
UPDATED_NAME = #updatedName#, <!-- 修改人名称 -->
UPDATED_TIME = #updatedTime#, <!-- 修改时间 -->
DELETE_FLAG = #deleteFlag#, <!-- 是否删除 0-否1-是 -->
FACTORY_CODE = #factoryCode#, <!-- 工厂代码(公司名称) -->
GROUP_CODE = #groupCode#, <!-- 生产组代码(设备区域) -->
DEVICE_TYPE = #deviceType#, <!-- 设备类型 -->
DEVICE_CODE = #deviceCode#, <!-- 设备编码 -->
DEVICE_NAME = #deviceName#, <!-- 设备名称 -->
DEVICE_MODEL = #deviceModel#, <!-- 设备型号 -->
PURCHASE_DATE = #purchaseDate#, <!-- 购置日期 -->
MAINTAIN_DATE = #maintainDate#, <!-- 保养日期 -->
DEVICE_USER_ID = #deviceUserId#, <!-- 设备负责人 -->
DEVICE_STATUS = #deviceStatus# <!-- 设备状态 0-停止 1-启用 -->
WHERE
ID = #id#
</update>
<update id="updateDeviceStatus">
UPDATE ${hpjxSchema}.T_HPSB003
SET
UPDATED_BY = #updatedBy#, <!-- 修改人 -->
UPDATED_NAME = #updatedName#, <!-- 修改人名称 -->
UPDATED_TIME = #updatedTime#, <!-- 修改时间 -->
DEVICE_STATUS = #deviceStatus# <!-- 设备状态 0-停止 1-启用 -->
WHERE
ID = #id#
</update>
<select id="queryFactoryCodeBox" parameterClass="java.util.HashMap" resultClass="java.util.HashMap">
SELECT distinct
FACTORY_CODE as "factoryCode",
FACTORY_NAME as "factoryName"
FROM ${platSchema}.txsog01
WHERE IS_DELETED = '0' AND FACTORY_CODE IS NOT NULL
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
<!--and ORG_ID IN (<include refid="queryLoginNameBase"/>)-->
</isNotEmpty>
ORDER BY FACTORY_CODE,REC_CREATE_TIME desc
</select>
<select id="queryGroupCodeBox" parameterClass="java.util.HashMap" resultClass="java.util.HashMap">
SELECT
T2.LEVEL AS "level",
T3.ORG_ID AS "groupCode",
CONCAT('[',T5.FACTORY_NAME,']',T3.ORG_CNAME) AS "groupName",
T3.FACTORY_CODE AS "factoryCode",
T5.FACTORY_NAME AS "factoryName"
FROM (
SELECT
@CODES AS CODES,
(SELECT @CODES:=GROUP_CONCAT(ORG_ID)
FROM ${platSchema}.TXSOG01
WHERE FIND_IN_SET(PARENT_ORG_ID, @CODES)
AND COMPANY_CODE = #companyCode#
AND IS_DELETED = 0
) AS T1,
@LEVEL:=@LEVEL+1 AS LEVEL
FROM ${platSchema}.TXSOG01,
<isNotEmpty property="parentOrgId">
(SELECT @CODES:=#parentOrgId#, @LEVEL:= 0) T4
</isNotEmpty>
<isEmpty property="parentOrgId">
(SELECT @CODES:='root', @LEVEL:= 0) T4
</isEmpty>
WHERE @CODES IS NOT NULL
) T2,
${platSchema}.TXSOG01 T3
LEFT JOIN ${platSchema}.TXSOG01 T5 ON T3.FACTORY_CODE = T5.ORG_ID
WHERE 1=1
AND FIND_IN_SET(T3.ORG_ID, T2.CODES)
AND T3.IS_DELETED = '0'
and T3.ORG_ID != 'root'
<isNotEmpty prepend=" AND " property="orgType">
T3.ORG_TYPE = #orgType#
</isNotEmpty>
<isNotEmpty property="AND" prepend="orgTypes">
ORG_TYPE NOT IN <iterate close=")" open="(" conjunction="," property="depCodes">#orgTypes[]#</iterate>
</isNotEmpty>
<isEmpty prepend="AND" property="orgType">
T3.ORG_TYPE NOT IN ('factory','dept')
</isEmpty>
<isNotEmpty prepend=" AND " property="factoryCode">
T3.FACTORY_CODE = #factoryCode#
</isNotEmpty>
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
T3.FACTORY_CODE,T2.LEVEL, T3.ORG_ID
</isEmpty>
</dynamic>
</select>
<select id="queryUserIdBox" parameterClass="java.util.HashMap" resultClass="java.util.HashMap">
select distinct
LOGIN_NAME as "userId",
USER_NAME as "userName"
from ${platSchema}.xs_user T1
inner join ${platSchema}.txsog02 T2 ON t2.USER_ID = T1.USER_ID
where 1=1
<isNotEmpty prepend=" AND " property="companyCode">
T1.COMPANY_CODE = #companyCode#
</isNotEmpty>
<!--<isNotEmpty prepend="AND" property="companyCode">
T2.ORG_ID IN (<include refid="queryLoginNameBase"/>)
</isNotEmpty>-->
<!--<isNotEmpty prepend="and" property="companyCode">
ORG_ID in (
select ORG_ID FROM iplat.txsog01
WHERE IS_DELETED = '0'
and COMPANY_CODE = #companyCode#
<isNotEmpty prepend="and" property="orgEname">
ORG_ENAME = #orgEname#
</isNotEmpty>
AND ORG_TYPE NOT IN ('factory','dept')
and FACTORY_CODE IN (
SELECT FACTORY_CODE FROM iplat.txsog01
WHERE IS_DELETED = '0' and COMPANY_CODE = #companyCode#
and ORG_ID IN (
SELECT ORG_ID FROM iplat.txsog02 T2
INNER JOIN iplat.xs_user xu ON t2.USER_ID = xu.USER_ID
WHERE xu.COMPANY_CODE = #companyCode#
ORDER BY T2.REC_CREATE_TIME desc
)
)
)
</isNotEmpty>-->
</select>
</sqlMap>
package com.baosight.hpjx.hp.sc.domain;
import com.baosight.iplat4j.core.util.NumberUtils;
import java.math.BigDecimal;
import com.baosight.iplat4j.core.ei.EiColumn;
import com.baosight.iplat4j.core.data.DaoEPBase;
import java.util.HashMap;
import java.util.Map;
import com.baosight.iplat4j.core.util.StringUtils;
/**
* Project: <br>
* Title:THpsc009.java <br>
* Description: <br>
*
* Copyrigth:Baosight Software LTD.co Copyright (c) 2019. <br>
*
* @version 1.0
* @history 2024-04-10 17:28:06 create
*/
public class HPSC010A extends DaoEPBase {
private static final long serialVersionUID = 1L;
public static final String FIELD_ID = "id"; /* ID*/
public static final String FIELD_COMPANY_CODE = "companyCode"; /* 企业编码 预留*/
public static final String FIELD_DEP_CODE = "depCode"; /* 部门编码 预留*/
public static final String FIELD_REGISTER_DATE = "registerDate"; /* 登记日期*/
public static final String FIELD_FACTORY_CODE = "factoryCode"; /* 工厂代码*/
public static final String FIELD_GROUP_CODE = "groupCode"; /* 生产组代码*/
public static final String FIELD_USER_ID = "userId"; /* 员工代码*/
public static final String FIELD_GROUP_TYPE = "groupType"; /* 生产类型*/
public static final String FIELD_PRDT_CODE = "prdtCode"; /* 产品代码*/
public static final String FIELD_PRDT_NAME = "prdtName"; /* 产品名称*/
public static final String FIELD_WEIGHT = "weight"; /* 产量*/
public static final String FIELD_WEIGHT_JH = "weightJh"; /* 加焊产量*/
public static final String FIELD_PARENT_ID = "parentId"; /* 父级ID*/
public static final String FIELD_DELETE_FLAG = "deleteFlag"; /* 是否删除0:否1.是*/
public static final String FIELD_CREATED_BY = "createdBy"; /* 创建人*/
public static final String FIELD_CREATED_NAME = "createdName"; /* 创建人名称*/
public static final String FIELD_CREATED_TIME = "createdTime"; /* 创建时间*/
public static final String FIELD_UPDATED_BY = "updatedBy"; /* 修改人*/
public static final String FIELD_UPDATED_TIME = "updatedTime"; /* 修改人名称*/
public static final String FIELD_UPDATED_NAME = "updatedName"; /* 修改时间*/
public static final String COL_ID = "ID"; /* ID*/
public static final String COL_COMPANY_CODE = "COMPANY_CODE"; /* 企业编码 预留*/
public static final String COL_DEP_CODE = "DEP_CODE"; /* 部门编码 预留*/
public static final String COL_REGISTER_DATE = "REGISTER_DATE"; /* 登记日期*/
public static final String COL_FACTORY_CODE = "FACTORY_CODE"; /* 工厂代码*/
public static final String COL_GROUP_CODE = "GROUP_CODE"; /* 生产组代码*/
public static final String COL_USER_ID = "USER_ID"; /* 员工代码*/
public static final String COL_GROUP_TYPE = "GROUP_TYPE"; /* 生产类型*/
public static final String COL_PRDT_CODE = "PRDT_CODE"; /* 产品代码*/
public static final String COL_PRDT_NAME = "PRDT_NAME"; /* 产品名称*/
public static final String COL_WEIGHT = "WEIGHT"; /* 产量*/
public static final String COL_WEIGHT_JH = "WEIGHT_JH"; /* 加焊产量*/
public static final String COL_PARENT_ID = "PARENT_ID"; /* 父级ID*/
public static final String COL_DELETE_FLAG = "DELETE_FLAG"; /* 是否删除0:否1.是*/
public static final String COL_CREATED_BY = "CREATED_BY"; /* 创建人*/
public static final String COL_CREATED_NAME = "CREATED_NAME"; /* 创建人名称*/
public static final String COL_CREATED_TIME = "CREATED_TIME"; /* 创建时间*/
public static final String COL_UPDATED_BY = "UPDATED_BY"; /* 修改人*/
public static final String COL_UPDATED_TIME = "UPDATED_TIME"; /* 修改人名称*/
public static final String COL_UPDATED_NAME = "UPDATED_NAME"; /* 修改时间*/
public static final String QUERY = "HPSC010A.query";
public static final String COUNT = "HPSC010A.count";
public static final String INSERT = "HPSC010A.insert";
public static final String UPDATE = "HPSC010A.update";
public static final String DELETE = "HPSC010A.delete";
public static final String DELETE_FLAG = "HPSC010A.deleteFlag";
public static final String DELETE_PARENT_ID = "HPSC010A.deleteParentId";
public static final String QUERY_DETAIL = "HPSC010A.queryDetail";
public static final String QUERY_RESULT = "HPSC010A.queryResult";
private Long id = new Long(0); /* ID*/
private String companyCode = " "; /* 企业编码 预留*/
private String depCode = " "; /* 部门编码 预留*/
private String registerDate = " "; /* 登记日期*/
private String factoryCode = " "; /* 工厂代码*/
private String groupCode = " "; /* 生产组代码*/
private String userId = " "; /* 员工代码*/
private String groupType = " "; /* 生产类型*/
private String prdtCode = " "; /* 产品代码*/
private String prdtName = " "; /* 产品名称*/
private BigDecimal weight = new BigDecimal("0"); /* 产量*/
private BigDecimal weightJh = new BigDecimal("0"); /* 加焊产量*/
private Integer rowNo = 0;
private Long parentId = new Long(0); /* 父级ID*/
private Integer deleteFlag; /* 是否删除0:否1.是*/
private String createdBy = " "; /* 创建人*/
private String createdName = " "; /* 创建人名称*/
private String createdTime = " "; /* 创建时间*/
private String updatedBy = " "; /* 修改人*/
private String updatedTime = " "; /* 修改人名称*/
private String updatedName = " "; /* 修改时间*/
/**
* initialize the metadata.
*/
public void initMetaData() {
EiColumn eiColumn;
eiColumn = new EiColumn(FIELD_ID);
eiColumn.setPrimaryKey(true);
eiColumn.setDescName("ID");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_COMPANY_CODE);
eiColumn.setDescName("企业编码 预留");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DEP_CODE);
eiColumn.setDescName("部门编码 预留");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_REGISTER_DATE);
eiColumn.setDescName("登记日期");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_FACTORY_CODE);
eiColumn.setDescName("工厂代码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_GROUP_CODE);
eiColumn.setDescName("生产组代码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_USER_ID);
eiColumn.setDescName("员工代码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_GROUP_TYPE);
eiColumn.setDescName("生产类型");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_PRDT_CODE);
eiColumn.setDescName("产品代码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_PRDT_NAME);
eiColumn.setDescName("产品名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_WEIGHT);
eiColumn.setType("N");
eiColumn.setScaleLength(3);
eiColumn.setFieldLength(20);
eiColumn.setDescName("产量");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_WEIGHT_JH);
eiColumn.setType("N");
eiColumn.setScaleLength(3);
eiColumn.setFieldLength(20);
eiColumn.setDescName("加焊产量");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_PARENT_ID);
eiColumn.setDescName("父级ID");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DELETE_FLAG);
eiColumn.setDescName("是否删除0:否1.是");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CREATED_BY);
eiColumn.setDescName("创建人");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CREATED_NAME);
eiColumn.setDescName("创建人名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CREATED_TIME);
eiColumn.setDescName("创建时间");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_UPDATED_BY);
eiColumn.setDescName("修改人");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_UPDATED_TIME);
eiColumn.setDescName("修改人名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_UPDATED_NAME);
eiColumn.setDescName("修改时间");
eiMetadata.addMeta(eiColumn);
}
/**
* the constructor.
*/
public HPSC010A() {
initMetaData();
}
/**
* get the id - ID.
* @return the id
*/
public Long getId() {
return this.id;
}
/**
* set the id - ID.
*
* @param id - ID
*/
public void setId(Long id) {
this.id = id;
}
/**
* get the companyCode - 企业编码 预留.
* @return the companyCode
*/
public String getCompanyCode() {
return this.companyCode;
}
/**
* set the companyCode - 企业编码 预留.
*
* @param companyCode - 企业编码 预留
*/
public void setCompanyCode(String companyCode) {
this.companyCode = companyCode;
}
/**
* get the depCode - 部门编码 预留.
* @return the depCode
*/
public String getDepCode() {
return this.depCode;
}
/**
* set the depCode - 部门编码 预留.
*
* @param depCode - 部门编码 预留
*/
public void setDepCode(String depCode) {
this.depCode = depCode;
}
/**
* get the registerDate - 登记日期.
* @return the registerDate
*/
public String getRegisterDate() {
return this.registerDate;
}
/**
* set the registerDate - 登记日期.
*
* @param registerDate - 登记日期
*/
public void setRegisterDate(String registerDate) {
this.registerDate = registerDate;
}
/**
* get the factoryCode - 工厂代码.
* @return the factoryCode
*/
public String getFactoryCode() {
return this.factoryCode;
}
/**
* set the factoryCode - 工厂代码.
*
* @param factoryCode - 工厂代码
*/
public void setFactoryCode(String factoryCode) {
this.factoryCode = factoryCode;
}
/**
* get the groupCode - 生产组代码.
* @return the groupCode
*/
public String getGroupCode() {
return this.groupCode;
}
/**
* set the groupCode - 生产组代码.
*
* @param groupCode - 生产组代码
*/
public void setGroupCode(String groupCode) {
this.groupCode = groupCode;
}
/**
* get the userId - 员工代码.
* @return the userId
*/
public String getUserId() {
return this.userId;
}
/**
* set the userId - 员工代码.
*
* @param userId - 员工代码
*/
public void setUserId(String userId) {
this.userId = userId;
}
/**
* get the groupType - 生产类型.
* @return the groupType
*/
public String getGroupType() {
return this.groupType;
}
/**
* set the groupType - 生产类型.
*
* @param groupType - 生产类型
*/
public void setGroupType(String groupType) {
this.groupType = groupType;
}
/**
* get the prdtCode - 产品代码.
* @return the prdtCode
*/
public String getPrdtCode() {
return this.prdtCode;
}
/**
* set the prdtCode - 产品代码.
*
* @param prdtCode - 产品代码
*/
public void setPrdtCode(String prdtCode) {
this.prdtCode = prdtCode;
}
/**
* get the prdtName - 产品名称.
* @return the prdtName
*/
public String getPrdtName() {
return this.prdtName;
}
/**
* set the prdtName - 产品名称.
*
* @param prdtName - 产品名称
*/
public void setPrdtName(String prdtName) {
this.prdtName = prdtName;
}
/**
* get the weight - 产量.
* @return the weight
*/
public BigDecimal getWeight() {
return this.weight;
}
/**
* set the weight - 产量.
*
* @param weight - 产量
*/
public void setWeight(BigDecimal weight) {
this.weight = weight;
}
/**
* get the weightJh - 加焊产量.
* @return the weightJh
*/
public BigDecimal getWeightJh() {
return this.weightJh;
}
/**
* set the weightJh - 加焊产量.
*
* @param weightJh - 加焊产量
*/
public void setWeightJh(BigDecimal weightJh) {
this.weightJh = weightJh;
}
/**
* get the parentId - 父级ID.
* @return the parentId
*/
public Long getParentId() {
return this.parentId;
}
/**
* set the parentId - 父级ID.
*
* @param parentId - 父级ID
*/
public void setParentId(Long parentId) {
this.parentId = parentId;
}
/**
* get the deleteFlag - 是否删除0:否1.是.
* @return the deleteFlag
*/
public Integer getDeleteFlag() {
return this.deleteFlag;
}
/**
* set the deleteFlag - 是否删除0:否1.是.
*
* @param deleteFlag - 是否删除0:否1.是
*/
public void setDeleteFlag(Integer deleteFlag) {
this.deleteFlag = deleteFlag;
}
/**
* get the createdBy - 创建人.
* @return the createdBy
*/
public String getCreatedBy() {
return this.createdBy;
}
/**
* set the createdBy - 创建人.
*
* @param createdBy - 创建人
*/
public void setCreatedBy(String createdBy) {
this.createdBy = createdBy;
}
/**
* get the createdName - 创建人名称.
* @return the createdName
*/
public String getCreatedName() {
return this.createdName;
}
/**
* set the createdName - 创建人名称.
*
* @param createdName - 创建人名称
*/
public void setCreatedName(String createdName) {
this.createdName = createdName;
}
/**
* get the createdTime - 创建时间.
* @return the createdTime
*/
public String getCreatedTime() {
return this.createdTime;
}
/**
* set the createdTime - 创建时间.
*
* @param createdTime - 创建时间
*/
public void setCreatedTime(String createdTime) {
this.createdTime = createdTime;
}
/**
* get the updatedBy - 修改人.
* @return the updatedBy
*/
public String getUpdatedBy() {
return this.updatedBy;
}
/**
* set the updatedBy - 修改人.
*
* @param updatedBy - 修改人
*/
public void setUpdatedBy(String updatedBy) {
this.updatedBy = updatedBy;
}
/**
* get the updatedTime - 修改人名称.
* @return the updatedTime
*/
public String getUpdatedTime() {
return this.updatedTime;
}
/**
* set the updatedTime - 修改人名称.
*
* @param updatedTime - 修改人名称
*/
public void setUpdatedTime(String updatedTime) {
this.updatedTime = updatedTime;
}
/**
* get the updatedName - 修改时间.
* @return the updatedName
*/
public String getUpdatedName() {
return this.updatedName;
}
/**
* set the updatedName - 修改时间.
*
* @param updatedName - 修改时间
*/
public void setUpdatedName(String updatedName) {
this.updatedName = updatedName;
}
public Integer getRowNo() {
return rowNo;
}
public void setRowNo(Integer rowNo) {
this.rowNo = rowNo;
}
/**
* get the value from Map.
*
* @param map - source data map
*/
@Override
public void fromMap(Map map) {
setId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_ID)), id));
setCompanyCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_COMPANY_CODE)), companyCode));
setDepCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DEP_CODE)), depCode));
setRegisterDate(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_REGISTER_DATE)), registerDate));
setFactoryCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_FACTORY_CODE)), factoryCode));
setGroupCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_GROUP_CODE)), groupCode));
setUserId(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_USER_ID)), userId));
setGroupType(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_GROUP_TYPE)), groupType));
setPrdtCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PRDT_CODE)), prdtCode));
setPrdtName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PRDT_NAME)), prdtName));
setWeight(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_WEIGHT)), weight));
setWeightJh(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_WEIGHT_JH)), weightJh));
setParentId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_PARENT_ID)), parentId));
setDeleteFlag(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_DELETE_FLAG)), deleteFlag));
setCreatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_BY)), createdBy));
setCreatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_NAME)), createdName));
setCreatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_TIME)), createdTime));
setUpdatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_BY)), updatedBy));
setUpdatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_TIME)), updatedTime));
setUpdatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_NAME)), updatedName));
}
/**
* set the value to Map.
*/
@Override
public Map toMap() {
Map map = new HashMap();
map.put(FIELD_ID, StringUtils.toString(id, eiMetadata.getMeta(FIELD_ID)));
map.put(FIELD_COMPANY_CODE, StringUtils.toString(companyCode, eiMetadata.getMeta(FIELD_COMPANY_CODE)));
map.put(FIELD_DEP_CODE, StringUtils.toString(depCode, eiMetadata.getMeta(FIELD_DEP_CODE)));
map.put(FIELD_REGISTER_DATE, StringUtils.toString(registerDate, eiMetadata.getMeta(FIELD_REGISTER_DATE)));
map.put(FIELD_FACTORY_CODE, StringUtils.toString(factoryCode, eiMetadata.getMeta(FIELD_FACTORY_CODE)));
map.put(FIELD_GROUP_CODE, StringUtils.toString(groupCode, eiMetadata.getMeta(FIELD_GROUP_CODE)));
map.put(FIELD_USER_ID, StringUtils.toString(userId, eiMetadata.getMeta(FIELD_USER_ID)));
map.put(FIELD_GROUP_TYPE, StringUtils.toString(groupType, eiMetadata.getMeta(FIELD_GROUP_TYPE)));
map.put(FIELD_PRDT_CODE, StringUtils.toString(prdtCode, eiMetadata.getMeta(FIELD_PRDT_CODE)));
map.put(FIELD_PRDT_NAME, StringUtils.toString(prdtName, eiMetadata.getMeta(FIELD_PRDT_NAME)));
map.put(FIELD_WEIGHT, StringUtils.toString(weight, eiMetadata.getMeta(FIELD_WEIGHT)));
map.put(FIELD_WEIGHT_JH, StringUtils.toString(weightJh, eiMetadata.getMeta(FIELD_WEIGHT_JH)));
map.put(FIELD_PARENT_ID, StringUtils.toString(parentId, eiMetadata.getMeta(FIELD_PARENT_ID)));
map.put(FIELD_DELETE_FLAG, StringUtils.toString(deleteFlag, eiMetadata.getMeta(FIELD_DELETE_FLAG)));
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)));
map.put(FIELD_CREATED_TIME, StringUtils.toString(createdTime, eiMetadata.getMeta(FIELD_CREATED_TIME)));
map.put(FIELD_UPDATED_BY, StringUtils.toString(updatedBy, eiMetadata.getMeta(FIELD_UPDATED_BY)));
map.put(FIELD_UPDATED_TIME, StringUtils.toString(updatedTime, eiMetadata.getMeta(FIELD_UPDATED_TIME)));
map.put(FIELD_UPDATED_NAME, StringUtils.toString(updatedName, eiMetadata.getMeta(FIELD_UPDATED_NAME)));
return map;
}
}
......@@ -245,7 +245,7 @@ public class ServiceHPSC003 extends ServiceBase {
newSc005.setPartThick(dbSc004.getThick());
newSc005.setPartSpec(dbSc004.getSpec());
newSc005.setRemark1(dbSc004.getRemark());
newSc005.setWorkDate(DateUtils.shortDate());
//newSc005.setWorkDate(DateUtils.shortDate());
newSc005.setPlanCompletionDate(dbSc004.getPlanCompletionDate());
newSc005.setNum(dbSc004.getNum());
newSc005.setUnassignedNum(dbSc004.getNum());
......
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.hp.sc.domain.HPSC008;
import com.baosight.hpjx.hp.sc.domain.HPSC009;
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.StringUtils;
import com.baosight.hpjx.util.contants.ACConstants;
import com.baosight.iplat4j.core.ei.EiBlock;
import com.baosight.iplat4j.core.ei.EiConstant;
......@@ -32,7 +32,7 @@ public class ServiceHPSC010 extends ServiceEPBase {
@Override
public EiInfo initLoad(EiInfo inInfo) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HPSC009.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HPSC010.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
final EiInfo outEiInfo = super.query(inInfo, HPSC010.QUERY, new HPSC010().eiMetadata);
CommonMethod.initBlock(outEiInfo,
Arrays.asList(DdynamicEnum.FACTORY_CODE_BLOCK_ID), new HashMap<String,Object>());
......@@ -50,7 +50,7 @@ public class ServiceHPSC010 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);
inInfo.setCell(EiConstant.queryBlock,ACConstants.ROW_CODE_0,HPSC010.FIELD_DELETE_FLAG,CommonConstant.YesNo.NO_0);
return super.query(inInfo,HPSC010.QUERY,new HPSC010());
}
......@@ -64,7 +64,7 @@ public class ServiceHPSC010 extends ServiceEPBase {
Map<?, ?> map = eiBlock.getRow(i);
hpxs010.fromMap(map);
hpxs010.setDeleteFlag(CommonConstant.YesNo.YES_1);
delRows(hpxs010.getId().toString());
delRows(hpxs010.getId());
DaoUtils.update(HPSC010.DELETE_FLAG, hpxs010.toMap());
}
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
......@@ -79,18 +79,32 @@ public class ServiceHPSC010 extends ServiceEPBase {
return inInfo;
}
@OperationLogAnnotation(operModul = "报工管理",operType = "修改",operDesc = "修改操作")
@Override
public EiInfo update(EiInfo inInfo) {
int i = 0;
try {
HPSC010 hpxs010 = new HPSC010();
HPSC010 hpsc010 = new HPSC010();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
for (i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
hpxs010.fromMap(map);
hpxs010.setDeleteFlag(CommonConstant.YesNo.NO_0);
DaoUtils.update(HPSC010.UPDATE, hpxs010);
List<Map> list = eiBlock.getRows();
list.addAll(inInfo.getBlock(CommonConstant.Field.DETAIL).getRows());
double weight = 0;
//BigDecimal weight = new BigDecimal("0");
for (i = 0; i < list.size(); i++) {
Map<?, ?> map = list.get(i);
HPSC010A hpsc010A = new HPSC010A();
hpsc010A.fromMap(map);
weight = weight+hpsc010A.getWeight().doubleValue()+hpsc010A.getWeightJh().doubleValue();
}
String registerDate = inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HPSC010.FIELD_REGISTER_DATE);
hpsc010.fromMap(eiBlock.getRow(0));
hpsc010.setDeleteFlag(CommonConstant.YesNo.NO_0);
hpsc010.setWeight(BigDecimal.valueOf(weight/2));
hpsc010.setId(Long.valueOf(inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HPSC010.FIELD_ID)));
hpsc010.setRegisterDate(StringUtil.removeHorizontalLine(registerDate));
hpsc010.setUserCount(Long.valueOf(inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HPSC010.FIELD_USER_COUNT)));
DaoUtils.update(HPSC010.UPDATE, hpsc010);
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsgByKey("ep.1000", new String[]{String.valueOf(i), I18nMessages.getText("label.update", "修改")});
} catch (PlatException e) {
......@@ -103,6 +117,7 @@ public class ServiceHPSC010 extends ServiceEPBase {
return inInfo;
}
@OperationLogAnnotation(operModul = "报工管理",operType = "新增",operDesc = "新增操作")
@Override
public EiInfo insert(EiInfo inInfo) {
int i = 0;
......@@ -112,17 +127,20 @@ public class ServiceHPSC010 extends ServiceEPBase {
List<Map> list = eiBlock.getRows();
list.addAll(inInfo.getBlock(CommonConstant.Field.DETAIL).getRows());
double weight = 0;
//BigDecimal weight = new BigDecimal("0");
String registerDate = inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HPSC010.FIELD_REGISTER_DATE);
Map queryMap = new HashMap();
queryMap.put(HPSC010.FIELD_FACTORY_CODE,list.get(0).get(HPSC010.FIELD_FACTORY_CODE));
queryMap.put(HPSC010.FIELD_REGISTER_DATE,StringUtil.removeHorizontalLine(registerDate));
queryFactoryCode(inInfo,queryMap);
for (i = 0; i < list.size(); i++) {
Map<?, ?> map = list.get(i);
HPSC008 hpsc008 = new HPSC008();
hpsc008.fromMap(map);
weight = weight+hpsc008.getWeight().doubleValue()+hpsc008.getWeightJh().doubleValue();
HPSC010A hpsc010A = new HPSC010A();
hpsc010A.fromMap(map);
weight = weight+hpsc010A.getWeight().doubleValue()+hpsc010A.getWeightJh().doubleValue();
}
String registerDate = inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HPSC010.FIELD_REGISTER_DATE);
hpxs010.fromMap(eiBlock.getRow(0));
hpxs010.setDeleteFlag(CommonConstant.YesNo.NO_0);
hpxs010.setWeight(BigDecimal.valueOf(weight));
hpxs010.setWeight(BigDecimal.valueOf(weight/2));
hpxs010.setRegisterDate(StringUtil.removeHorizontalLine(registerDate));
hpxs010.setUserCount(Long.valueOf(inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HPSC010.FIELD_USER_COUNT)));
DaoUtils.insert(HPSC010.INSERT, hpxs010);
......@@ -131,17 +149,24 @@ public class ServiceHPSC010 extends ServiceEPBase {
} catch (PlatException e) {
e.printStackTrace();
inInfo.setStatus(EiConstant.STATUS_FAILURE);
ErrorCodeUtils.handleInsertException(inInfo,i,e);
logError("新增失败", e.getMessage());
LogUtils.setDetailMsg(inInfo, e, "保存失败");
return inInfo;
}
return inInfo;
}
public void delRows(String id){
HPSC008 hpxs001 = new HPSC008();
hpxs001.setRemark(id);
hpxs001.setDeleteFlag(CommonConstant.YesNo.YES_1);
DaoUtils.update(HPSC008.DELETE_REMARK, hpxs001);
public void delRows(Long id){
HPSC010A hpsc010A = new HPSC010A();
hpsc010A.setParentId(id);
hpsc010A.setDeleteFlag(CommonConstant.YesNo.YES_1);
DaoUtils.update(HPSC010A.DELETE_PARENT_ID, hpsc010A);
}
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);
}
}
}
\ No newline at end of file
......@@ -4,6 +4,7 @@ import com.baosight.hpjx.common.DdynamicEnum;
import com.baosight.hpjx.core.constant.CommonConstant;
import com.baosight.hpjx.core.security.UserSessionUtils;
import com.baosight.hpjx.hp.sc.domain.HPSC008;
import com.baosight.hpjx.hp.sc.domain.HPSC010A;
import com.baosight.hpjx.util.CommonMethod;
import com.baosight.hpjx.util.StringUtil;
import com.baosight.hpjx.util.contants.ACConstants;
......@@ -24,10 +25,10 @@ public class ServiceHPSC010A extends ServiceEPBase {
@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_RESULT, new HPSC008());
EiInfo detailEiInfo = super.query(inInfo, HPSC008.QUERY_DETAIL, new HPSC008());
final EiInfo outEiInfo = super.query(inInfo, HPSC010A.QUERY_RESULT, new HPSC010A());
EiInfo detailEiInfo = super.query(inInfo, HPSC010A.QUERY_DETAIL, new HPSC010A());
EiBlock detailBlock = new EiBlock(CommonConstant.Field.DETAIL);
detailBlock.setBlockMeta(new HPSC008().eiMetadata);
detailBlock.setBlockMeta(new HPSC010A().eiMetadata);
detailBlock.setRows(detailEiInfo.getBlock(EiConstant.resultBlock).getRows());
outEiInfo.setBlock(detailBlock);
CommonMethod.initBlock(outEiInfo, Arrays.asList(DdynamicEnum.FACTORY_RECORD_BLOCK_ID), null, false);
......@@ -47,7 +48,7 @@ public class ServiceHPSC010A 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());
inInfo.setCell(EiConstant.queryBlock,ACConstants.ROW_CODE_0,HPSC010A.FIELD_DELETE_FLAG,CommonConstant.YesNo.NO_0);
return super.query(inInfo, HPSC010A.QUERY,new HPSC010A());
}
}
......@@ -5,11 +5,9 @@ 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.HPSC008;
import com.baosight.hpjx.hp.sc.domain.HPSC010;
import com.baosight.hpjx.hp.sc.domain.HPSC096;
import com.baosight.hpjx.hp.sc.domain.HPSC098;
import com.baosight.hpjx.hp.sc.domain.*;
import com.baosight.hpjx.util.CommonMethod;
import com.baosight.hpjx.util.DateUtils;
import com.baosight.hpjx.util.ErrorCodeUtils;
import com.baosight.hpjx.util.StringUtil;
import com.baosight.hpjx.util.contants.ACConstants;
......@@ -33,21 +31,21 @@ public class ServiceHPSC096 extends ServiceEPBase {
@OperationLogAnnotation(operModul = "报工管理",operType = "查询",operDesc = "初始化")
@Override
public EiInfo initLoad(EiInfo inInfo) {
String methodType = inInfo.getString("inqu_status-0-methodType"); //操作类型
List<Map> listFactoryCode;
EiBlock queryBlock = inInfo.getBlock(EiConstant.queryBlock);
String methodType = queryBlock.getCellStr(ACConstants.ROW_CODE_0,"methodType"); //操作类型
if ("update".equals(methodType)) {
String id = inInfo.getString("inqu_status-0-id");
listFactoryCode = this.dao.query(HPSC008.QUERY,new HashMap<String,Object>(){{
put(HPSC008.FIELD_REMARK,id);
initUpdateData(inInfo);
/*String id = queryBlock.getCellStr(ACConstants.ROW_CODE_0,HPSC010.FIELD_ID);
listFactoryCode = this.dao.query(HPSC010A.QUERY,new HashMap<String,Object>(){{
put(HPSC010A.FIELD_PARENT_ID,id);
}},EiConstant.defaultOffset,100);
EiInfo eiInfo = super.query(inInfo,HPSC010.QUERY,new HPSC010());
if (eiInfo.getBlock(EiConstant.resultBlock).getRows().size() >0) {
inInfo.setCell(EiConstant.queryBlock,ACConstants.ROW_CODE_0,HPSC010.FIELD_USER_COUNT,
eiInfo.getCellStr(EiConstant.resultBlock,ACConstants.ROW_CODE_0,HPSC010.FIELD_USER_COUNT));
}
inInfo.addBlock(EiConstant.resultBlock).setRows(listFactoryCode);
//EiInfo eiInfo = super.query(inInfo,HPSC010.QUERY,new HPSC010());
queryBlock.setCell(ACConstants.ROW_CODE_0,HPSC010.FIELD_REGISTER_DATE,queryBlock.getCellStr(ACConstants.ROW_CODE_0,HPSC010.FIELD_REGISTER_DATE));
queryBlock.setCell(ACConstants.ROW_CODE_0,HPSC010.FIELD_USER_COUNT,queryBlock.getCellStr(ACConstants.ROW_CODE_0,HPSC010.FIELD_USER_COUNT));
resultBlock.setRows(listFactoryCode);*/
}else {
List<Map> listResult = new ArrayList<>();
initSave(inInfo);
/*List<Map> listResult = new ArrayList<>();
List<Map> listdetail = new ArrayList<>();
String loginName = UserSession.getLoginName();
Map queryMap = new HashMap();
......@@ -57,35 +55,32 @@ public class ServiceHPSC096 extends ServiceEPBase {
int rowNo = 0;
int detrowNo = 0;
for (int i = 0; i < listFactoryCode.size(); i++) {
Map result = new HashMap();
result.putAll(listFactoryCode.get(i));
result.put(HPSC010A.FIELD_WEIGHT,0);
result.put(HPSC010A.FIELD_WEIGHT_JH,0);
if ("prodGroup".equals(listFactoryCode.get(i).get(HPSC096.FIELD_ORG_TYPE))) {
rowNo++;
Map result = new HashMap();
result.putAll(listFactoryCode.get(i));
result.put(HPSC008.FIELD_WEIGHT,0);
result.put(HPSC008.FIELD_WEIGHT_JH,0);
result.put(HPSC008.FIELD_GROUP_TYPE,1);
result.put(HPSC010A.FIELD_GROUP_TYPE,1);
result.put("rowNo",rowNo);
listResult.add(result);
}else if ("cutGroup".equals(listFactoryCode.get(i).get(HPSC096.FIELD_ORG_TYPE))){
Map detailMap = new HashMap();
detailMap.putAll(listFactoryCode.get(i));
detailMap.put(HPSC008.FIELD_WEIGHT,0);
detailMap.put(HPSC008.FIELD_WEIGHT_JH,0);
detailMap.put("rowNo",detrowNo);
listdetail.add(detailMap);
result.put(HPSC010A.FIELD_GROUP_TYPE,0);
result.put("rowNo",detrowNo);
listdetail.add(result);
detrowNo++;
}
}
inInfo.addBlock(EiConstant.resultBlock).setRows(listResult);
inInfo.addBlock(CommonConstant.Field.DETAIL).setRows(listdetail);
resultBlock.setRows(listResult);
detailBlock.setRows(listdetail);*/
queryBlock.setCell(ACConstants.ROW_CODE_0,HPSC010.FIELD_REGISTER_DATE, DateUtils.date());
queryBlock.setCell(ACConstants.ROW_CODE_0,HPSC010.FIELD_ID, 0);
}
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HPSC096().eiMetadata);
inInfo.addBlock(CommonConstant.Field.DETAIL).addBlockMeta(new HPSC096().eiMetadata);
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0,"methodType",methodType);
queryBlock.setCell(ACConstants.ROW_CODE_0,"methodType",methodType);
CommonMethod.initBlock(inInfo,
Arrays.asList(DdynamicEnum.GROUP_RECORD1_BLOCK_ID,DdynamicEnum.FACTORY_CODE_BLOCK_ID),
new HashMap<String,Object>(){{
put(HPSC008.FIELD_COMPANY_CODE, UserSessionUtils.getCompanyCode());
put(HPSC010A.FIELD_COMPANY_CODE, UserSessionUtils.getCompanyCode());
}}
);
return inInfo;
......@@ -101,13 +96,28 @@ public class ServiceHPSC096 extends ServiceEPBase {
public EiInfo update(EiInfo inInfo) {
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);
// Map queryMap = new HashMap();
//queryMap.put(HPSC010.FIELD_REGISTER_DATE,eiBlock.getCellStr(ACConstants.ROW_CODE_0,HPSC010.FIELD_REGISTER_DATE));
//queryMap.put(HPSC010.FIELD_FACTORY_CODE,eiBlock.getCellStr(ACConstants.ROW_CODE_0,HPSC010.FIELD_FACTORY_CODE));
//queryMap.put(HPSC010.FIELD_ID,eiBlock.getCellStr(ACConstants.ROW_CODE_0,HPSC010A.FIELD_PARENT_ID));
//List<HPSC010> list = this.dao.query(HPSC010.QUERY,queryMap);
List<Map> listResult = eiBlock.getRows();
listResult.addAll(inInfo.getBlock(CommonConstant.Field.DETAIL).getRows());
String registerDate = inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HPSC010.FIELD_REGISTER_DATE);
HPSC010A hpsc010A = new HPSC010A();
for (i = 0; i < listResult.size(); i++) {
Map<?, ?> map = listResult.get(i);
hpsc010A.fromMap(map);
hpsc010A.setRegisterDate(StringUtil.removeHorizontalLine(registerDate));
hpsc010A.setDeleteFlag(CommonConstant.YesNo.NO_0);
if (hpsc010A.getParentId() == null || hpsc010A.getParentId() == 0) {
hpsc010A.setParentId(Long.valueOf(inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HPSC010.FIELD_ID)));
DaoUtils.insert(HPSC010A.INSERT, hpsc010A);
}else {
DaoUtils.update(HPSC010A.UPDATE, hpsc010A);
}
}
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsgByKey("ep.1000", new String[]{String.valueOf(i), I18nMessages.getText("label.update", "修改")});
......@@ -128,23 +138,23 @@ public class ServiceHPSC096 extends ServiceEPBase {
try {
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
Map queryMap = new HashMap();
queryMap.put(HPSC010.FIELD_REGISTER_DATE,eiBlock.getCellStr(ACConstants.ROW_CODE_0,HPSC010.FIELD_REGISTER_DATE));
//queryMap.put(HPSC010.FIELD_REGISTER_DATE,eiBlock.getCellStr(ACConstants.ROW_CODE_0,HPSC010.FIELD_REGISTER_DATE));
queryMap.put(HPSC010.FIELD_FACTORY_CODE,eiBlock.getCellStr(ACConstants.ROW_CODE_0,HPSC010.FIELD_FACTORY_CODE));
List<Map> list = this.dao.query(HPSC010.QUERY_MAX,queryMap);
List<Map> listResult = eiBlock.getRows();
listResult.addAll(inInfo.getBlock(CommonConstant.Field.DETAIL).getRows());
String registerDate = inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HPSC010.FIELD_REGISTER_DATE);
HPSC008 hpxs008 = new HPSC008();
HPSC010A hpsc010A = new HPSC010A();
for (i = 0; i < listResult.size(); i++) {
Map<?, ?> map = listResult.get(i);
hpxs008.fromMap(map);
hpxs008.setRegisterDate(StringUtil.removeHorizontalLine(registerDate));
hpxs008.setDeleteFlag(CommonConstant.YesNo.NO_0);
hpsc010A.fromMap(map);
hpsc010A.setRegisterDate(StringUtil.removeHorizontalLine(registerDate));
hpsc010A.setDeleteFlag(CommonConstant.YesNo.NO_0);
for (Map map1:list) {
hpxs008.setRemark(map1.get(HPSC010.FIELD_ID).toString());
hpsc010A.setParentId((Long) map1.get(HPSC010.FIELD_ID));
}
DaoUtils.insert(HPSC008.INSERT, hpxs008);
DaoUtils.insert(HPSC010A.INSERT, hpsc010A);
}
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsgByKey("ep.1000", new String[]{String.valueOf(i), I18nMessages.getText("label.insert", "新增")});
......@@ -156,4 +166,101 @@ public class ServiceHPSC096 extends ServiceEPBase {
}
return inInfo;
}
public EiInfo initSave(EiInfo inInfo){
EiBlock resultBlock = new EiBlock(EiConstant.resultBlock);
EiBlock detailBlock = new EiBlock(CommonConstant.Field.DETAIL);
List<Map> listResult = new ArrayList<>();
List<Map> listdetail = new ArrayList<>();
Map queryMap = new HashMap();
queryMap.put("loginName", UserSession.getLoginName());
List<Map> listFactoryCode = this.dao.query(HPSC096.QUERY_FACTORY_CODE,queryMap,EiConstant.defaultOffset,100);
int rowNo = 0;
int detrowNo = 0;
for (int i = 0; i < listFactoryCode.size(); i++) {
Map result = new HashMap();
result.putAll(listFactoryCode.get(i));
result.put(HPSC010A.FIELD_WEIGHT,0);
result.put(HPSC010A.FIELD_WEIGHT_JH,0);
if ("prodGroup".equals(listFactoryCode.get(i).get(HPSC096.FIELD_ORG_TYPE))) {
rowNo++;
result.put(HPSC010A.FIELD_GROUP_TYPE,"1");
result.put("rowNo",rowNo);
listResult.add(result);
}else if ("cutGroup".equals(listFactoryCode.get(i).get(HPSC096.FIELD_ORG_TYPE))){
result.put(HPSC010A.FIELD_GROUP_TYPE,"0");
result.put("rowNo",detrowNo);
listdetail.add(result);
detrowNo++;
}
}
resultBlock.setRows(listResult);
detailBlock.setRows(listdetail);
inInfo.setBlock(resultBlock).addBlockMeta(new HPSC010A().eiMetadata);
inInfo.addBlock(detailBlock).addBlockMeta(new HPSC010A().eiMetadata);
return inInfo;
}
public EiInfo initUpdateData(EiInfo inInfo){
EiBlock queryBlock = inInfo.getBlock(EiConstant.queryBlock);
EiBlock resultBlock = new EiBlock(EiConstant.resultBlock);
EiBlock detailBlock = new EiBlock(CommonConstant.Field.DETAIL);
String id = queryBlock.getCellStr(ACConstants.ROW_CODE_0,HPSC010.FIELD_ID);
List<HPSC010A> resultList = this.dao.query(HPSC010A.QUERY,new HashMap<String,Object>(){{
put(HPSC010A.FIELD_PARENT_ID,id);
put(HPSC010A.FIELD_GROUP_TYPE,"1");
}},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");
}},EiConstant.defaultOffset,100);
Map queryMap = new HashMap();
queryMap.put("loginName", UserSession.getLoginName());
List<Map<String,Object>> listFactoryCode = this.dao.query(HPSC096.QUERY_FACTORY_CODE,queryMap,EiConstant.defaultOffset,100);
List<HPSC010A> listResult = new ArrayList<>();
List<HPSC010A> listdetail = new ArrayList<>();
int rowNo = 0;
int detrowNo = 0;
for (int i = 0; i < listFactoryCode.size(); i++) {
HPSC010A result = new HPSC010A();
result.fromMap(listFactoryCode.get(i));
if ("prodGroup".equals(listFactoryCode.get(i).get(HPSC096.FIELD_ORG_TYPE))) {
rowNo++;
for (HPSC010A hpsc010A: resultList) {
String factoryCode = hpsc010A.getFactoryCode();
String groupCode = hpsc010A.getGroupCode();
if (factoryCode.equals(result.getFactoryCode()) && groupCode.equals(result.getGroupCode())) {
result = hpsc010A;
break;
}
}
result.setGroupType("1");
result.setRowNo(rowNo);
listResult.add(result);
}else if ("cutGroup".equals(listFactoryCode.get(i).get(HPSC096.FIELD_ORG_TYPE))){
detrowNo++;
for (HPSC010A hpsc010A: detailList) {
String factoryCode = hpsc010A.getFactoryCode();
String groupCode = hpsc010A.getGroupCode();
if (factoryCode.equals(result.getFactoryCode()) && groupCode.equals(result.getGroupCode())) {
result = hpsc010A;
break;
}
}
result.setGroupType("0");
result.setRowNo(detrowNo);
listdetail.add(result);
}
}
queryBlock.setCell(ACConstants.ROW_CODE_0,HPSC010.FIELD_ID, id);
queryBlock.setCell(ACConstants.ROW_CODE_0,HPSC010.FIELD_REGISTER_DATE,
queryBlock.getCellStr(ACConstants.ROW_CODE_0,HPSC010.FIELD_REGISTER_DATE));
queryBlock.setCell(ACConstants.ROW_CODE_0,HPSC010.FIELD_USER_COUNT,
queryBlock.getCellStr(ACConstants.ROW_CODE_0,HPSC010.FIELD_USER_COUNT));
inInfo.addBlock(resultBlock).setRows(listResult);
inInfo.addBlock(detailBlock).setRows(listdetail);
return inInfo;
}
}
......@@ -304,6 +304,7 @@
STATUS = #status#, <!-- 状态 0-未派工,1-部分派工,2-全部派工 -->
ASSIGNED_NUM = #assignedNum#, <!-- 已派工数量 -->
UNASSIGNED_NUM = #unassignedNum#, <!-- 待派工数量 -->
WORK_DATE = #workDate#, <!-- 派工时间 -->
DOCUMENT_TYPE = 1,
<include refid="updateRevise"/>
WHERE ID = #id#
......
......@@ -540,7 +540,7 @@
<select id="queryMaxDate" parameterClass="java.util.HashMap" resultClass="java.util.HashMap">
SELECT
MAX(REGISTER_DATE) as "registerDate" <!-- 最新登记日期 -->
FROM ${hpjxSchema}.T_HPXS001
FROM ${hpjxSchema}.t_hpsc008
WHERE 1=1 AND DELETE_FLAG = 0
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
......
......@@ -106,7 +106,7 @@
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
ID asc
REGISTER_DATE desc,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-04-10 17:28:06
Version : 1.0
schema : hpjx
tableName : T_HPSC009
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,
PRDT_CODE VARCHAR,
PRDT_NAME VARCHAR,
WEIGHT DECIMAL,
WEIGHT_JH DECIMAL,
PARENT_ID BIGINT,
DELETE_FLAG TINYINT,
CREATED_BY VARCHAR,
CREATED_NAME VARCHAR,
CREATED_TIME VARCHAR,
UPDATED_BY VARCHAR,
UPDATED_TIME VARCHAR,
UPDATED_NAME VARCHAR
-->
<sqlMap namespace="HPSC010A">
<sql id="condition">
<include refid="authCondition"/>
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</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="prdtCode">
PRDT_CODE = #prdtCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="prdtName">
PRDT_NAME = #prdtName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="weight">
WEIGHT = #weight#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="weightJh">
WEIGHT_JH = #weightJh#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="parentId">
PARENT_ID = #parentId#
</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>
<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>
<select id="query" parameterClass="java.util.HashMap"
resultClass="com.baosight.hpjx.hp.sc.domain.HPSC010A">
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", <!-- 生产类型 -->
PRDT_CODE as "prdtCode", <!-- 产品代码 -->
PRDT_NAME as "prdtName", <!-- 产品名称 -->
WEIGHT as "weight", <!-- 产量 -->
WEIGHT_JH as "weightJh",
PARENT_ID as "parentId", <!-- 备注 -->
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_HPSC009 WHERE 1=1
<include refid="condition" />
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
REGISTER_DATE desc,GROUP_CODE asc,CREATED_TIME desc
</isEmpty>
</dynamic>
</select>
<select id="queryResult" parameterClass="java.util.HashMap"
resultClass="com.baosight.hpjx.hp.sc.domain.HPSC010A">
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", <!-- 生产类型 -->
PRDT_CODE as "prdtCode", <!-- 产品代码 -->
PRDT_NAME as "prdtName", <!-- 产品名称 -->
WEIGHT as "weight", <!-- 产量 -->
WEIGHT_JH as "weightJh",
PARENT_ID as "parentId", <!-- 备注 -->
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_HPSC009 WHERE 1=1 and GROUP_TYPE in ('1','2')
<include refid="condition" />
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
REGISTER_DATE desc,GROUP_CODE asc,CREATED_TIME desc
</isEmpty>
</dynamic>
</select>
<select id="queryDetail" parameterClass="java.util.HashMap"
resultClass="com.baosight.hpjx.hp.sc.domain.HPSC010A">
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", <!-- 生产类型 -->
PRDT_CODE as "prdtCode", <!-- 产品代码 -->
PRDT_NAME as "prdtName", <!-- 产品名称 -->
WEIGHT as "weight", <!-- 产量 -->
WEIGHT_JH as "weightJh",
PARENT_ID as "parentId", <!-- 备注 -->
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_HPSC009 WHERE 1=1 and GROUP_TYPE not in ('1','2')
<include refid="condition" />
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
REGISTER_DATE desc,GROUP_CODE asc,CREATED_TIME desc
</isEmpty>
</dynamic>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hpjxSchema}.T_HPSC009 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="prdtCode">
PRDT_CODE = #prdtCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="prdtName">
PRDT_NAME = #prdtName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="weight">
WEIGHT = #weight#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="parentId">
PARENT_ID = #parentId#
</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_HPSC009 (ID, <!-- ID -->
COMPANY_CODE, <!-- 企业编码 预留 -->
DEP_CODE, <!-- 部门编码 预留 -->
REGISTER_DATE, <!-- 登记日期 -->
FACTORY_CODE, <!-- 工厂代码 -->
GROUP_CODE, <!-- 生产组代码 -->
USER_ID, <!-- 员工代码 -->
GROUP_TYPE, <!-- 生产类型 -->
PRDT_CODE, <!-- 产品代码 -->
PRDT_NAME, <!-- 产品名称 -->
WEIGHT, <!-- 产量 -->
WEIGHT_JH,
PARENT_ID, <!-- 备注 -->
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#, #prdtCode#, #prdtName#, #weight#, #weightJh#, #parentId#, #deleteFlag#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedTime#, #updatedName#)
</insert>
<delete id="delete">
DELETE FROM ${hpjxSchema}.T_HPSC009 WHERE ID = #id#
</delete>
<update id="deleteFlag">
UPDATE ${hpjxSchema}.T_HPSC009
SET
DELETE_FLAG = #deleteFlag#, <!-- 是否删除0:否1.是 -->
UPDATED_BY = #updatedBy#, <!-- 修改人 -->
UPDATED_TIME = #updatedTime#, <!-- 修改人名称 -->
UPDATED_NAME = #updatedName# <!-- 修改时间 -->
WHERE
ID = #id#
</update>
<update id="deleteParentId">
UPDATE ${hpjxSchema}.T_HPSC009
SET
DELETE_FLAG = #deleteFlag#, <!-- 是否删除0:否1.是 -->
UPDATED_BY = #updatedBy#, <!-- 修改人 -->
UPDATED_TIME = #updatedTime#, <!-- 修改人名称 -->
UPDATED_NAME = #updatedName# <!-- 修改时间 -->
WHERE PARENT_ID = #parentId#
</update>
<update id="update">
UPDATE ${hpjxSchema}.T_HPSC009
SET
COMPANY_CODE = #companyCode#, <!-- 企业编码 预留 -->
DEP_CODE = #depCode#, <!-- 部门编码 预留 -->
REGISTER_DATE = #registerDate#, <!-- 登记日期 -->
FACTORY_CODE = #factoryCode#, <!-- 工厂代码 -->
GROUP_CODE = #groupCode#, <!-- 生产组代码 -->
USER_ID = #userId#, <!-- 员工代码 -->
GROUP_TYPE = #groupType#, <!-- 生产类型 -->
PRDT_CODE = #prdtCode#, <!-- 产品代码 -->
PRDT_NAME = #prdtName#, <!-- 产品名称 -->
WEIGHT = #weight#, <!-- 产量 -->
WEIGHT_JH = #weightJh#,
PARENT_ID = #parentId#, <!-- 备注 -->
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#
</update>
</sqlMap>
......@@ -61,10 +61,13 @@ public class HPSCTools {
updateMap.put("unassignedNum", jhNum.subtract(totalNum));
// 0.未派工,1.部分派工,2.全部派工
if (jhNum.subtract(totalNum).compareTo(BigDecimal.ZERO)==0) {
updateMap.put("workDate",DateUtils.shortDate());
updateMap.put("status", 2);
} else if (totalNum.compareTo(BigDecimal.ZERO) == 1) {
updateMap.put("workDate",DateUtils.shortDate());
updateMap.put("status", 1);
} else {
updateMap.put("workDate","");
updateMap.put("status", 0);
}
DaoUtils.update(HPSqlConstant.HPSC005.UPDATE_ASSIGN_NUM, updateMap);
......@@ -96,6 +99,7 @@ public class HPSCTools {
updateMap.put("id", dbSc005.getId());
updateMap.put("assignedNum", jhNum);
updateMap.put("unassignedNum", 0);//分派剩余数量变为0
updateMap.put("workDate",DateUtils.shortDate());
// 部分派工变为全部派工
updateMap.put("status", 2);
DaoUtils.update(HPSqlConstant.HPSC005.UPDATE_ASSIGN_NUM, updateMap);
......@@ -112,7 +116,7 @@ public class HPSCTools {
AssertUtils.isNull(dbSc004, String.format("生产订单计划[%s]不存在", prodOrderNo));
BigDecimal completionNum = num.add(dbSc004.getActualCompletionNum());
AssertUtils.isGt(BigDecimal.ZERO, completionNum, "更新后的生产计划完成数量小于0,请检查");
BigDecimal completionUnitWt = completionNum.multiply(dbSc004.getUnitWt());
BigDecimal completionUnitWt = completionNum.multiply(dbSc004.getUnitWt()).divide(new BigDecimal("1000"));
// 计算重量
HPSC004 newSc004 = new HPSC004();
newSc004.setId(dbSc004.getId());
......@@ -433,7 +437,7 @@ public class HPSCTools {
/**
* 查询
*
* @param id
* @param planInfoNo
* @return
*/
public static HPSC003 getEntityByPlanInfoNo(String planInfoNo) {
......@@ -953,7 +957,7 @@ public class HPSCTools {
/**
* 查询
*
* @param prodOrderNo
* @param productionOrderNo
* @return
*/
public static List<HPSC006> get(String productionOrderNo) {
......
......@@ -20,9 +20,9 @@ public class ServiceHPXS002 extends ServiceEPBase {
@Override
public EiInfo initLoad(EiInfo inInfo) {
EiInfo outInfo = super.initLoad(inInfo, new HPXS002());
EiInfo outInfo = super.query(inInfo,HPXS002.QUERY,new HPXS002());
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.PROJ_RECORD_BLOCK_ID), null, false);
outInfo.getBlock(EiConstant.resultBlock).getRows().clear();
//outInfo.getBlock(EiConstant.resultBlock).getRows().clear();
return outInfo;
}
......
......@@ -36,7 +36,7 @@
DIR_ID = #dirId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="docName">
DOC_NAME = #docName#
DOC_NAME LIKE CONCAT('%', #docName#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="chgName">
CHG_NAME = #chgName#
......@@ -121,7 +121,7 @@
A.COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projName">
B.PROJ_CODE LIKE CONCAT('%', #projName#, '%')
B.PROJ_NAME LIKE CONCAT('%', #projName#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="prdtType">
B.PRDT_TYPE = #prdtType#
......@@ -162,16 +162,16 @@
A.COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projName">
B.PROJ_NAME = #projName#
B.PROJ_NAME LIKE CONCAT('%', #projName#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projType">
B.PRDT_TYPE = #projType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="prdtName">
B.PRDT_NAME = #prdtName#
B.PRDT_NAME LIKE CONCAT('%', #prdtName#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="docName">
A.DOC_NAME = #docName#
A.DOC_NAME LIKE CONCAT('%',#docName#,'%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdDateFrom">
A.CREATED_TIME >= #createdDateFrom#
......
......@@ -119,7 +119,7 @@ public class ServiceHPZL001A extends ServiceEPBase {
// 校验质检单是否已处理
HPZL001 dbZl001 = HPZLTools.getById(fZl001A.getCheckId());
AssertUtils.isTrue(CommonConstant.YesNo.YES_1.equals(dbZl001.getStatus()),
String.format("质检单[%s]状态为\"已处理\",不能删除附件"));
String.format("质检单[%s]状态为\"已处理\",不能删除附件",dbZl001.getCheckNo()));
DaoUtils.update(HPZL001A.DELETE, fZl001A);
}
inInfo = this.query(inInfo);
......
......@@ -2451,8 +2451,8 @@ $(function () {
onSuccess: function (ei) {//返回结果集
if (ei.blocks.result !== undefined){
let results = ei.getBlock("result").getMappedRows();
if (results.length>0 && results[0].docIdPc.length>0){
let src = downloadHref(results[0].docIdPc,results[0].projectEnv)
if (results.length>0 && results[0].docIdPc.trim().length>0){
let src = downloadHref(results[0].docIdPc.trim(),results[0].projectEnv)
let img=`<img src="${src}" style='width:200px;height:55px;background-image: none;'/>`;
$("#sidebar .sidebar-content .side-header").html(img);
//$("#sidebar .sidebar-content .side-header").attr("src",downloadHref(results[0].docIdPc,results[0].projectEnv));
......
......@@ -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
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMapConfig PUBLIC "-//iBatis.com//DTD SQL Map Config 2.0//EN" "http://www.iBatis.com/dtd/sql-map-config-2.dtd">
<sqlMapConfig>
<sqlMap resource="com/baosight/hpjx/hp/sb/sql/tHpsb001.xml"/>
<sqlMap resource="com/baosight/hpjx/hp/sb/sql/tHpsb002.xml"/>
</sqlMapConfig>
......@@ -119,49 +119,61 @@ $(function() {
}
}],
loadComplete: function (grid) {
// 此grid对象
grid.dataSource.bind("change", function(e) {
if (e.field == "inventName") {
console.log();
var tr,index;
// 获取此model元素信息
var item = e.items[0];
for (let i = 0; i < inventNameGlobalData.length; i++) {
if (inventNameGlobalData[i]['textField'] === item.inventName) {
//dataItem['spec'] = inventNameGlobalData[i]['param2Field'];
/* dataItem['material'] = inventNameGlobalData[i]['param3Field'];
dataItem['unit'] = inventNameGlobalData[i]['param4Field'];
dataItem['length'] = inventNameGlobalData[i]['param5Field'];
dataItem['width'] = inventNameGlobalData[i]['param6Field'];
dataItem['thick'] = inventNameGlobalData[i]['param7Field'];
dataItem['coefficient'] = inventNameGlobalData[i]['param8Field'];
dataItem['inventRecordId'] = inventNameGlobalData[i]['param9Field'];*/
resultGrid.setCellValue(item, 'inventName', inventNameGlobalData[i]['param1Field']);
resultGrid.setCellValue(item, 'spec', inventNameGlobalData[i]['param2Field']);
resultGrid.setCellValue(item, 'material', inventNameGlobalData[i]['param3Field']);
resultGrid.setCellValue(item, 'unit', inventNameGlobalData[i]['param4Field']);
resultGrid.setCellValue(item, 'length', inventNameGlobalData[i]['param5Field']);
resultGrid.setCellValue(item, 'width', inventNameGlobalData[i]['param6Field']);
resultGrid.setCellValue(item, 'thick', inventNameGlobalData[i]['param7Field']);
resultGrid.setCellValue(item, 'coefficient', inventNameGlobalData[i]['param8Field']);
resultGrid.refresh();
for (let k = 0; k < resultGrid.getCheckedRowsIndex()+1; k++) {
for (let i = 0; i < inventNameGlobalData.length; i++) {
if (inventNameGlobalData[i]['textField'] === item.inventName) {
//dataItem['spec'] = inventNameGlobalData[i]['param2Field'];
/* dataItem['material'] = inventNameGlobalData[i]['param3Field'];
dataItem['unit'] = inventNameGlobalData[i]['param4Field'];
dataItem['length'] = inventNameGlobalData[i]['param5Field'];
dataItem['width'] = inventNameGlobalData[i]['param6Field'];
dataItem['thick'] = inventNameGlobalData[i]['param7Field'];
dataItem['coefficient'] = inventNameGlobalData[i]['param8Field'];
dataItem['inventRecordId'] = inventNameGlobalData[i]['param9Field'];*/
resultGrid.setCellValue(item, 'inventName', inventNameGlobalData[i]['param1Field']);
resultGrid.setCellValue(item, 'spec', inventNameGlobalData[i]['param2Field']);
resultGrid.setCellValue(item, 'material', inventNameGlobalData[i]['param3Field']);
resultGrid.setCellValue(item, 'unit', inventNameGlobalData[i]['param4Field']);
resultGrid.setCellValue(item, 'length', inventNameGlobalData[i]['param5Field']);
resultGrid.setCellValue(item, 'width', inventNameGlobalData[i]['param6Field']);
resultGrid.setCellValue(item, 'thick', inventNameGlobalData[i]['param7Field']);
resultGrid.setCellValue(item, 'coefficient', inventNameGlobalData[i]['param8Field']);
//resultGrid.refresh();
$("#locked_datacell_0_"+k+" input").attr("checked",true);
break;
}
}
}
}
if (e.field == "spec") {
var tr,index;
// 获取此model元素信息
var item = e.items[0];
for (let i = 0; i < inventAllGlobalData.length; i++) {
if (inventAllGlobalData[i]['textField'] === item.spec) {
resultGrid.setCellValue(item, 'material', inventAllGlobalData[i]['param1Field']);
resultGrid.setCellValue(item, 'unit', inventAllGlobalData[i]['param2Field']);
resultGrid.setCellValue(item, 'length', inventAllGlobalData[i]['param3Field']);
resultGrid.setCellValue(item, 'width', inventAllGlobalData[i]['param4Field']);
resultGrid.setCellValue(item, 'thick', inventAllGlobalData[i]['param5Field']);
resultGrid.setCellValue(item, 'coefficient', inventAllGlobalData[i]['param6Field']);
resultGrid.refresh();
}
}
for (let k = 0; k < resultGrid.getCheckedRowsIndex()+1; k++) {
for (let i = 0; i < inventAllGlobalData.length; i++) {
if (inventAllGlobalData[i]['textField'] === item.spec) {
resultGrid.setCellValue(item, 'material', inventAllGlobalData[i]['param1Field']);
resultGrid.setCellValue(item, 'unit', inventAllGlobalData[i]['param2Field']);
resultGrid.setCellValue(item, 'length', inventAllGlobalData[i]['param3Field']);
resultGrid.setCellValue(item, 'width', inventAllGlobalData[i]['param4Field']);
resultGrid.setCellValue(item, 'thick', inventAllGlobalData[i]['param5Field']);
resultGrid.setCellValue(item, 'coefficient', inventAllGlobalData[i]['param6Field']);
$("#locked_datacell_0_"+k+" input").attr("checked",true);
//resultGrid.refresh();
break;
}
}
}
}
});
},
......
......@@ -127,17 +127,21 @@ $(function() {
var tr,index;
// 获取此model元素信息
var item = e.items[0];
for (let i = 0; i < inventNameGlobalData.length; i++) {
if (inventNameGlobalData[i]['textField'] === item.inventName) {
resultGrid.setCellValue(item, 'inventName', inventNameGlobalData[i]['param1Field']);
resultGrid.setCellValue(item, 'spec', inventNameGlobalData[i]['param2Field']);
resultGrid.setCellValue(item, 'material', inventNameGlobalData[i]['param3Field']);
resultGrid.setCellValue(item, 'unit', inventNameGlobalData[i]['param4Field']);
resultGrid.setCellValue(item, 'length', inventNameGlobalData[i]['param5Field']);
resultGrid.setCellValue(item, 'width', inventNameGlobalData[i]['param6Field']);
resultGrid.setCellValue(item, 'thick', inventNameGlobalData[i]['param7Field']);
resultGrid.setCellValue(item, 'coefficient', inventNameGlobalData[i]['param8Field']);
resultGrid.refresh();
for (let k = 0; k < resultGrid.getCheckedRowsIndex()+1; k++) {
for (let i = 0; i < inventNameGlobalData.length; i++) {
if (inventNameGlobalData[i]['textField'] === item.inventName) {
resultGrid.setCellValue(item, 'inventName', inventNameGlobalData[i]['param1Field']);
resultGrid.setCellValue(item, 'spec', inventNameGlobalData[i]['param2Field']);
resultGrid.setCellValue(item, 'material', inventNameGlobalData[i]['param3Field']);
resultGrid.setCellValue(item, 'unit', inventNameGlobalData[i]['param4Field']);
resultGrid.setCellValue(item, 'length', inventNameGlobalData[i]['param5Field']);
resultGrid.setCellValue(item, 'width', inventNameGlobalData[i]['param6Field']);
resultGrid.setCellValue(item, 'thick', inventNameGlobalData[i]['param7Field']);
resultGrid.setCellValue(item, 'coefficient', inventNameGlobalData[i]['param8Field']);
$("#locked_datacell_0_"+k+" input").attr("checked",true);
//resultGrid.refresh();
break;
}
}
}
}
......@@ -145,15 +149,19 @@ $(function() {
var tr,index;
// 获取此model元素信息
var item = e.items[0];
for (let i = 0; i < inventAllGlobalData.length; i++) {
if (inventAllGlobalData[i]['textField'] === item.spec) {
resultGrid.setCellValue(item, 'material', inventAllGlobalData[i]['param1Field']);
resultGrid.setCellValue(item, 'unit', inventAllGlobalData[i]['param2Field']);
resultGrid.setCellValue(item, 'length', inventAllGlobalData[i]['param3Field']);
resultGrid.setCellValue(item, 'width', inventAllGlobalData[i]['param4Field']);
resultGrid.setCellValue(item, 'thick', inventAllGlobalData[i]['param5Field']);
resultGrid.setCellValue(item, 'coefficient', inventAllGlobalData[i]['param6Field']);
resultGrid.refresh();
for (let k = 0; k < resultGrid.getCheckedRowsIndex()+1; k++) {
for (let i = 0; i < inventAllGlobalData.length; i++) {
if (inventAllGlobalData[i]['textField'] === item.spec) {
resultGrid.setCellValue(item, 'material', inventAllGlobalData[i]['param1Field']);
resultGrid.setCellValue(item, 'unit', inventAllGlobalData[i]['param2Field']);
resultGrid.setCellValue(item, 'length', inventAllGlobalData[i]['param3Field']);
resultGrid.setCellValue(item, 'width', inventAllGlobalData[i]['param4Field']);
resultGrid.setCellValue(item, 'thick', inventAllGlobalData[i]['param5Field']);
resultGrid.setCellValue(item, 'coefficient', inventAllGlobalData[i]['param6Field']);
$("#locked_datacell_0_"+k+" input").attr("checked",true);
//resultGrid.refresh();
break;
}
}
}
}
......
$(function () {
IPLATUI.EFGrid.result = {
copyToAdd:false,
pageable: {
pageSize: 20,
pageSize: 10,
pageSizes: [10, 20, 50, 70, 100],
},
columns: [
{
field: "docIdPc",
title: "PC端log",
template: function (item) {
let docId = item.docIdPc;
let template = '';
if (docId!= null && docId.trim().length>0){
let src = downloadHref(docId);
template = '<a style="cursor: pointer;display: inline-flex;justify-content: center;background-color: #e7e7e7" '
+ 'href="' + src + '" target="_blank">' +
'<img src="'+src+'" style="width:200px;height:50px;background-image: none;" alt="PC端log"/></a>';
}
return template;
}
},
{
field: "docIdApp",
title: "APP端log",
template: function (item) {
let docId = item.docIdApp;
let template = '';
if (docId!= null && docId.trim().length>0){
let src = downloadHref(docId);
template = '<a style="cursor: pointer;display: inline-flex;justify-content: center;background-color: #e7e7e7" '
+ 'href="' + src + '" target="_blank">' +
'<img src="'+src+'" style="width:200px;height:50px;background-image: none;" alt="APP端log"/></a>';
}
return template;
}
}
],
onSuccess: function (e) {
if(e.eiInfo.extAttr.methodName == 'save'||e.eiInfo.extAttr.methodName == 'delete' ){
query();
......@@ -14,6 +47,7 @@ $(function () {
$("#type").val("insert")
$("#companyName").val("");
$("#loginPrefix").val("");
$("#loginPrefix").removeAttr("readonly");
$("#validFlag").val(1);
$("#PCfileDocId").val("");
$("#APPfileDocId").val("");
......@@ -28,7 +62,7 @@ $(function () {
onSave: function (e) {
// 阻止后台保存请求,使用自定义保存
e.preventDefault();
//save();
updateCompany();
},
onDelete: function (e) {
// 阻止后台删除请求,使用自定义删除
......@@ -44,21 +78,7 @@ $(function () {
* e.tr tr, jquery
*/
onRowClick: function (e) {
let app = $("#app-img"),
pc = $("#pc-img");
$("#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);
addImgLabel(app,e.model.docIdApp);
addImgLabel(pc,e.model.docIdPc);
$("#insertGroup_wnd_title").text("修改企业管理");
addCompany($("#insertGroup"));
/*WindowUtil({
"title": "",
"content": "<div class='kendo-del-message'>" + e.row + "</div>"
......@@ -86,6 +106,11 @@ $(function () {
localization: {
invalidFileExtension: "文件格式不支持, 上传失败"
},
loadComplete: function(e) {
var uploader = e.sender.uploader;
uploader.clearAllFiles();
// 清空所有历史上传文件
},
success: function(e) {
let docId = e.response.docId;
if (isBlank(docId)) {
......@@ -108,6 +133,11 @@ $(function () {
localization: {
invalidFileExtension: "文件格式不支持, 上传失败"
},
loadComplete: function(e) {
var uploader = e.sender.uploader;
uploader.clearAllFiles();
// 清空所有历史上传文件
},
success: function(e) {
let docId = e.response.docId;
if (isBlank(docId)) {
......@@ -157,6 +187,7 @@ let save = function (){
onSuccess: function (ei) {
btnNode.attr("disabled", false);
$("#insertGroup").data("kendoWindow").close();
// 清除上传队列
resultGrid.dataSource.page(1);
// onFail 表示失败回掉函数
}, onFail: function (ei) {
......@@ -168,52 +199,6 @@ let save = function (){
};
/**
* 保存
*/
/*let save = function () {
let rows = resultGrid.getCheckedRows();
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");
}
resultGrid.dataSource.page(1);
},
onFail: function (ei) {
// 发生异常
NotificationUtil("执行失败,原因[" + ei + "]", "error");
}
}, {
async: false
});
/!*JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HPPZ009", "save", true);
}
});*!/
}*/
/**
* 删除
*/
let deleteFunc = function () {
......@@ -236,11 +221,36 @@ let deleteFunc = function () {
* @param id
*/
function addCompany(id) {
let rows = resultGrid.getCheckedRows();
//打开弹窗
$(".k-upload-status-total").remove();
id.data("kendoWindow").open().center();
}
function updateCompany() {
//获取grid选中数据
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
let app = $("#app-img"),
pc = $("#pc-img");
$("#type").val("update");
$("#companyCode").val(rows[0]["companyCode"]);
$("#companyName").val(rows[0]["companyName"]);
$("#loginPrefix").val(rows[0]["loginPrefix"]);
$("#loginPrefix").attr("readonly","true");
$("#validFlag").val(rows[0]["validFlag"]);
$("#PCfileDocId").val(rows[0]["docIdPc"]);
$("#APPfileDocId").val(rows[0]["docIdApp"]);
$("#remark").val(rows[0]["remark"]);
$("#id").val(rows[0]["id"]);
addImgLabel(app,rows[0]["docIdApp"]);
addImgLabel(pc,rows[0]["docIdPc"]);
$("#insertGroup_wnd_title").text("修改企业管理");
addCompany($("#insertGroup"));
}
$("#update").click(function () {
var btnNode = $(this);
btnNode.attr("disabled", true);
......@@ -261,6 +271,7 @@ $("#update").click(function () {
}
});
});
/**
* 附件上传回调
*
......
......@@ -15,12 +15,14 @@
<EF:EFRegion id="result" title="记录集">
<EF:EFGrid blockId="result" autoDraw="override" checkMode="single">
<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"/>
<EF:EFComboColumn cname="是否启用" ename="validFlag" width="80" align="center" required="true">
<%--<EF:EFColumn ename="docIdPc" cname="主键" hidden="true"/>
<EF:EFColumn ename="docIdApp" cname="主键" hidden="true"/>--%>
<EF:EFColumn cname="企业编码" ename="companyCode" enable="false" width="120" height="50" align="center"/>
<EF:EFColumn cname="企业名称" ename="companyName" width="140" align="center" required="true"/>
<EF:EFColumn cname="登录前缀" ename="loginPrefix" width="80" align="center" readonly="true"/>
<EF:EFColumn cname="PC端log" ename="docIdPc" align="center" width="200" readonly="true" enable="false"/>
<EF:EFColumn cname="APP端log" ename="docIdApp" align="center" width="200" readonly="true" enable="false"/>
<EF:EFComboColumn cname="是否启用" ename="validFlag" width="70" align="center" required="true">
<EF:EFCodeOption codeName="hpjx.hppz.validFlag"/>
</EF:EFComboColumn>
<EF:EFColumn cname="备注" ename="remark" width="150" editType="textarea"/>
......
......@@ -283,6 +283,7 @@ $(function () {
template: "#:textField#",
filter: "contains"
});
input.data("kendoAutoComplete").search();
}
}, {
field: "parentPrdtName",
......
$(function () {
$("#QUERY").on("click", function () {
resultGrid.dataSource.page(1);
});
IPLATUI.EFGrid.result = {
pageable: {
pageSize: 20,
pageSizes: [10, 20, 50, 70, 100],
},
}
});
\ No newline at end of file
<!DOCTYPE html>
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<EF:EFPage title="设备异常日志查询">
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<EF:EFInput cname="操作人" ename="inqu_status-0-createdName" colWidth="3"/>
<EF:EFInput cname="程序号" ename="inqu_status-0-programNo" colWidth="3"/>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row">
<EF:EFColumn ename="id" cname="主键id" hidden="true"/>
<EF:EFColumn ename="createdName" cname="操作人" enable="false" readonly="true" width="150" align="center"/>
<EF:EFColumn ename="errorCode" cname="异常编码" enable="false" readonly="true" width="100" align="center"/>
<EF:EFColumn ename="programNo" cname="程序号" enable="false" readonly="true" width="80" align="center"/>
<EF:EFColumn ename="equipmentType" cname="设备状态" enable="false" readonly="true" width="100" align="center"/>
<EF:EFColumn ename="equipmentCode" cname="设备编码" enable="false" readonly="true" width="100" align="center"/>
<EF:EFColumn ename="dataContent" cname="数据内容" enable="false" readonly="true" width="100" align="center"/>
<EF:EFColumn ename="createdTime" cname="创建时间" enable="false" readonly="true" width="120" align="center"
parseFormats="['yyyyMMddHHmmss']" editType="datetime" dateFormat="yyyy-MM-dd HH:mm:ss"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
<script>
var ctx = "${ctx}";
</script>
<script src="${ctx}/HP/SB/HPSB001.js"></script>
$(function () {
$("#QUERY").on("click", function () {
resultGrid.dataSource.page(1);
});
IPLATUI.EFGrid.result = {
pageable: {
pageSize: 20,
pageSizes: [10, 20, 50, 70, 100],
},
}
});
\ No newline at end of file
<!DOCTYPE html>
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<EF:EFPage title="设备日志查询">
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<EF:EFInput cname="操作人" ename="inqu_status-0-createdName" colWidth="3"/>
<EF:EFInput cname="程序号" ename="inqu_status-0-programNo" colWidth="3"/>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row">
<EF:EFColumn ename="id" cname="主键id" hidden="true"/>
<EF:EFColumn ename="createdName" cname="操作人" enable="false" readonly="true" width="150" align="center"/>
<EF:EFColumn ename="programNo" cname="程序号" enable="false" readonly="true" width="80" align="center"/>
<EF:EFColumn ename="equipmentType" cname="设备状态" enable="false" readonly="true" width="100" align="center"/>
<EF:EFColumn ename="equipmentCode" cname="设备编码" enable="false" readonly="true" width="100" align="center"/>
<EF:EFColumn ename="dataContent" cname="数据内容" enable="false" readonly="true" width="100" align="center"/>
<EF:EFColumn ename="createdTime" cname="创建时间" enable="false" readonly="true" width="120" align="center"
parseFormats="['yyyyMMddHHmmss']" editType="datetime" dateFormat="yyyy-MM-dd HH:mm:ss"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
<script>
var ctx = "${ctx}";
</script>
<script src="${ctx}/HP/SB/HPSB002.js"></script>
$(function () {
var groupCodeBox = __eiInfo.getBlock("groupCodeBox_block_id").getMappedRows();
$(".row").children().attr("class", "col-md-3");
$("#QUERY").on("click", query);
IPLATUI.EFAutoComplete = {
"inqu_status-0-deviceName": {
minLength: 1,
dataSource: {
pageSize: 10,
serverPaging: true,
serverFiltering: true
}
}
};
IPLATUI.EFGrid= {
"result": {
pageable: {
pageSize: 10,
pageSizes: [10, 20, 50, 100],
},
columns: [
{
field: "operator",
title: "操作",
template: function (item) {
let auditStatus = item.deviceStatus;
let template = '';
if (item.factoryCode && item.groupCode) {
if (auditStatus == 0) {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="updateStatus(' + item.id + ',1)" >启用</a>';
} else if (auditStatus == 1) {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' +
'onclick="updateStatus(' + item.id + ',0)" >停止</a>';
}
}
return template;
}
},{
field: "purchaseDate",
attributes: {
class: "i-input-readonly"
},
defaultValue: function () {
return currShortDate();
}
}, {
field: "maintainDate",
attributes: {
class: "i-input-readonly"
},
defaultValue: function () {
return currShortDate();
}
}, {
field: "factoryCode",
title: "工厂",
/*filter: function (options) {
return factoryCode;
},*/
/*template: function (dataItem) {
return dataItem["factoryCode"].split(']')[1];
}*/
},{
field: "groupCode",
title: "设备区域",
filter: function (options) {
var province = options.model['factoryCode'];
if(province) {
// 返回我们过滤后的数据集
return _.filter(groupCodeBox, function (item) {
return item["param1Field"]==province;
})
}
return groupCodeBox;
},
template: function (dataItem) {
for (let i = 0; i < groupCodeBox.length; i++) {
if (groupCodeBox[i]['valueField'] === dataItem['groupCode']) {
return groupCodeBox[i]['textField'].split(']')[1];
}
}
return dataItem["groupCode"]
}
},{
field: "deviceCode",
title: "设备编码",
}
],
loadComplete: function(grid) {
// 此 grid 对象
// 处理父子级联动,通过监听 change 事件,判断父级节点是否发生变化
grid.dataSource.bind("change", function(e) {
// 判断父级节点是否发生变化
if (e.field == "factoryCode") {
loadChange(grid,e,"groupCode");
}else if (e.field == "groupCode") {
if (e.items[0].factoryCode.length===0){
loadChange(grid,e,"factoryCode");
}
loadChange(grid,e,"userId");
}else if (e.field == "deviceCode"){
}
});
},
afterEdit:function (e) {
if (e.field === "groupCode" && e.model["factoryCode"].length === 0){
for (let i = 0; i < groupCodeBox.length; i++) {
if (e.model[e.field] === groupCodeBox[i]["valueField"]){
e.model["factoryCode"]=groupCodeBox[i]["param1Field"]
break;
}
}
}/*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;
}
}
}*/
},
onSave: function (e) {
// 阻止默认请求,使用自定义保存
e.preventDefault();
let btnNode = $(this);
//禁用按钮
btnNode.attr("disabled", true);
save(btnNode);
},
onDelete: function (e) {
// 阻止默认请求,使用自定义删除
//e.preventDefault();
//deleteFunc();
},
onSuccess: function (e) {
if (e.eiInfo.extAttr.methodName == 'save' || e.eiInfo.extAttr.methodName == 'delete') {
query();
}
},
onRowClick: function (e) {
}
}
}
//工厂类型下拉联动
$('input[name="inqu_status-0-factoryCode"]').change(function () {
var inInfo=new EiInfo();
var factoryCode=$("#inqu_status-0-factoryCode").val();
inInfo.set("factoryCode",factoryCode);
inInfo.set("groupType","prodGroup");
EiCommunicator.send("HPSB003", "queryFactoryCode", inInfo, {
onSuccess: function (ei) {
var input=$("#inqu_status-0-groupCode");
let dataEdition=ei.getBlock("groupCodeBox_block_id").getMappedRows();
input.kendoDropDownList({
valuePrimitive: true,
dataTextField: "textField",
dataValueField: "valueField",
optionLabel:"请选择",
dataSource: dataEdition,
template: "#=textField#"
});
}, onFail: function (ei) {
}
}, {async: false});
});
//生产组下拉联动
/*$('input[name="inqu_status-0-groupCode"]').change(function () {
var inInfo=new EiInfo();
var factoryCode=$("#inqu_status-0-factoryCode").val();
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");
let dataEdition=ei.getBlock("user_id_block_id").getMappedRows();
input.kendoDropDownList({
valuePrimitive: true,
dataTextField: "textField",
dataValueField: "valueField",
optionLabel:"请选择",
dataSource: dataEdition,
template: "#=textField#"
});
}, onFail: function (ei) {
}
}, {async: false});
});*/
downKeyUp();
});
let query = function () {
resultGrid.dataSource.page(1);
}
/**
* 保存
*/
let save = function (btnNode) {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
let flag = true;
$.each(rows, function(index, item) {
let factoryCode= item.get("factoryCode");
let groupCode= item.get("groupCode");
let deviceType= item.get("deviceType");
let deviceCode= item.get("deviceCode");
let deviceName= item.get("deviceName");
let deviceModel= item.get("deviceModel");
let purchaseDate= item.get("purchaseDate");
let deviceUserId= item.get("deviceUserId");
if(isBlank(factoryCode)){
message("选中的第"+(index+1)+"行\"工厂\",不能为空!");
flag = false;
return false;
}
if(isBlank(groupCode)){
message("选中的第"+(index+1)+"行\"设备区域\",不能为空!");
flag = false;
return false;
}
if(isBlank(deviceType)){
message("选中的第"+(index+1)+"行\"设备类型\",不能为空!");
flag = false;
return false;
}
if(isBlank(deviceCode)){
message("选中的第"+(index+1)+"行\"设备编码\",不能为空!");
flag = false;
return false;
}
if(isBlank(deviceName)){
message("选中的第"+(index+1)+"行\"设备名称\",不能为空!");
flag = false;
return false;
}
if(isBlank(deviceModel)){
message("选中的第"+(index+1)+"行\"设备型号\",不能为空!");
flag = false;
return false;
}
if(isBlank(purchaseDate)){
message("选中的第"+(index+1)+"行\"购置日期\",不能为空!");
flag = false;
return false;
}
if(isBlank(deviceUserId)){
message("选中的第"+(index+1)+"行\"设备负责人\",不能为空!");
flag = false;
return false;
}
});
if(flag) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HPSB003", "save", true);
btnNode.attr("disabled", false);
}
});
}
}
function updateStatus(id,deviceStatus) {
let inEiInfo = new EiInfo();
inEiInfo.set("result-0-id", id);
inEiInfo.set("result-0-deviceStatus", deviceStatus);
EiCommunicator.send('HPSB003', 'updateDeviceStatus', inEiInfo, {
onSuccess(response) {
NotificationUtil(response.msg);
query();
},
onFail(errorMessage, status, e) {
NotificationUtil("执行失败!", "error");
}
}, {
async: false
}
);
}
function loadChange(grid,e,field) {
var cell_label = field,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");
}
var rowsBlock = function (grid_id,field) {
var resultGrid = window[grid_id + 'Grid'];
var columns = resultGrid.columns;
var dateColumns = _.filter(columns,
function (column) {
return column.editType === "date"
|| column.editType === "datetime";
}
);
var eiblock = new EiBlock(grid_id);
var rowsDate = resultGrid.getDataItems();
if (field!==undefined){
rowsDate = _.filter(resultGrid.getDataItems(), function (item) {
return item["id"]==field;
});
}
for (var int = 0; int < rowsDate.length; int++) {
if (int == 0) {
for (var key in rowsDate[0].toJSON()) {
var eColumn = new EiColumn(key);
eiblock.getBlockMeta().addMeta(eColumn);
}
}
var model = rowsDate[int];
$.each(dateColumns, function (index, dateColumn) {
var field = dateColumn.field, dateFormat = dateColumn.dateFormat;
model[field] = kendo.toString(model[field],
dateFormat
);// 日期转String
});
if (isBlank(model.prdtName)){
continue;
}else {
eiblock.addRow(eiblock.getMappedArray(model, true));
}
}
var showCount = eiblock.get(EiConstant.SHOW_COUNT) || "true";
eiblock.set(EiConstant.SHOW_COUNT, showCount);
eiblock.set(EiConstant.LIMIT, resultGrid.dataSource['_pageSize']);
// eiblock.set(EiConstant.OFFSET, resultGrid.dataSource['_skip']);
// 默认查询第一页
eiblock.set(EiConstant.OFFSET, 0);
return eiblock;
}
\ No newline at end of file
<%--
Created by IntelliJ IDEA.
User: 1
Date: 2024/4/13
Time: 10:29
To change this template use File | Settings | File Templates.
--%>
<%--
Created by IntelliJ IDEA.
User: 1
Date: 2024/4/9
Time: 8:51
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 blockId="inqu_status" row="0" ename="factoryCode" cname="工厂" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="factoryCodeBox_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFSelect blockId="inqu_status" row="0" ename="groupCode" cname="设备区域" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="groupCodeBox_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFSelect blockId="inqu_status" row="0" ename="deviceType" cname="设备类型" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hpjx.hpsb.deviceType"/>
</EF:EFSelect>
<EF:EFDatePicker blockId="inqu_status" row="0" ename="purchaseDate" cname="购置日期" role="date" format="yyyy-MM-dd" parseFormats="['yyyyMMdd']" colWidth="3"/>
<EF:EFInput blockId="inqu_status" row="0" ename="deviceCode" cname="设备编码" colWidth="3"/>
<EF:EFInput blockId="inqu_status" row="0" ename="deviceName" cname="设备名称" colWidth="3"/>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override">
<EF:EFColumn ename="id" primaryKey="true" cname="内码" hidden="true"/>
<EF:EFColumn ename="companyCode" cname="企业编码" hidden="true"/>
<%--blockName="factoryCodeBox_block_id"--%>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="80" align="center"/>
<EF:EFComboColumn ename="factoryCode" cname="工厂"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" readonly="true" width="120" required="true"
align="center" filter="contains" sort="true">
<EF:EFOptions blockId="factoryCodeBox_block_id" textField="textField" valueField="valueField"/>
</EF:EFComboColumn>
<EF:EFComboColumn ename="groupCode" cname="设备区域"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" readonly="true" width="120" required="true"
align="center" filter="contains" sort="true">
<EF:EFOptions blockId="groupCodeBox_block_id" textField="textField" valueField="valueField"/>
</EF:EFComboColumn>
<EF:EFComboColumn ename="deviceType" cname="设备类型"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" width="80" readonly="true" required="true"
align="center" filter="contains" sort="true">
<EF:EFCodeOption codeName="hpjx.hpsb.deviceType" />
</EF:EFComboColumn>
<EF:EFColumn ename="deviceCode" cname="设备编码" width="100" enable="true" readonly="true" align="center" required="true"/>
<EF:EFColumn ename="deviceName" cname="设备名称" width="160" enable="true" readonly="true" align="center" required="true"/>
<EF:EFColumn ename="deviceModel" cname="设备型号" width="120" enable="true" readonly="true" align="center" required="true"/>
<EF:EFColumn ename="purchaseDate" cname="购置日期" width="120" enable="true" readonly="true" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true"/>
<EF:EFColumn ename="maintainDate" cname="保养日期" width="120" align="center" editType="date" hidden="true"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" readonly="false" required="true"/>
<EF:EFComboColumn ename="deviceUserId" cname="设备负责人"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" width="100" readonly="false" required="true"
align="center" filter="contains" sort="true">
<EF:EFOptions blockId="userIdBox_block_id" textField="textField" valueField="valueField"/>
</EF:EFComboColumn>
<EF:EFComboColumn ename="deviceStatus" cname="设备状态" width="80" align="center" readonly="false" required="true" defaultValue="1">
<EF:EFCodeOption codeName="hpjx.hpjx.status"/>
</EF:EFComboColumn>
<%--<EF:EFColumn cname="创建人" ename="createdName" align="center" width="100" 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="120" readonly="true" required="false"
enable="false"/>--%>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
......@@ -80,6 +80,7 @@ $(function () {
template: "#:textField#",
filter: "contains"
});
input.data("kendoAutoComplete").search();
},
/*afterEdit: function (e) {
for (let i = 0; i < princ2Data.length; i++) {
......@@ -255,6 +256,7 @@ $(function () {
template: "#:textField#",
filter: "contains"
});
input.data("kendoAutoComplete").search();
}
}
]
......
......@@ -288,16 +288,20 @@ $(function () {
}
}, {async: false});
input.kendoAutoComplete({
valuePrimitive: true,
dataSource: dataSource,
minLength: 0,
dataTextField: "textField",
dataValueField: "valueField",
required: "true",
optionLabelTemplate: "#:textField#",
valueTemplate: "#:valueField#",
template: "#:textField#",
filter: "contains"
});
input.data("kendoAutoComplete").search();
//input.trigger("change", {sender: input, open: true});
//enforceMinLength: true,
//suggest: false,
//open: true,
}
}, {
field: "parentPrdtName",
......@@ -407,7 +411,12 @@ $(function () {
});
$("#DOWNLOAD").on("click", function (e) {
var href = ctx + "\\HP\\template\\SC\\HPSC002_物料清单.xls";
var href = ctx + "\\HP\\template\\SC\\HPSC002_物料清单-部件.xls";
window.location.href = href;
});
$("#DOWNLOAD2").on("click", function (e) {
var href = ctx + "\\HP\\template\\SC\\HPSC002_物料清单-零件.xls";
window.location.href = href;
});
......
......@@ -198,6 +198,7 @@ $(function () {
template: "#:textField#",
filter: "contains"
});
input.data("kendoAutoComplete").search();
}
},
{
......
......@@ -59,10 +59,11 @@ $(function () {
},
onSave: function (e) {
// 阻止默认请求,使用自定义保存
//e.preventDefault();
e.preventDefault();
//let btnNode = $(this);
//禁用按钮
//btnNode.attr("disabled", true);
updateWindowOpen();
//saveResult(btnNode);
},
onSuccess: function (e) {
......@@ -128,6 +129,7 @@ $(function () {
}
}, {async: false});
});
downKeyUp();
});
function showUploadFile(id) {
......@@ -336,12 +338,12 @@ function loadChange(grid,e,field) {
* @param let
*/
function showGroupDetail(id) {
window.open("HPSC010A?methodName=initLoad&inqu_status-0-remark=" + id)
window.open("HPSC010A?methodName=initLoad&inqu_status-0-parentId=" + id+"&efParentFormEname=HPSC010")
}
function addWindowOpen(id) {
JSColorbox.open({
href: "HPSC096?methodName=initLoad&inqu_status-0-methodType=insert&inqu_status-0-id=" + id,
href: "HPSC096?methodName=initLoad&inqu_status-0-methodType=insert&efParentFormEname=HPSC010&inqu_status-0-id=" + id,
title: "<div style='text-align: center;'>新增</div>",
width: "80%",
height: "90%",
......@@ -349,12 +351,25 @@ function addWindowOpen(id) {
});
}
function updateWindowOpen(id) {
function updateWindowOpen() {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1 || rows.length > 1) {
message("请选择1条数据");
return;
}
$.each(rows, function(index, item) {
let id= item.get("id");
if(isBlank(id)){
message("不能为空,请选择一条数据!");
flag = false;
return false;
}
});
JSColorbox.open({
href: "HPSC096?methodName=initLoad&inqu_status-0-methodType=update&inqu_status-0-id=" + id,
href: "HPSC096?methodName=initLoad&inqu_status-0-methodType=update&efParentFormEname=HPSC010&inqu_status-0-id="+rows[0].id+"&inqu_status-0-userCount="+rows[0].userCount+"&inqu_status-0-registerDate="+rows[0].registerDate,
title: "<div style='text-align: center;'>修改</div>",
width: "60%",
height: "50%",
width: "80%",
height: "90%",
callbackName: windowOpenCallback
});
}
......
......@@ -40,15 +40,15 @@
maxLength="16" readonly="true" width="120" required="true"
align="center" filter="contains" sort="true">
</EF:EFComboColumn>
<EF:EFColumn ename="weight" cname="产量" width="120" enable="false" format="{0:N2}" editType="text"
<EF:EFColumn ename="weight" cname="产量" width="120" enable="false" format="{0:N3}" editType="text"
displayType="0.000" sort="true" align="right"
data-regex="/^-?[0-9]{1,16}([.][0-9]{1,2})?$/" maxLength="20" required="true"
data-errorprompt="请输入数字,该值最大可设置17位整数和2位小数!"
data-regex="/^-?[0-9]{1,16}([.][0-9]{1,3})?$/" maxLength="20" required="true"
data-errorprompt="请输入数字,该值最大可设置17位整数和3位小数!"
/>
<EF:EFColumn ename="userCount" cname="用工人数" width="120" enable="true" format="{0:N0}" editType="text"
displayType="0" sort="true" align="right"
<EF:EFColumn ename="userCount" cname="用工人数" width="120" enable="false" 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位整数!"
data-errorprompt="请输入数字,该值最大可设置17位整数和3位小数!"
/>
</EF:EFGrid>
</EF:EFRegion>
......
......@@ -184,6 +184,7 @@ $(function () {
}
}, {async: false});
});
downKeyUp();
});
function showUploadFile(id) {
......
......@@ -68,15 +68,15 @@
<EF:EFCodeOption codeName="hpjx.hpjx.productionType" />
</EF:EFComboColumn>
<EF:EFColumn ename="prdtName" cname="生产内容" enable="false" width="160" align="center" required="true"/>
<EF:EFColumn ename="weight" cname="组拼产量(T)" width="120" enable="false" format="{0:N2}" editType="text"
<EF:EFColumn ename="weight" cname="组拼产量(T)" width="120" enable="false" format="{0:N3}" editType="text"
displayType="0.000" sort="true" align="right"
data-regex="/^-?[0-9]{1,16}([.][0-9]{1,2})?$/" maxLength="20" required="true"
data-errorprompt="请输入数字,该值最大可设置17位整数和2位小数!"
data-regex="/^-?[0-9]{1,16}([.][0-9]{1,3})?$/" maxLength="20" required="true"
data-errorprompt="请输入数字,该值最大可设置17位整数和3位小数!"
/>
<EF:EFColumn ename="weightJh" cname="加焊产量(T)" width="120" enable="false" format="{0:N2}" editType="text"
<EF:EFColumn ename="weightJh" cname="加焊产量(T)" width="120" enable="false" format="{0:N3}" editType="text"
displayType="0.000" sort="true" align="right"
data-regex="/^-?[0-9]{1,16}([.][0-9]{1,2})?$/" maxLength="20" required="true"
data-errorprompt="请输入数字,该值最大可设置17位整数和2位小数!"
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" align="center"/>--%>
</EF:EFGrid>
......
......@@ -20,10 +20,10 @@ $(function (){
IPLATUI.EFDatePicker = {
"inqu_status-0-registerDate": {
start: "day",
depth: "day",
value:year+"-"+month+"-"+day
depth: "day"
}
}
//value:year+"-"+month+"-"+day
IPLATUI.EFGrid = {
"result": {
......@@ -36,7 +36,7 @@ $(function (){
pageSize: 10,
pageSizes: [10, 20, 30, 50, 100, 200],
},*/
columns: [{
columns: [/*{
field: "operator",
title: "操作",
template: function (item) {
......@@ -45,7 +45,7 @@ $(function (){
+ 'onclick="deleteRow(' + item.rowNo + ')" >删除</a>';
return template
}
}/*,{
}*//*,{
field: "registerDate",
attributes: {
class: "i-input-readonly"
......@@ -63,6 +63,12 @@ $(function (){
}else {
$("#inqu_status-0-userCount").val(0);
}
let methodType = $("#inqu_status-0-methodType").val();
if (methodType == "update"){
$("#inqu_status-0-registerDate").attr("disabled","disabled");
}else {
$("#inqu_status-0-registerDate").removeAttr("disabled");
}
},
onSave: function (e) {
// 阻止默认请求,使用自定义保存
......@@ -84,7 +90,7 @@ $(function (){
toolbarConfig:{
hidden: false,
},
columns: [{
columns: [/*{
field: "operator",
title: "操作",
template: function (item) {
......@@ -93,7 +99,7 @@ $(function (){
+ 'onclick="detailDeleteRow(' + item.rowNo + ')" >删除</a>';
return template
}
}],
}*/],
}
};
......@@ -109,45 +115,37 @@ $(function (){
* 确认
*/
$('#confirm').on('click', function () {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
let resultRows = resultGrid.getDataItems();
let methodType = $("#inqu_status-0-methodType").val();
let registerDate = $("#inqu_status-0-registerDate").val();
if (registerDate.length<=0){
registerDate = currShortDate()
}
let flag = true;
$.each(rows, function(index, item) {
$.each(resultRows, function(index, item) {
let prdtName= item.get("prdtName");
if(isBlank(prdtName)){
message("选中的第"+(index+1)+"行\"产品\",不能为空!");
flag = false;
return false;
}
let weight= item.get("weight");
if(isBlank(weight)){
message("选中的第"+(index+1)+"行\"组拼产量(T)\",不能为空!");
if(weight != 0 && isBlank(prdtName)){
message("选中的生产组第"+(index+1)+"行\"产品\",不能为空!");
flag = false;
return false;
}
let weightJh= item.get("weightJh");
if(isBlank(weightJh)){
message("选中的第"+(index+1)+"行\"加焊产量(T)\",不能为空!");
if(weightJh !=0 && isBlank(prdtName)){
message("选中的生产组第"+(index+1)+"行\"加焊产量(T)\",不能为空!");
flag = false;
return false;
}
});
if(flag) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
JSUtils.confirm("确定对数据做\"保存\"操作? ", {
ok: function () {
var info = new EiInfo();
info.set("inqu_status-0-userCount",$("#inqu_status-0-userCount").val());
info.set("inqu_status-0-registerDate",registerDate);
info.addBlock(JSUtils.checkedRows2Block("result"));
info.addBlock(JSUtils.checkedRows2Block("detail"))
info.set("inqu_status-0-id",$("#inqu_status-0-id").val());
info.addBlock(rowsBlock("result"));
info.addBlock(rowsBlock("detail"))
EiCommunicator.send("HPSC010", methodType, info, {
onSuccess: function (ei) {
if (ei.getStatus() >= 0) {
......@@ -184,6 +182,7 @@ $(function (){
}
});
downKeyUp();
})
/**
......@@ -285,4 +284,44 @@ let detailRefreshRowNo = function (rowNo) {
detailGrid.refresh();
}
}
}
var rowsBlock = function (grid_id) {
var resultGrid = window[grid_id + 'Grid'];
var columns = resultGrid.columns;
var dateColumns = _.filter(columns,
function (column) {
return column.editType === "date"
|| column.editType === "datetime";
}
);
var eiblock = new EiBlock(grid_id);
var rowsDate = resultGrid.getDataItems();
for (var int = 0; int < rowsDate.length; int++) {
if (int == 0) {
for (var key in rowsDate[0].toJSON()) {
var eColumn = new EiColumn(key);
eiblock.getBlockMeta().addMeta(eColumn);
}
}
var model = rowsDate[int];
$.each(dateColumns, function (index, dateColumn) {
var field = dateColumn.field, dateFormat = dateColumn.dateFormat;
model[field] = kendo.toString(model[field],
dateFormat
);// 日期转String
});
if (isBlank(model.prdtName)){
continue;
}else {
eiblock.addRow(eiblock.getMappedArray(model, true));
}
}
var showCount = eiblock.get(EiConstant.SHOW_COUNT) || "true";
eiblock.set(EiConstant.SHOW_COUNT, showCount);
eiblock.set(EiConstant.LIMIT, resultGrid.dataSource['_pageSize']);
// eiblock.set(EiConstant.OFFSET, resultGrid.dataSource['_skip']);
// 默认查询第一页
eiblock.set(EiConstant.OFFSET, 0);
return eiblock;
}
\ No newline at end of file
......@@ -15,9 +15,10 @@
<EF:EFPage title="报工管理">
<EF:EFRegion id="result" title="生产明细信息">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row">
<EF:EFColumn ename="id" cname="ID" hidden="true"/>
<EF:EFColumn ename="rowNo" cname="行号" hidden="true"/>
<EF:EFColumn ename="remark" cname="上级ID" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="120" align="center"/>
<%--<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="120" align="center"/>--%>
<%--<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_code_block_id"
......@@ -50,14 +51,15 @@
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" hidden="true"/>
<%--<EF:EFColumn ename="prdtName" cname="产品" enable="true" width="160" align="center" hidden="true"/>--%>
</EF:EFGrid>
</EF:EFRegion>
<EF:EFRegion id="detail" title="下料明细信息">
<EF:EFGrid blockId="detail" autoDraw="override" toolbarConfig="{hidden:'all'}" isFloat="true" checkMode="row">
<EF:EFColumn ename="id" cname="ID" hidden="true"/>
<EF:EFColumn ename="rowNo" cname="行号" hidden="true"/>
<EF:EFColumn ename="remark" cname="上级ID" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="120" align="center"/>
<%--<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="120" align="center"/>--%>
<%--<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_code_block_id"
......@@ -87,7 +89,7 @@
data-errorprompt="请输入数字,该值最大可设置17位整数和3位小数!"
/>
<EF:EFColumn ename="weightJh" cname="加焊产量(T)" width="120" enable="true" format="{0:N3}" editType="text"
displayType="0.000" sort="true" align="right" hidden="true" defaultValue="0"
displayType="0.000" sort="true" align="right" defaultValue="0" hidden="true"
data-regex="/^-?[0-9]{1,16}([.][0-9]{1,3})?$/" maxLength="20"
data-errorprompt="请输入数字,该值最大可设置17位整数和3位小数!"
/>
......@@ -101,6 +103,7 @@
<EF:EFDatePicker ename="inqu_status-0-registerDate" colWidth="3" cname="登记日期"
required="true" format="yyyy-MM-dd" parseFormats="['yyyyMMdd']"/>
<EF:EFInput cname="" blockId="inqu_status" ename="methodType" row="0" colWidth="3" hidden="true"/>
<EF:EFInput cname="" ename="inqu_status-0-id" colWidth="3" hidden="true"/>
</div>
</EF:EFRegion>
<div class="row">
......
......@@ -208,6 +208,7 @@ function refreshInputSelect(container, inInfo) {
template: "#:textField#",
filter: "contains"
});
input.data("kendoAutoComplete").search();
return dataSource;
}
......
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