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 { ...@@ -351,6 +351,12 @@ public enum DdynamicEnum {
*/ */
GROUP_RECORD1_BLOCK_ID("group_record_block_id","orgId","orgCname","HPSC010.queryGroupComboBox"), 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; ...@@ -24,6 +24,7 @@ import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import com.baosight.iplat4j.ed.util.SequenceGenerator; import com.baosight.iplat4j.ed.util.SequenceGenerator;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.text.DecimalFormat;
import java.util.Arrays; import java.util.Arrays;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
...@@ -107,7 +108,9 @@ public class ServiceHPKC004A extends ServiceEPBase { ...@@ -107,7 +108,9 @@ public class ServiceHPKC004A extends ServiceEPBase {
newKc004.setSaleNo(SequenceGenerator.getNextSequence(HPConstant.SequenceId.HPKC004_SALE_NO)); newKc004.setSaleNo(SequenceGenerator.getNextSequence(HPConstant.SequenceId.HPKC004_SALE_NO));
newKc004.setReceiptDate(DateUtils.shortDate()); newKc004.setReceiptDate(DateUtils.shortDate());
newKc004.setAmount(applyAmount); 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.setRemark(applyRemark);
newKc004.setKcId(kcId); newKc004.setKcId(kcId);
newKc004.setIsPrint(CommonConstant.YesNo.NO_0); newKc004.setIsPrint(CommonConstant.YesNo.NO_0);
......
...@@ -113,7 +113,7 @@ ...@@ -113,7 +113,7 @@
SELECT <include refid="column"/> SELECT <include refid="column"/>
FROM hpjx.T_HPKC011 a FROM hpjx.T_HPKC011 a
JOIN hpjx.T_HPSC001 b on a.PROJ_CODE = b.PROJ_CODE 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="condition"/>
<include refid="customCondition"/> <include refid="customCondition"/>
<dynamic prepend="ORDER BY"> <dynamic prepend="ORDER BY">
...@@ -147,7 +147,7 @@ ...@@ -147,7 +147,7 @@
SELECT <include refid="column"/> SELECT <include refid="column"/>
FROM hpjx.T_HPKC011 a FROM hpjx.T_HPKC011 a
JOIN hpjx.T_HPSC001 b on a.PROJ_CODE = b.PROJ_CODE 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="condition"/>
<include refid="customCondition"/> <include refid="customCondition"/>
</select> </select>
...@@ -156,7 +156,7 @@ ...@@ -156,7 +156,7 @@
SELECT COUNT(*) SELECT COUNT(*)
FROM hpjx.T_HPKC011 a FROM hpjx.T_HPKC011 a
JOIN hpjx.T_HPSC001 b on a.PROJ_CODE = b.PROJ_CODE 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="condition"/>
<include refid="customCondition"/> <include refid="customCondition"/>
</select> </select>
......
...@@ -93,7 +93,10 @@ public class ServiceHPMT001 extends ServiceBase { ...@@ -93,7 +93,10 @@ public class ServiceHPMT001 extends ServiceBase {
resultMap.put("target_s_qoq", 0);//目标环比 resultMap.put("target_s_qoq", 0);//目标环比
} else { } else {
resultMap.put("targetWt_s", row3.get(0).get("targetWt")); resultMap.put("targetWt_s", row3.get(0).get("targetWt"));
BigDecimal targetWt = (BigDecimal) row1.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"); BigDecimal targetWt2 = (BigDecimal) row3.get(0).get("targetWt");
resultMap.put("target_s_qoq", targetWt.subtract(targetWt2).divide(targetWt2,BigDecimal.ROUND_UP). resultMap.put("target_s_qoq", targetWt.subtract(targetWt2).divide(targetWt2,BigDecimal.ROUND_UP).
multiply(new BigDecimal(100)).doubleValue()); multiply(new BigDecimal(100)).doubleValue());
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<select id="pmOverview1" resultClass="java.util.HashMap"> <select id="pmOverview1" resultClass="java.util.HashMap">
SELECT 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 FROM
hpjx.t_hpsc004 hpjx.t_hpsc004
WHERE WHERE
......
/**
* 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
...@@ -245,7 +245,7 @@ public class ServiceHPSC003 extends ServiceBase { ...@@ -245,7 +245,7 @@ public class ServiceHPSC003 extends ServiceBase {
newSc005.setPartThick(dbSc004.getThick()); newSc005.setPartThick(dbSc004.getThick());
newSc005.setPartSpec(dbSc004.getSpec()); newSc005.setPartSpec(dbSc004.getSpec());
newSc005.setRemark1(dbSc004.getRemark()); newSc005.setRemark1(dbSc004.getRemark());
newSc005.setWorkDate(DateUtils.shortDate()); //newSc005.setWorkDate(DateUtils.shortDate());
newSc005.setPlanCompletionDate(dbSc004.getPlanCompletionDate()); newSc005.setPlanCompletionDate(dbSc004.getPlanCompletionDate());
newSc005.setNum(dbSc004.getNum()); newSc005.setNum(dbSc004.getNum());
newSc005.setUnassignedNum(dbSc004.getNum()); newSc005.setUnassignedNum(dbSc004.getNum());
......
package com.baosight.hpjx.hp.sc.service; package com.baosight.hpjx.hp.sc.service;
import com.baosight.hpjx.aspect.annotation.OperationLogAnnotation;
import com.baosight.hpjx.common.DdynamicEnum; import com.baosight.hpjx.common.DdynamicEnum;
import com.baosight.hpjx.core.constant.CommonConstant; import com.baosight.hpjx.core.constant.CommonConstant;
import com.baosight.hpjx.core.dao.DaoUtils; 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.HPSC010;
import com.baosight.hpjx.hp.sc.domain.HPSC010A;
import com.baosight.hpjx.util.CommonMethod; import com.baosight.hpjx.util.CommonMethod;
import com.baosight.hpjx.util.ErrorCodeUtils; import com.baosight.hpjx.util.ErrorCodeUtils;
import com.baosight.hpjx.util.LogUtils;
import com.baosight.hpjx.util.StringUtil; import com.baosight.hpjx.util.StringUtil;
import com.baosight.hpjx.util.StringUtils;
import com.baosight.hpjx.util.contants.ACConstants; import com.baosight.hpjx.util.contants.ACConstants;
import com.baosight.iplat4j.core.ei.EiBlock; import com.baosight.iplat4j.core.ei.EiBlock;
import com.baosight.iplat4j.core.ei.EiConstant; import com.baosight.iplat4j.core.ei.EiConstant;
...@@ -32,7 +32,7 @@ public class ServiceHPSC010 extends ServiceEPBase { ...@@ -32,7 +32,7 @@ public class ServiceHPSC010 extends ServiceEPBase {
@Override @Override
public EiInfo initLoad(EiInfo inInfo) { 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); final EiInfo outEiInfo = super.query(inInfo, HPSC010.QUERY, new HPSC010().eiMetadata);
CommonMethod.initBlock(outEiInfo, CommonMethod.initBlock(outEiInfo,
Arrays.asList(DdynamicEnum.FACTORY_CODE_BLOCK_ID), new HashMap<String,Object>()); Arrays.asList(DdynamicEnum.FACTORY_CODE_BLOCK_ID), new HashMap<String,Object>());
...@@ -50,7 +50,7 @@ public class ServiceHPSC010 extends ServiceEPBase { ...@@ -50,7 +50,7 @@ public class ServiceHPSC010 extends ServiceEPBase {
if (!startDate.isEmpty()) { if (!startDate.isEmpty()) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0,"createdDateFrom",StringUtil.removeHorizontalLine(startDate)); 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()); return super.query(inInfo,HPSC010.QUERY,new HPSC010());
} }
...@@ -64,7 +64,7 @@ public class ServiceHPSC010 extends ServiceEPBase { ...@@ -64,7 +64,7 @@ public class ServiceHPSC010 extends ServiceEPBase {
Map<?, ?> map = eiBlock.getRow(i); Map<?, ?> map = eiBlock.getRow(i);
hpxs010.fromMap(map); hpxs010.fromMap(map);
hpxs010.setDeleteFlag(CommonConstant.YesNo.YES_1); hpxs010.setDeleteFlag(CommonConstant.YesNo.YES_1);
delRows(hpxs010.getId().toString()); delRows(hpxs010.getId());
DaoUtils.update(HPSC010.DELETE_FLAG, hpxs010.toMap()); DaoUtils.update(HPSC010.DELETE_FLAG, hpxs010.toMap());
} }
inInfo.setStatus(EiConstant.STATUS_SUCCESS); inInfo.setStatus(EiConstant.STATUS_SUCCESS);
...@@ -79,18 +79,32 @@ public class ServiceHPSC010 extends ServiceEPBase { ...@@ -79,18 +79,32 @@ public class ServiceHPSC010 extends ServiceEPBase {
return inInfo; return inInfo;
} }
@OperationLogAnnotation(operModul = "报工管理",operType = "修改",operDesc = "修改操作")
@Override @Override
public EiInfo update(EiInfo inInfo) { public EiInfo update(EiInfo inInfo) {
int i = 0; int i = 0;
try { try {
HPSC010 hpxs010 = new HPSC010(); HPSC010 hpsc010 = new HPSC010();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock); EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
for (i = 0; i < eiBlock.getRowCount(); i++) { List<Map> list = eiBlock.getRows();
Map<?, ?> map = eiBlock.getRow(i); list.addAll(inInfo.getBlock(CommonConstant.Field.DETAIL).getRows());
hpxs010.fromMap(map); double weight = 0;
hpxs010.setDeleteFlag(CommonConstant.YesNo.NO_0); //BigDecimal weight = new BigDecimal("0");
DaoUtils.update(HPSC010.UPDATE, hpxs010); 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.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsgByKey("ep.1000", new String[]{String.valueOf(i), I18nMessages.getText("label.update", "修改")}); inInfo.setMsgByKey("ep.1000", new String[]{String.valueOf(i), I18nMessages.getText("label.update", "修改")});
} catch (PlatException e) { } catch (PlatException e) {
...@@ -103,6 +117,7 @@ public class ServiceHPSC010 extends ServiceEPBase { ...@@ -103,6 +117,7 @@ public class ServiceHPSC010 extends ServiceEPBase {
return inInfo; return inInfo;
} }
@OperationLogAnnotation(operModul = "报工管理",operType = "新增",operDesc = "新增操作")
@Override @Override
public EiInfo insert(EiInfo inInfo) { public EiInfo insert(EiInfo inInfo) {
int i = 0; int i = 0;
...@@ -112,17 +127,20 @@ public class ServiceHPSC010 extends ServiceEPBase { ...@@ -112,17 +127,20 @@ public class ServiceHPSC010 extends ServiceEPBase {
List<Map> list = eiBlock.getRows(); List<Map> list = eiBlock.getRows();
list.addAll(inInfo.getBlock(CommonConstant.Field.DETAIL).getRows()); list.addAll(inInfo.getBlock(CommonConstant.Field.DETAIL).getRows());
double weight = 0; 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++) { for (i = 0; i < list.size(); i++) {
Map<?, ?> map = list.get(i); Map<?, ?> map = list.get(i);
HPSC008 hpsc008 = new HPSC008(); HPSC010A hpsc010A = new HPSC010A();
hpsc008.fromMap(map); hpsc010A.fromMap(map);
weight = weight+hpsc008.getWeight().doubleValue()+hpsc008.getWeightJh().doubleValue(); 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.fromMap(eiBlock.getRow(0));
hpxs010.setDeleteFlag(CommonConstant.YesNo.NO_0); hpxs010.setDeleteFlag(CommonConstant.YesNo.NO_0);
hpxs010.setWeight(BigDecimal.valueOf(weight)); hpxs010.setWeight(BigDecimal.valueOf(weight/2));
hpxs010.setRegisterDate(StringUtil.removeHorizontalLine(registerDate)); hpxs010.setRegisterDate(StringUtil.removeHorizontalLine(registerDate));
hpxs010.setUserCount(Long.valueOf(inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HPSC010.FIELD_USER_COUNT))); hpxs010.setUserCount(Long.valueOf(inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HPSC010.FIELD_USER_COUNT)));
DaoUtils.insert(HPSC010.INSERT, hpxs010); DaoUtils.insert(HPSC010.INSERT, hpxs010);
...@@ -131,17 +149,24 @@ public class ServiceHPSC010 extends ServiceEPBase { ...@@ -131,17 +149,24 @@ public class ServiceHPSC010 extends ServiceEPBase {
} catch (PlatException e) { } catch (PlatException e) {
e.printStackTrace(); e.printStackTrace();
inInfo.setStatus(EiConstant.STATUS_FAILURE); inInfo.setStatus(EiConstant.STATUS_FAILURE);
ErrorCodeUtils.handleInsertException(inInfo,i,e); LogUtils.setDetailMsg(inInfo, e, "保存失败");
logError("新增失败", e.getMessage());
return inInfo; return inInfo;
} }
return inInfo; return inInfo;
} }
public void delRows(String id){ public void delRows(Long id){
HPSC008 hpxs001 = new HPSC008(); HPSC010A hpsc010A = new HPSC010A();
hpxs001.setRemark(id); hpsc010A.setParentId(id);
hpxs001.setDeleteFlag(CommonConstant.YesNo.YES_1); hpsc010A.setDeleteFlag(CommonConstant.YesNo.YES_1);
DaoUtils.update(HPSC008.DELETE_REMARK, hpxs001); 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; ...@@ -4,6 +4,7 @@ import com.baosight.hpjx.common.DdynamicEnum;
import com.baosight.hpjx.core.constant.CommonConstant; import com.baosight.hpjx.core.constant.CommonConstant;
import com.baosight.hpjx.core.security.UserSessionUtils; import com.baosight.hpjx.core.security.UserSessionUtils;
import com.baosight.hpjx.hp.sc.domain.HPSC008; 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.CommonMethod;
import com.baosight.hpjx.util.StringUtil; import com.baosight.hpjx.util.StringUtil;
import com.baosight.hpjx.util.contants.ACConstants; import com.baosight.hpjx.util.contants.ACConstants;
...@@ -24,10 +25,10 @@ public class ServiceHPSC010A extends ServiceEPBase { ...@@ -24,10 +25,10 @@ public class ServiceHPSC010A extends ServiceEPBase {
@Override @Override
public EiInfo initLoad(EiInfo inInfo) { public EiInfo initLoad(EiInfo inInfo) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HPSC008.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0); 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()); final EiInfo outEiInfo = super.query(inInfo, HPSC010A.QUERY_RESULT, new HPSC010A());
EiInfo detailEiInfo = super.query(inInfo, HPSC008.QUERY_DETAIL, new HPSC008()); EiInfo detailEiInfo = super.query(inInfo, HPSC010A.QUERY_DETAIL, new HPSC010A());
EiBlock detailBlock = new EiBlock(CommonConstant.Field.DETAIL); EiBlock detailBlock = new EiBlock(CommonConstant.Field.DETAIL);
detailBlock.setBlockMeta(new HPSC008().eiMetadata); detailBlock.setBlockMeta(new HPSC010A().eiMetadata);
detailBlock.setRows(detailEiInfo.getBlock(EiConstant.resultBlock).getRows()); detailBlock.setRows(detailEiInfo.getBlock(EiConstant.resultBlock).getRows());
outEiInfo.setBlock(detailBlock); outEiInfo.setBlock(detailBlock);
CommonMethod.initBlock(outEiInfo, Arrays.asList(DdynamicEnum.FACTORY_RECORD_BLOCK_ID), null, false); CommonMethod.initBlock(outEiInfo, Arrays.asList(DdynamicEnum.FACTORY_RECORD_BLOCK_ID), null, false);
...@@ -47,7 +48,7 @@ public class ServiceHPSC010A extends ServiceEPBase { ...@@ -47,7 +48,7 @@ public class ServiceHPSC010A extends ServiceEPBase {
if (!startDate.isEmpty()) { if (!startDate.isEmpty()) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0,"createdDateFrom",StringUtil.removeHorizontalLine(startDate)); 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,HPSC010A.FIELD_DELETE_FLAG,CommonConstant.YesNo.NO_0);
return super.query(inInfo, HPSC008.QUERY,new HPSC008()); return super.query(inInfo, HPSC010A.QUERY,new HPSC010A());
} }
} }
...@@ -304,6 +304,7 @@ ...@@ -304,6 +304,7 @@
STATUS = #status#, <!-- 状态 0-未派工,1-部分派工,2-全部派工 --> STATUS = #status#, <!-- 状态 0-未派工,1-部分派工,2-全部派工 -->
ASSIGNED_NUM = #assignedNum#, <!-- 已派工数量 --> ASSIGNED_NUM = #assignedNum#, <!-- 已派工数量 -->
UNASSIGNED_NUM = #unassignedNum#, <!-- 待派工数量 --> UNASSIGNED_NUM = #unassignedNum#, <!-- 待派工数量 -->
WORK_DATE = #workDate#, <!-- 派工时间 -->
DOCUMENT_TYPE = 1, DOCUMENT_TYPE = 1,
<include refid="updateRevise"/> <include refid="updateRevise"/>
WHERE ID = #id# WHERE ID = #id#
......
...@@ -540,7 +540,7 @@ ...@@ -540,7 +540,7 @@
<select id="queryMaxDate" parameterClass="java.util.HashMap" resultClass="java.util.HashMap"> <select id="queryMaxDate" parameterClass="java.util.HashMap" resultClass="java.util.HashMap">
SELECT SELECT
MAX(REGISTER_DATE) as "registerDate" <!-- 最新登记日期 --> MAX(REGISTER_DATE) as "registerDate" <!-- 最新登记日期 -->
FROM ${hpjxSchema}.T_HPXS001 FROM ${hpjxSchema}.t_hpsc008
WHERE 1=1 AND DELETE_FLAG = 0 WHERE 1=1 AND DELETE_FLAG = 0
<isNotEmpty prepend=" AND " property="companyCode"> <isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode# COMPANY_CODE = #companyCode#
......
...@@ -106,7 +106,7 @@ ...@@ -106,7 +106,7 @@
$orderBy$ $orderBy$
</isNotEmpty> </isNotEmpty>
<isEmpty property="orderBy"> <isEmpty property="orderBy">
ID asc REGISTER_DATE desc,CREATED_TIME desc
</isEmpty> </isEmpty>
</dynamic> </dynamic>
......
...@@ -61,10 +61,13 @@ public class HPSCTools { ...@@ -61,10 +61,13 @@ public class HPSCTools {
updateMap.put("unassignedNum", jhNum.subtract(totalNum)); updateMap.put("unassignedNum", jhNum.subtract(totalNum));
// 0.未派工,1.部分派工,2.全部派工 // 0.未派工,1.部分派工,2.全部派工
if (jhNum.subtract(totalNum).compareTo(BigDecimal.ZERO)==0) { if (jhNum.subtract(totalNum).compareTo(BigDecimal.ZERO)==0) {
updateMap.put("workDate",DateUtils.shortDate());
updateMap.put("status", 2); updateMap.put("status", 2);
} else if (totalNum.compareTo(BigDecimal.ZERO) == 1) { } else if (totalNum.compareTo(BigDecimal.ZERO) == 1) {
updateMap.put("workDate",DateUtils.shortDate());
updateMap.put("status", 1); updateMap.put("status", 1);
} else { } else {
updateMap.put("workDate","");
updateMap.put("status", 0); updateMap.put("status", 0);
} }
DaoUtils.update(HPSqlConstant.HPSC005.UPDATE_ASSIGN_NUM, updateMap); DaoUtils.update(HPSqlConstant.HPSC005.UPDATE_ASSIGN_NUM, updateMap);
...@@ -96,6 +99,7 @@ public class HPSCTools { ...@@ -96,6 +99,7 @@ public class HPSCTools {
updateMap.put("id", dbSc005.getId()); updateMap.put("id", dbSc005.getId());
updateMap.put("assignedNum", jhNum); updateMap.put("assignedNum", jhNum);
updateMap.put("unassignedNum", 0);//分派剩余数量变为0 updateMap.put("unassignedNum", 0);//分派剩余数量变为0
updateMap.put("workDate",DateUtils.shortDate());
// 部分派工变为全部派工 // 部分派工变为全部派工
updateMap.put("status", 2); updateMap.put("status", 2);
DaoUtils.update(HPSqlConstant.HPSC005.UPDATE_ASSIGN_NUM, updateMap); DaoUtils.update(HPSqlConstant.HPSC005.UPDATE_ASSIGN_NUM, updateMap);
...@@ -112,7 +116,7 @@ public class HPSCTools { ...@@ -112,7 +116,7 @@ public class HPSCTools {
AssertUtils.isNull(dbSc004, String.format("生产订单计划[%s]不存在", prodOrderNo)); AssertUtils.isNull(dbSc004, String.format("生产订单计划[%s]不存在", prodOrderNo));
BigDecimal completionNum = num.add(dbSc004.getActualCompletionNum()); BigDecimal completionNum = num.add(dbSc004.getActualCompletionNum());
AssertUtils.isGt(BigDecimal.ZERO, completionNum, "更新后的生产计划完成数量小于0,请检查"); 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(); HPSC004 newSc004 = new HPSC004();
newSc004.setId(dbSc004.getId()); newSc004.setId(dbSc004.getId());
...@@ -433,7 +437,7 @@ public class HPSCTools { ...@@ -433,7 +437,7 @@ public class HPSCTools {
/** /**
* 查询 * 查询
* *
* @param id * @param planInfoNo
* @return * @return
*/ */
public static HPSC003 getEntityByPlanInfoNo(String planInfoNo) { public static HPSC003 getEntityByPlanInfoNo(String planInfoNo) {
...@@ -953,7 +957,7 @@ public class HPSCTools { ...@@ -953,7 +957,7 @@ public class HPSCTools {
/** /**
* 查询 * 查询
* *
* @param prodOrderNo * @param productionOrderNo
* @return * @return
*/ */
public static List<HPSC006> get(String productionOrderNo) { public static List<HPSC006> get(String productionOrderNo) {
......
...@@ -20,9 +20,9 @@ public class ServiceHPXS002 extends ServiceEPBase { ...@@ -20,9 +20,9 @@ public class ServiceHPXS002 extends ServiceEPBase {
@Override @Override
public EiInfo initLoad(EiInfo inInfo) { 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); 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; return outInfo;
} }
......
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
DIR_ID = #dirId# DIR_ID = #dirId#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="docName"> <isNotEmpty prepend=" AND " property="docName">
DOC_NAME = #docName# DOC_NAME LIKE CONCAT('%', #docName#, '%')
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="chgName"> <isNotEmpty prepend=" AND " property="chgName">
CHG_NAME = #chgName# CHG_NAME = #chgName#
...@@ -121,7 +121,7 @@ ...@@ -121,7 +121,7 @@
A.COMPANY_CODE = #companyCode# A.COMPANY_CODE = #companyCode#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="projName"> <isNotEmpty prepend=" AND " property="projName">
B.PROJ_CODE LIKE CONCAT('%', #projName#, '%') B.PROJ_NAME LIKE CONCAT('%', #projName#, '%')
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="prdtType"> <isNotEmpty prepend=" AND " property="prdtType">
B.PRDT_TYPE = #prdtType# B.PRDT_TYPE = #prdtType#
...@@ -162,16 +162,16 @@ ...@@ -162,16 +162,16 @@
A.COMPANY_CODE = #companyCode# A.COMPANY_CODE = #companyCode#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="projName"> <isNotEmpty prepend=" AND " property="projName">
B.PROJ_NAME = #projName# B.PROJ_NAME LIKE CONCAT('%', #projName#, '%')
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="projType"> <isNotEmpty prepend=" AND " property="projType">
B.PRDT_TYPE = #projType# B.PRDT_TYPE = #projType#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="prdtName"> <isNotEmpty prepend=" AND " property="prdtName">
B.PRDT_NAME = #prdtName# B.PRDT_NAME LIKE CONCAT('%', #prdtName#, '%')
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="docName"> <isNotEmpty prepend=" AND " property="docName">
A.DOC_NAME = #docName# A.DOC_NAME LIKE CONCAT('%',#docName#,'%')
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="createdDateFrom"> <isNotEmpty prepend=" AND " property="createdDateFrom">
A.CREATED_TIME >= #createdDateFrom# A.CREATED_TIME >= #createdDateFrom#
......
...@@ -119,7 +119,7 @@ public class ServiceHPZL001A extends ServiceEPBase { ...@@ -119,7 +119,7 @@ public class ServiceHPZL001A extends ServiceEPBase {
// 校验质检单是否已处理 // 校验质检单是否已处理
HPZL001 dbZl001 = HPZLTools.getById(fZl001A.getCheckId()); HPZL001 dbZl001 = HPZLTools.getById(fZl001A.getCheckId());
AssertUtils.isTrue(CommonConstant.YesNo.YES_1.equals(dbZl001.getStatus()), AssertUtils.isTrue(CommonConstant.YesNo.YES_1.equals(dbZl001.getStatus()),
String.format("质检单[%s]状态为\"已处理\",不能删除附件")); String.format("质检单[%s]状态为\"已处理\",不能删除附件",dbZl001.getCheckNo()));
DaoUtils.update(HPZL001A.DELETE, fZl001A); DaoUtils.update(HPZL001A.DELETE, fZl001A);
} }
inInfo = this.query(inInfo); inInfo = this.query(inInfo);
......
...@@ -2451,8 +2451,8 @@ $(function () { ...@@ -2451,8 +2451,8 @@ $(function () {
onSuccess: function (ei) {//返回结果集 onSuccess: function (ei) {//返回结果集
if (ei.blocks.result !== undefined){ if (ei.blocks.result !== undefined){
let results = ei.getBlock("result").getMappedRows(); let results = ei.getBlock("result").getMappedRows();
if (results.length>0 && results[0].docIdPc.length>0){ if (results.length>0 && results[0].docIdPc.trim().length>0){
let src = downloadHref(results[0].docIdPc,results[0].projectEnv) let src = downloadHref(results[0].docIdPc.trim(),results[0].projectEnv)
let img=`<img src="${src}" style='width:200px;height:55px;background-image: none;'/>`; 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").html(img);
//$("#sidebar .sidebar-content .side-header").attr("src",downloadHref(results[0].docIdPc,results[0].projectEnv)); //$("#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 ...@@ -19,7 +19,7 @@ spring.servlet.multipart.file-size-threshold =0
componentEname=hpjx componentEname=hpjx
projectName=hpjx projectName=hpjx
moduleName=ep moduleName=ep
projectEnv=dev projectEnv=run
platSchema=iplat platSchema=iplat
eplatSchema=EPLAT eplatSchema=EPLAT
lowcodedbSchema=lowcodedb 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,16 +119,19 @@ $(function() { ...@@ -119,16 +119,19 @@ $(function() {
} }
}], }],
loadComplete: function (grid) { loadComplete: function (grid) {
// 此grid对象 // 此grid对象
grid.dataSource.bind("change", function(e) { grid.dataSource.bind("change", function(e) {
if (e.field == "inventName") { if (e.field == "inventName") {
console.log();
var tr,index; var tr,index;
// 获取此model元素信息 // 获取此model元素信息
var item = e.items[0]; var item = e.items[0];
for (let k = 0; k < resultGrid.getCheckedRowsIndex()+1; k++) {
for (let i = 0; i < inventNameGlobalData.length; i++) { for (let i = 0; i < inventNameGlobalData.length; i++) {
if (inventNameGlobalData[i]['textField'] === item.inventName) { if (inventNameGlobalData[i]['textField'] === item.inventName) {
//dataItem['spec'] = inventNameGlobalData[i]['param2Field']; //dataItem['spec'] = inventNameGlobalData[i]['param2Field'];
/* dataItem['material'] = inventNameGlobalData[i]['param3Field']; /* dataItem['material'] = inventNameGlobalData[i]['param3Field'];
dataItem['unit'] = inventNameGlobalData[i]['param4Field']; dataItem['unit'] = inventNameGlobalData[i]['param4Field'];
dataItem['length'] = inventNameGlobalData[i]['param5Field']; dataItem['length'] = inventNameGlobalData[i]['param5Field'];
dataItem['width'] = inventNameGlobalData[i]['param6Field']; dataItem['width'] = inventNameGlobalData[i]['param6Field'];
...@@ -143,14 +146,19 @@ $(function() { ...@@ -143,14 +146,19 @@ $(function() {
resultGrid.setCellValue(item, 'width', inventNameGlobalData[i]['param6Field']); resultGrid.setCellValue(item, 'width', inventNameGlobalData[i]['param6Field']);
resultGrid.setCellValue(item, 'thick', inventNameGlobalData[i]['param7Field']); resultGrid.setCellValue(item, 'thick', inventNameGlobalData[i]['param7Field']);
resultGrid.setCellValue(item, 'coefficient', inventNameGlobalData[i]['param8Field']); resultGrid.setCellValue(item, 'coefficient', inventNameGlobalData[i]['param8Field']);
resultGrid.refresh(); //resultGrid.refresh();
$("#locked_datacell_0_"+k+" input").attr("checked",true);
break;
}
} }
} }
} }
if (e.field == "spec") { if (e.field == "spec") {
var tr,index; var tr,index;
// 获取此model元素信息 // 获取此model元素信息
var item = e.items[0]; var item = e.items[0];
for (let k = 0; k < resultGrid.getCheckedRowsIndex()+1; k++) {
for (let i = 0; i < inventAllGlobalData.length; i++) { for (let i = 0; i < inventAllGlobalData.length; i++) {
if (inventAllGlobalData[i]['textField'] === item.spec) { if (inventAllGlobalData[i]['textField'] === item.spec) {
resultGrid.setCellValue(item, 'material', inventAllGlobalData[i]['param1Field']); resultGrid.setCellValue(item, 'material', inventAllGlobalData[i]['param1Field']);
...@@ -159,9 +167,13 @@ $(function() { ...@@ -159,9 +167,13 @@ $(function() {
resultGrid.setCellValue(item, 'width', inventAllGlobalData[i]['param4Field']); resultGrid.setCellValue(item, 'width', inventAllGlobalData[i]['param4Field']);
resultGrid.setCellValue(item, 'thick', inventAllGlobalData[i]['param5Field']); resultGrid.setCellValue(item, 'thick', inventAllGlobalData[i]['param5Field']);
resultGrid.setCellValue(item, 'coefficient', inventAllGlobalData[i]['param6Field']); resultGrid.setCellValue(item, 'coefficient', inventAllGlobalData[i]['param6Field']);
resultGrid.refresh(); $("#locked_datacell_0_"+k+" input").attr("checked",true);
//resultGrid.refresh();
break;
} }
} }
}
} }
}); });
}, },
......
...@@ -127,6 +127,7 @@ $(function() { ...@@ -127,6 +127,7 @@ $(function() {
var tr,index; var tr,index;
// 获取此model元素信息 // 获取此model元素信息
var item = e.items[0]; var item = e.items[0];
for (let k = 0; k < resultGrid.getCheckedRowsIndex()+1; k++) {
for (let i = 0; i < inventNameGlobalData.length; i++) { for (let i = 0; i < inventNameGlobalData.length; i++) {
if (inventNameGlobalData[i]['textField'] === item.inventName) { if (inventNameGlobalData[i]['textField'] === item.inventName) {
resultGrid.setCellValue(item, 'inventName', inventNameGlobalData[i]['param1Field']); resultGrid.setCellValue(item, 'inventName', inventNameGlobalData[i]['param1Field']);
...@@ -137,7 +138,10 @@ $(function() { ...@@ -137,7 +138,10 @@ $(function() {
resultGrid.setCellValue(item, 'width', inventNameGlobalData[i]['param6Field']); resultGrid.setCellValue(item, 'width', inventNameGlobalData[i]['param6Field']);
resultGrid.setCellValue(item, 'thick', inventNameGlobalData[i]['param7Field']); resultGrid.setCellValue(item, 'thick', inventNameGlobalData[i]['param7Field']);
resultGrid.setCellValue(item, 'coefficient', inventNameGlobalData[i]['param8Field']); resultGrid.setCellValue(item, 'coefficient', inventNameGlobalData[i]['param8Field']);
resultGrid.refresh(); $("#locked_datacell_0_"+k+" input").attr("checked",true);
//resultGrid.refresh();
break;
}
} }
} }
} }
...@@ -145,6 +149,7 @@ $(function() { ...@@ -145,6 +149,7 @@ $(function() {
var tr,index; var tr,index;
// 获取此model元素信息 // 获取此model元素信息
var item = e.items[0]; var item = e.items[0];
for (let k = 0; k < resultGrid.getCheckedRowsIndex()+1; k++) {
for (let i = 0; i < inventAllGlobalData.length; i++) { for (let i = 0; i < inventAllGlobalData.length; i++) {
if (inventAllGlobalData[i]['textField'] === item.spec) { if (inventAllGlobalData[i]['textField'] === item.spec) {
resultGrid.setCellValue(item, 'material', inventAllGlobalData[i]['param1Field']); resultGrid.setCellValue(item, 'material', inventAllGlobalData[i]['param1Field']);
...@@ -153,7 +158,10 @@ $(function() { ...@@ -153,7 +158,10 @@ $(function() {
resultGrid.setCellValue(item, 'width', inventAllGlobalData[i]['param4Field']); resultGrid.setCellValue(item, 'width', inventAllGlobalData[i]['param4Field']);
resultGrid.setCellValue(item, 'thick', inventAllGlobalData[i]['param5Field']); resultGrid.setCellValue(item, 'thick', inventAllGlobalData[i]['param5Field']);
resultGrid.setCellValue(item, 'coefficient', inventAllGlobalData[i]['param6Field']); resultGrid.setCellValue(item, 'coefficient', inventAllGlobalData[i]['param6Field']);
resultGrid.refresh(); $("#locked_datacell_0_"+k+" input").attr("checked",true);
//resultGrid.refresh();
break;
}
} }
} }
} }
......
$(function () { $(function () {
IPLATUI.EFGrid.result = { IPLATUI.EFGrid.result = {
copyToAdd:false,
pageable: { pageable: {
pageSize: 20, pageSize: 10,
pageSizes: [10, 20, 50, 70, 100], 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) { onSuccess: function (e) {
if(e.eiInfo.extAttr.methodName == 'save'||e.eiInfo.extAttr.methodName == 'delete' ){ if(e.eiInfo.extAttr.methodName == 'save'||e.eiInfo.extAttr.methodName == 'delete' ){
query(); query();
...@@ -14,6 +47,7 @@ $(function () { ...@@ -14,6 +47,7 @@ $(function () {
$("#type").val("insert") $("#type").val("insert")
$("#companyName").val(""); $("#companyName").val("");
$("#loginPrefix").val(""); $("#loginPrefix").val("");
$("#loginPrefix").removeAttr("readonly");
$("#validFlag").val(1); $("#validFlag").val(1);
$("#PCfileDocId").val(""); $("#PCfileDocId").val("");
$("#APPfileDocId").val(""); $("#APPfileDocId").val("");
...@@ -28,7 +62,7 @@ $(function () { ...@@ -28,7 +62,7 @@ $(function () {
onSave: function (e) { onSave: function (e) {
// 阻止后台保存请求,使用自定义保存 // 阻止后台保存请求,使用自定义保存
e.preventDefault(); e.preventDefault();
//save(); updateCompany();
}, },
onDelete: function (e) { onDelete: function (e) {
// 阻止后台删除请求,使用自定义删除 // 阻止后台删除请求,使用自定义删除
...@@ -44,21 +78,7 @@ $(function () { ...@@ -44,21 +78,7 @@ $(function () {
* e.tr tr, jquery * e.tr tr, jquery
*/ */
onRowClick: function (e) { 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({ /*WindowUtil({
"title": "", "title": "",
"content": "<div class='kendo-del-message'>" + e.row + "</div>" "content": "<div class='kendo-del-message'>" + e.row + "</div>"
...@@ -86,6 +106,11 @@ $(function () { ...@@ -86,6 +106,11 @@ $(function () {
localization: { localization: {
invalidFileExtension: "文件格式不支持, 上传失败" invalidFileExtension: "文件格式不支持, 上传失败"
}, },
loadComplete: function(e) {
var uploader = e.sender.uploader;
uploader.clearAllFiles();
// 清空所有历史上传文件
},
success: function(e) { success: function(e) {
let docId = e.response.docId; let docId = e.response.docId;
if (isBlank(docId)) { if (isBlank(docId)) {
...@@ -108,6 +133,11 @@ $(function () { ...@@ -108,6 +133,11 @@ $(function () {
localization: { localization: {
invalidFileExtension: "文件格式不支持, 上传失败" invalidFileExtension: "文件格式不支持, 上传失败"
}, },
loadComplete: function(e) {
var uploader = e.sender.uploader;
uploader.clearAllFiles();
// 清空所有历史上传文件
},
success: function(e) { success: function(e) {
let docId = e.response.docId; let docId = e.response.docId;
if (isBlank(docId)) { if (isBlank(docId)) {
...@@ -157,6 +187,7 @@ let save = function (){ ...@@ -157,6 +187,7 @@ let save = function (){
onSuccess: function (ei) { onSuccess: function (ei) {
btnNode.attr("disabled", false); btnNode.attr("disabled", false);
$("#insertGroup").data("kendoWindow").close(); $("#insertGroup").data("kendoWindow").close();
// 清除上传队列
resultGrid.dataSource.page(1); resultGrid.dataSource.page(1);
// onFail 表示失败回掉函数 // onFail 表示失败回掉函数
}, onFail: function (ei) { }, onFail: function (ei) {
...@@ -168,52 +199,6 @@ let save = function (){ ...@@ -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 () { let deleteFunc = function () {
...@@ -236,11 +221,36 @@ let deleteFunc = function () { ...@@ -236,11 +221,36 @@ let deleteFunc = function () {
* @param id * @param id
*/ */
function addCompany(id) { function addCompany(id) {
let rows = resultGrid.getCheckedRows(); $(".k-upload-status-total").remove();
//打开弹窗
id.data("kendoWindow").open().center(); 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 () { $("#update").click(function () {
var btnNode = $(this); var btnNode = $(this);
btnNode.attr("disabled", true); btnNode.attr("disabled", true);
...@@ -261,6 +271,7 @@ $("#update").click(function () { ...@@ -261,6 +271,7 @@ $("#update").click(function () {
} }
}); });
}); });
/** /**
* 附件上传回调 * 附件上传回调
* *
......
...@@ -15,12 +15,14 @@ ...@@ -15,12 +15,14 @@
<EF:EFRegion id="result" title="记录集"> <EF:EFRegion id="result" title="记录集">
<EF:EFGrid blockId="result" autoDraw="override" checkMode="single"> <EF:EFGrid blockId="result" autoDraw="override" checkMode="single">
<EF:EFColumn ename="id" cname="主键" hidden="true"/> <EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="docIdPc" cname="主键" hidden="true"/> <%--<EF:EFColumn ename="docIdPc" cname="主键" hidden="true"/>
<EF:EFColumn ename="docIdApp" 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="companyCode" enable="false" width="120" height="50" align="center"/>
<EF:EFColumn cname="企业名称" ename="companyName" width="140" required="true"/> <EF:EFColumn cname="企业名称" ename="companyName" width="140" align="center" required="true"/>
<EF:EFColumn cname="登录前缀" ename="loginPrefix" width="100" align="center" readonly="true"/> <EF:EFColumn cname="登录前缀" ename="loginPrefix" width="80" align="center" readonly="true"/>
<EF:EFComboColumn cname="是否启用" ename="validFlag" width="80" align="center" required="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:EFCodeOption codeName="hpjx.hppz.validFlag"/>
</EF:EFComboColumn> </EF:EFComboColumn>
<EF:EFColumn cname="备注" ename="remark" width="150" editType="textarea"/> <EF:EFColumn cname="备注" ename="remark" width="150" editType="textarea"/>
......
...@@ -283,6 +283,7 @@ $(function () { ...@@ -283,6 +283,7 @@ $(function () {
template: "#:textField#", template: "#:textField#",
filter: "contains" filter: "contains"
}); });
input.data("kendoAutoComplete").search();
} }
}, { }, {
field: "parentPrdtName", 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>
<%--
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 () { ...@@ -80,6 +80,7 @@ $(function () {
template: "#:textField#", template: "#:textField#",
filter: "contains" filter: "contains"
}); });
input.data("kendoAutoComplete").search();
}, },
/*afterEdit: function (e) { /*afterEdit: function (e) {
for (let i = 0; i < princ2Data.length; i++) { for (let i = 0; i < princ2Data.length; i++) {
...@@ -255,6 +256,7 @@ $(function () { ...@@ -255,6 +256,7 @@ $(function () {
template: "#:textField#", template: "#:textField#",
filter: "contains" filter: "contains"
}); });
input.data("kendoAutoComplete").search();
} }
} }
] ]
......
...@@ -288,16 +288,20 @@ $(function () { ...@@ -288,16 +288,20 @@ $(function () {
} }
}, {async: false}); }, {async: false});
input.kendoAutoComplete({ input.kendoAutoComplete({
valuePrimitive: true,
dataSource: dataSource, dataSource: dataSource,
minLength: 0,
dataTextField: "textField", dataTextField: "textField",
dataValueField: "valueField", dataValueField: "valueField",
required: "true",
optionLabelTemplate: "#:textField#", optionLabelTemplate: "#:textField#",
valueTemplate: "#:valueField#", valueTemplate: "#:valueField#",
template: "#:textField#", template: "#:textField#",
filter: "contains" filter: "contains"
}); });
input.data("kendoAutoComplete").search();
//input.trigger("change", {sender: input, open: true});
//enforceMinLength: true,
//suggest: false,
//open: true,
} }
}, { }, {
field: "parentPrdtName", field: "parentPrdtName",
...@@ -407,7 +411,12 @@ $(function () { ...@@ -407,7 +411,12 @@ $(function () {
}); });
$("#DOWNLOAD").on("click", function (e) { $("#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; window.location.href = href;
}); });
......
...@@ -198,6 +198,7 @@ $(function () { ...@@ -198,6 +198,7 @@ $(function () {
template: "#:textField#", template: "#:textField#",
filter: "contains" filter: "contains"
}); });
input.data("kendoAutoComplete").search();
} }
}, },
{ {
......
...@@ -59,10 +59,11 @@ $(function () { ...@@ -59,10 +59,11 @@ $(function () {
}, },
onSave: function (e) { onSave: function (e) {
// 阻止默认请求,使用自定义保存 // 阻止默认请求,使用自定义保存
//e.preventDefault(); e.preventDefault();
//let btnNode = $(this); //let btnNode = $(this);
//禁用按钮 //禁用按钮
//btnNode.attr("disabled", true); //btnNode.attr("disabled", true);
updateWindowOpen();
//saveResult(btnNode); //saveResult(btnNode);
}, },
onSuccess: function (e) { onSuccess: function (e) {
...@@ -128,6 +129,7 @@ $(function () { ...@@ -128,6 +129,7 @@ $(function () {
} }
}, {async: false}); }, {async: false});
}); });
downKeyUp();
}); });
function showUploadFile(id) { function showUploadFile(id) {
...@@ -336,12 +338,12 @@ function loadChange(grid,e,field) { ...@@ -336,12 +338,12 @@ function loadChange(grid,e,field) {
* @param let * @param let
*/ */
function showGroupDetail(id) { 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) { function addWindowOpen(id) {
JSColorbox.open({ 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>", title: "<div style='text-align: center;'>新增</div>",
width: "80%", width: "80%",
height: "90%", height: "90%",
...@@ -349,12 +351,25 @@ function addWindowOpen(id) { ...@@ -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({ 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>", title: "<div style='text-align: center;'>修改</div>",
width: "60%", width: "80%",
height: "50%", height: "90%",
callbackName: windowOpenCallback callbackName: windowOpenCallback
}); });
} }
......
...@@ -40,15 +40,15 @@ ...@@ -40,15 +40,15 @@
maxLength="16" readonly="true" width="120" required="true" maxLength="16" readonly="true" width="120" required="true"
align="center" filter="contains" sort="true"> align="center" filter="contains" sort="true">
</EF:EFComboColumn> </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" displayType="0.000" sort="true" align="right"
data-regex="/^-?[0-9]{1,16}([.][0-9]{1,2})?$/" maxLength="20" required="true" data-regex="/^-?[0-9]{1,16}([.][0-9]{1,3})?$/" maxLength="20" required="true"
data-errorprompt="请输入数字,该值最大可设置17位整数和2位小数!" data-errorprompt="请输入数字,该值最大可设置17位整数和3位小数!"
/> />
<EF:EFColumn ename="userCount" cname="用工人数" width="120" enable="true" format="{0:N0}" editType="text" <EF:EFColumn ename="userCount" cname="用工人数" width="120" enable="false" format="{0:N3}" editType="text"
displayType="0" sort="true" align="right" displayType="0.000" sort="true" align="right"
data-regex="/^-?[0-9]{1,16}([.][0-9]{1,3})?$/" maxLength="20" required="true" data-regex="/^-?[0-9]{1,16}([.][0-9]{1,3})?$/" maxLength="20" required="true"
data-errorprompt="请输入数字,该值最大可设置17位整数!" data-errorprompt="请输入数字,该值最大可设置17位整数和3位小数!"
/> />
</EF:EFGrid> </EF:EFGrid>
</EF:EFRegion> </EF:EFRegion>
......
...@@ -184,6 +184,7 @@ $(function () { ...@@ -184,6 +184,7 @@ $(function () {
} }
}, {async: false}); }, {async: false});
}); });
downKeyUp();
}); });
function showUploadFile(id) { function showUploadFile(id) {
......
...@@ -68,15 +68,15 @@ ...@@ -68,15 +68,15 @@
<EF:EFCodeOption codeName="hpjx.hpjx.productionType" /> <EF:EFCodeOption codeName="hpjx.hpjx.productionType" />
</EF:EFComboColumn> </EF:EFComboColumn>
<EF:EFColumn ename="prdtName" cname="生产内容" enable="false" width="160" align="center" required="true"/> <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" displayType="0.000" sort="true" align="right"
data-regex="/^-?[0-9]{1,16}([.][0-9]{1,2})?$/" maxLength="20" required="true" data-regex="/^-?[0-9]{1,16}([.][0-9]{1,3})?$/" maxLength="20" required="true"
data-errorprompt="请输入数字,该值最大可设置17位整数和2位小数!" 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" displayType="0.000" sort="true" align="right"
data-regex="/^-?[0-9]{1,16}([.][0-9]{1,2})?$/" maxLength="20" required="true" data-regex="/^-?[0-9]{1,16}([.][0-9]{1,3})?$/" maxLength="20" required="true"
data-errorprompt="请输入数字,该值最大可设置17位整数和2位小数!" data-errorprompt="请输入数字,该值最大可设置17位整数和3位小数!"
/> />
<%--<EF:EFColumn ename="remark" cname="备注" enable="true" width="200" align="center"/>--%> <%--<EF:EFColumn ename="remark" cname="备注" enable="true" width="200" align="center"/>--%>
</EF:EFGrid> </EF:EFGrid>
......
...@@ -20,10 +20,10 @@ $(function (){ ...@@ -20,10 +20,10 @@ $(function (){
IPLATUI.EFDatePicker = { IPLATUI.EFDatePicker = {
"inqu_status-0-registerDate": { "inqu_status-0-registerDate": {
start: "day", start: "day",
depth: "day", depth: "day"
value:year+"-"+month+"-"+day
} }
} }
//value:year+"-"+month+"-"+day
IPLATUI.EFGrid = { IPLATUI.EFGrid = {
"result": { "result": {
...@@ -36,7 +36,7 @@ $(function (){ ...@@ -36,7 +36,7 @@ $(function (){
pageSize: 10, pageSize: 10,
pageSizes: [10, 20, 30, 50, 100, 200], pageSizes: [10, 20, 30, 50, 100, 200],
},*/ },*/
columns: [{ columns: [/*{
field: "operator", field: "operator",
title: "操作", title: "操作",
template: function (item) { template: function (item) {
...@@ -45,7 +45,7 @@ $(function (){ ...@@ -45,7 +45,7 @@ $(function (){
+ 'onclick="deleteRow(' + item.rowNo + ')" >删除</a>'; + 'onclick="deleteRow(' + item.rowNo + ')" >删除</a>';
return template return template
} }
}/*,{ }*//*,{
field: "registerDate", field: "registerDate",
attributes: { attributes: {
class: "i-input-readonly" class: "i-input-readonly"
...@@ -63,6 +63,12 @@ $(function (){ ...@@ -63,6 +63,12 @@ $(function (){
}else { }else {
$("#inqu_status-0-userCount").val(0); $("#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) { onSave: function (e) {
// 阻止默认请求,使用自定义保存 // 阻止默认请求,使用自定义保存
...@@ -84,7 +90,7 @@ $(function (){ ...@@ -84,7 +90,7 @@ $(function (){
toolbarConfig:{ toolbarConfig:{
hidden: false, hidden: false,
}, },
columns: [{ columns: [/*{
field: "operator", field: "operator",
title: "操作", title: "操作",
template: function (item) { template: function (item) {
...@@ -93,7 +99,7 @@ $(function (){ ...@@ -93,7 +99,7 @@ $(function (){
+ 'onclick="detailDeleteRow(' + item.rowNo + ')" >删除</a>'; + 'onclick="detailDeleteRow(' + item.rowNo + ')" >删除</a>';
return template return template
} }
}], }*/],
} }
}; };
...@@ -109,45 +115,37 @@ $(function (){ ...@@ -109,45 +115,37 @@ $(function (){
* 确认 * 确认
*/ */
$('#confirm').on('click', function () { $('#confirm').on('click', function () {
let rows = resultGrid.getCheckedRows(); let resultRows = resultGrid.getDataItems();
if (rows.length < 1) {
message("请选择数据");
return;
}
let methodType = $("#inqu_status-0-methodType").val(); let methodType = $("#inqu_status-0-methodType").val();
let registerDate = $("#inqu_status-0-registerDate").val(); let registerDate = $("#inqu_status-0-registerDate").val();
if (registerDate.length<=0){ if (registerDate.length<=0){
registerDate = currShortDate() registerDate = currShortDate()
} }
let flag = true; let flag = true;
$.each(rows, function(index, item) { $.each(resultRows, function(index, item) {
let prdtName= item.get("prdtName"); let prdtName= item.get("prdtName");
if(isBlank(prdtName)){
message("选中的第"+(index+1)+"行\"产品\",不能为空!");
flag = false;
return false;
}
let weight= item.get("weight"); let weight= item.get("weight");
if(isBlank(weight)){ if(weight != 0 && isBlank(prdtName)){
message("选中的第"+(index+1)+"行\"组拼产量(T)\",不能为空!"); message("选中的生产组第"+(index+1)+"行\"产品\",不能为空!");
flag = false; flag = false;
return false; return false;
} }
let weightJh= item.get("weightJh"); let weightJh= item.get("weightJh");
if(isBlank(weightJh)){ if(weightJh !=0 && isBlank(prdtName)){
message("选中的第"+(index+1)+"行\"加焊产量(T)\",不能为空!"); message("选中的生产组第"+(index+1)+"行\"加焊产量(T)\",不能为空!");
flag = false; flag = false;
return false; return false;
} }
}); });
if(flag) { if(flag) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", { JSUtils.confirm("确定对数据做\"保存\"操作? ", {
ok: function () { ok: function () {
var info = new EiInfo(); var info = new EiInfo();
info.set("inqu_status-0-userCount",$("#inqu_status-0-userCount").val()); info.set("inqu_status-0-userCount",$("#inqu_status-0-userCount").val());
info.set("inqu_status-0-registerDate",registerDate); info.set("inqu_status-0-registerDate",registerDate);
info.addBlock(JSUtils.checkedRows2Block("result")); info.set("inqu_status-0-id",$("#inqu_status-0-id").val());
info.addBlock(JSUtils.checkedRows2Block("detail")) info.addBlock(rowsBlock("result"));
info.addBlock(rowsBlock("detail"))
EiCommunicator.send("HPSC010", methodType, info, { EiCommunicator.send("HPSC010", methodType, info, {
onSuccess: function (ei) { onSuccess: function (ei) {
if (ei.getStatus() >= 0) { if (ei.getStatus() >= 0) {
...@@ -184,6 +182,7 @@ $(function (){ ...@@ -184,6 +182,7 @@ $(function (){
} }
}); });
downKeyUp();
}) })
/** /**
...@@ -286,3 +285,43 @@ let detailRefreshRowNo = function (rowNo) { ...@@ -286,3 +285,43 @@ let detailRefreshRowNo = function (rowNo) {
} }
} }
} }
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 @@ ...@@ -15,9 +15,10 @@
<EF:EFPage title="报工管理"> <EF:EFPage title="报工管理">
<EF:EFRegion id="result" title="生产明细信息"> <EF:EFRegion id="result" title="生产明细信息">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row"> <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="rowNo" cname="行号" hidden="true"/>
<EF:EFColumn ename="remark" cname="上级ID" 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" <%--<EF:EFColumn ename="registerDate" cname="登记日期" width="160" align="center" editType="date" readonly="true"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true"/>--%> dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true"/>--%>
<EF:EFComboColumn ename="factoryCode" cname="工厂" blockName="factory_code_block_id" <EF:EFComboColumn ename="factoryCode" cname="工厂" blockName="factory_code_block_id"
...@@ -50,14 +51,15 @@ ...@@ -50,14 +51,15 @@
align="center" filter="contains" sort="true"> align="center" filter="contains" sort="true">
<EF:EFCodeOption codeName="hpjx.hpjx.productionType" /> <EF:EFCodeOption codeName="hpjx.hpjx.productionType" />
</EF:EFComboColumn> </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:EFGrid>
</EF:EFRegion> </EF:EFRegion>
<EF:EFRegion id="detail" title="下料明细信息"> <EF:EFRegion id="detail" title="下料明细信息">
<EF:EFGrid blockId="detail" autoDraw="override" toolbarConfig="{hidden:'all'}" isFloat="true" checkMode="row"> <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="rowNo" cname="行号" hidden="true"/>
<EF:EFColumn ename="remark" cname="上级ID" 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" <%--<EF:EFColumn ename="registerDate" cname="登记日期" width="160" align="center" editType="date" readonly="true"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true"/>--%> dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true"/>--%>
<EF:EFComboColumn ename="factoryCode" cname="工厂" blockName="factory_code_block_id" <EF:EFComboColumn ename="factoryCode" cname="工厂" blockName="factory_code_block_id"
...@@ -87,7 +89,7 @@ ...@@ -87,7 +89,7 @@
data-errorprompt="请输入数字,该值最大可设置17位整数和3位小数!" data-errorprompt="请输入数字,该值最大可设置17位整数和3位小数!"
/> />
<EF:EFColumn ename="weightJh" cname="加焊产量(T)" width="120" enable="true" format="{0:N3}" editType="text" <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-regex="/^-?[0-9]{1,16}([.][0-9]{1,3})?$/" maxLength="20"
data-errorprompt="请输入数字,该值最大可设置17位整数和3位小数!" data-errorprompt="请输入数字,该值最大可设置17位整数和3位小数!"
/> />
...@@ -101,6 +103,7 @@ ...@@ -101,6 +103,7 @@
<EF:EFDatePicker ename="inqu_status-0-registerDate" colWidth="3" cname="登记日期" <EF:EFDatePicker ename="inqu_status-0-registerDate" colWidth="3" cname="登记日期"
required="true" format="yyyy-MM-dd" parseFormats="['yyyyMMdd']"/> 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="" blockId="inqu_status" ename="methodType" row="0" colWidth="3" hidden="true"/>
<EF:EFInput cname="" ename="inqu_status-0-id" colWidth="3" hidden="true"/>
</div> </div>
</EF:EFRegion> </EF:EFRegion>
<div class="row"> <div class="row">
......
...@@ -208,6 +208,7 @@ function refreshInputSelect(container, inInfo) { ...@@ -208,6 +208,7 @@ function refreshInputSelect(container, inInfo) {
template: "#:textField#", template: "#:textField#",
filter: "contains" filter: "contains"
}); });
input.data("kendoAutoComplete").search();
return dataSource; 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