Commit bf1a1cd1 by liuyang

2024-04-08 报工管理功能调整

parent 2c5ab4db
...@@ -345,6 +345,13 @@ public enum DdynamicEnum { ...@@ -345,6 +345,13 @@ public enum DdynamicEnum {
APP_MAP_BLOCK_PRODTASKNO("app_map_block_prodtaskno","prodTaskNo","prodorderNo","HPMT002.queryProdTaskNo"), APP_MAP_BLOCK_PRODTASKNO("app_map_block_prodtaskno","prodTaskNo","prodorderNo","HPMT002.queryProdTaskNo"),
/** /**
* 模块:组管理
* 用途:组管理下拉框
* 编写:songx
*/
GROUP_RECORD1_BLOCK_ID("group_record_block_id","orgId","orgCname","HPSC010.queryGroupComboBox"),
/**
* 模块:工人管理 * 模块:工人管理
* 用途:工人管理下拉框 * 用途:工人管理下拉框
* 编写:wwl * 编写:wwl
......
...@@ -68,6 +68,9 @@ public class HPSC008 extends DaoEPBase { ...@@ -68,6 +68,9 @@ public class HPSC008 extends DaoEPBase {
public static final String UPDATE = "HPSC008.update"; public static final String UPDATE = "HPSC008.update";
public static final String DELETE = "HPSC008.delete"; public static final String DELETE = "HPSC008.delete";
public static final String DELETE_FLAG = "HPSC008.deleteFlag"; public static final String DELETE_FLAG = "HPSC008.deleteFlag";
public static final String DELETE_REMARK = "HPSC008.deleteRemark";
public static final String QUERY_DETAIL = "HPSC008.queryDetail";
public static final String QUERY_RESULT = "HPSC008.queryResult";
private Long id = new Long(0); /* ID*/ private Long id = new Long(0); /* ID*/
private String companyCode = " "; /* 企业编码 预留*/ private String companyCode = " "; /* 企业编码 预留*/
......
package com.baosight.hpjx.hp.sc.service;
import com.baosight.hpjx.common.DdynamicEnum;
import com.baosight.hpjx.core.constant.CommonConstant;
import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.hp.sc.domain.HPSC008;
import com.baosight.hpjx.hp.sc.domain.HPSC009;
import com.baosight.hpjx.hp.sc.domain.HPSC010;
import com.baosight.hpjx.util.CommonMethod;
import com.baosight.hpjx.util.ErrorCodeUtils;
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 java.math.BigDecimal;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @author LiuYang
* @version 1.0 2024/4/3
*/
public class ServiceHPSC010 extends ServiceEPBase {
@Override
public EiInfo initLoad(EiInfo inInfo) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HPSC009.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
final EiInfo outEiInfo = super.query(inInfo, HPSC010.QUERY, new HPSC010().eiMetadata);
CommonMethod.initBlock(outEiInfo,
Arrays.asList(DdynamicEnum.FACTORY_CODE_BLOCK_ID), new HashMap<String,Object>());
return outEiInfo;
}
@Override
public EiInfo query(EiInfo inInfo) {
return super.query(inInfo,HPSC010.QUERY,new HPSC010());
}
@Override
public EiInfo delete(EiInfo inInfo) {
int i = 0;
try {
HPSC010 hpxs010 = new HPSC010();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
for (i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
hpxs010.fromMap(map);
hpxs010.setDeleteFlag(CommonConstant.YesNo.YES_1);
this.delRows(hpxs010.getId().toString());
DaoUtils.update(HPSC010.DELETE_FLAG, hpxs010.toMap());
}
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;
}
@Override
public EiInfo update(EiInfo inInfo) {
int i = 0;
try {
HPSC010 hpxs010 = new HPSC010();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
for (i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
hpxs010.fromMap(map);
hpxs010.setDeleteFlag(CommonConstant.YesNo.NO_0);
DaoUtils.update(HPSC010.UPDATE, hpxs010);
}
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;
}
@Override
public EiInfo insert(EiInfo inInfo) {
int i = 0;
try {
HPSC010 hpxs010 = new HPSC010();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
List<Map> list = eiBlock.getRows();
list.addAll(inInfo.getBlock(CommonConstant.Field.DETAIL).getRows());
double weight = 0;
for (i = 0; i < list.size(); i++) {
Map<?, ?> map = list.get(i);
BigDecimal bigDecimal = new BigDecimal(map.get(HPSC008.FIELD_WEIGHT).toString());
weight = weight+bigDecimal.doubleValue();
}
hpxs010.fromMap(eiBlock.getRow(0));
hpxs010.setDeleteFlag(CommonConstant.YesNo.NO_0);
hpxs010.setWeight(BigDecimal.valueOf(weight));
hpxs010.setUserCount(Long.valueOf(inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HPSC010.FIELD_USER_COUNT)));
DaoUtils.insert(HPSC010.INSERT, hpxs010);
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsgByKey("ep.1000", new String[]{String.valueOf(i), I18nMessages.getText("label.insert", "新增")});
} catch (PlatException e) {
e.printStackTrace();
inInfo.setStatus(EiConstant.STATUS_FAILURE);
ErrorCodeUtils.handleInsertException(inInfo,i,e);
logError("新增失败", e.getMessage());
return inInfo;
}
return inInfo;
}
public void delRows(String id){
HPSC008 hpxs001 = new HPSC008();
hpxs001.setRemark(id);
hpxs001.setDeleteFlag(CommonConstant.YesNo.YES_1);
DaoUtils.update(HPSC008.DELETE_REMARK, hpxs001.toMap());
}
}
\ No newline at end of file
package com.baosight.hpjx.hp.sc.service;
import com.baosight.hpjx.common.DdynamicEnum;
import com.baosight.hpjx.core.constant.CommonConstant;
import com.baosight.hpjx.core.security.UserSessionUtils;
import com.baosight.hpjx.hp.sc.domain.HPSC008;
import com.baosight.hpjx.util.CommonMethod;
import com.baosight.hpjx.util.StringUtil;
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.service.impl.ServiceEPBase;
import java.util.Arrays;
import java.util.HashMap;
/**
* @author LiuYang
* @version 1.0 2024/4/7
*/
public class ServiceHPSC010A extends ServiceEPBase {
@Override
public EiInfo initLoad(EiInfo inInfo) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HPSC008.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
final EiInfo outEiInfo = super.query(inInfo, HPSC008.QUERY_RESULT, new HPSC008());
EiInfo detailEiInfo = super.query(inInfo, HPSC008.QUERY_DETAIL, new HPSC008());
EiBlock detailBlock = new EiBlock(CommonConstant.Field.DETAIL);
detailBlock.setBlockMeta(new HPSC008().eiMetadata);
detailBlock.setRows(detailEiInfo.getBlock(EiConstant.resultBlock).getRows());
outEiInfo.setBlock(detailBlock);
CommonMethod.initBlock(outEiInfo, Arrays.asList(DdynamicEnum.FACTORY_RECORD_BLOCK_ID), null, false);
CommonMethod.initBlock(outEiInfo, Arrays.asList(DdynamicEnum.GROUP_RECORD1_BLOCK_ID), null, false);
//拼接名称 包含逻辑删除数据
return outEiInfo;
}
@Override
public EiInfo query(EiInfo inInfo) {
EiBlock block = inInfo.getBlock(EiConstant.queryBlock);
String startDate = block.getCellStr(ACConstants.ROW_CODE_0,"createdDateFrom");
String endDate = block.getCellStr(ACConstants.ROW_CODE_0,"createdDateTo");
if (!endDate.isEmpty()) {
inInfo.setCell(EiConstant.queryBlock,ACConstants.ROW_CODE_0,"createdDateTo", StringUtil.removeHorizontalLine(endDate));
}
if (!startDate.isEmpty()) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0,"createdDateFrom",StringUtil.removeHorizontalLine(startDate));
}
inInfo.setCell(EiConstant.queryBlock,ACConstants.ROW_CODE_0,HPSC008.FIELD_DELETE_FLAG,CommonConstant.YesNo.NO_0);
return super.query(inInfo, HPSC008.QUERY,new HPSC008());
}
}
package com.baosight.hpjx.hp.sc.service;
import com.baosight.hpjx.aspect.annotation.OperationLogAnnotation;
import com.baosight.hpjx.common.DdynamicEnum;
import com.baosight.hpjx.core.constant.CommonConstant;
import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.core.security.UserSessionUtils;
import com.baosight.hpjx.hp.sc.domain.HPSC008;
import com.baosight.hpjx.hp.sc.domain.HPSC010;
import com.baosight.hpjx.hp.sc.domain.HPSC096;
import com.baosight.hpjx.hp.sc.domain.HPSC098;
import com.baosight.hpjx.util.CommonMethod;
import com.baosight.hpjx.util.ErrorCodeUtils;
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.core.web.threadlocal.UserSession;
import java.math.BigDecimal;
import java.util.*;
/**
* @author LiuYang
* @version 1.0 2024/4/3
*/
public class ServiceHPSC096 extends ServiceEPBase {
@OperationLogAnnotation(operModul = "报工管理",operType = "查询",operDesc = "初始化")
@Override
public EiInfo initLoad(EiInfo inInfo) {
String methodType = inInfo.getString("inqu_status-0-methodType"); //操作类型
List<Map> listFactoryCode;
if ("update".equals(methodType)) {
String id = inInfo.getString("inqu_status-0-id");
listFactoryCode = this.dao.query(HPSC008.QUERY,new HashMap<String,Object>(){{
put(HPSC008.FIELD_REMARK,id);
}},EiConstant.defaultOffset,100);
EiInfo eiInfo = super.query(inInfo,HPSC010.QUERY,new HPSC010());
if (eiInfo.getBlock(EiConstant.resultBlock).getRows().size() >0) {
inInfo.setCell(EiConstant.queryBlock,ACConstants.ROW_CODE_0,HPSC010.FIELD_USER_COUNT,
eiInfo.getCellStr(EiConstant.resultBlock,ACConstants.ROW_CODE_0,HPSC010.FIELD_USER_COUNT));
}
inInfo.addBlock(EiConstant.resultBlock).setRows(listFactoryCode);
}else {
List<Map> listResult = new ArrayList<>();
List<Map> listdetail = new ArrayList<>();
String loginName = UserSession.getLoginName();
Map queryMap = new HashMap();
queryMap.put("loginName", loginName);
listFactoryCode = this.dao.query(HPSC096.QUERY_FACTORY_CODE,queryMap,EiConstant.defaultOffset,100);
List<Map> listProducTionType = this.dao.query(HPSC096.QUERY_PRODUCTION_TYPE,new HashMap<>());
int rowNo = 0;
int detrowNo = 0;
for (int i = 0; i < listFactoryCode.size(); i++) {
if ("prodGroup".equals(listFactoryCode.get(i).get(HPSC096.FIELD_ORG_TYPE))) {
for (Map map : listProducTionType) {
rowNo++;
Map result = new HashMap();
result.putAll(listFactoryCode.get(i));
result.put(HPSC096.FIELD_GROUP_TYPE, map.get(HPSC096.FIELD_GROUP_TYPE));
result.put("rowNo",rowNo);
//listFactoryCode.get(i).put(HPSC096.FIELD_GROUP_TYPE,listProducTionType.get(j).get(HPSC096.FIELD_GROUP_TYPE));
listResult.add(result);
}
}else {
Map detailMap = new HashMap();
detailMap.putAll(listFactoryCode.get(i));
detailMap.put("rowNo",detrowNo);
listdetail.add(detailMap);
detrowNo++;
}
}
inInfo.addBlock(EiConstant.resultBlock).setRows(listResult);
inInfo.addBlock(CommonConstant.Field.DETAIL).setRows(listdetail);
}
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HPSC096().eiMetadata);
inInfo.addBlock(CommonConstant.Field.DETAIL).addBlockMeta(new HPSC096().eiMetadata);
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0,"methodType",methodType);
CommonMethod.initBlock(inInfo,
Arrays.asList(DdynamicEnum.GROUP_RECORD1_BLOCK_ID,DdynamicEnum.FACTORY_CODE_BLOCK_ID),
new HashMap<String,Object>(){{
put(HPSC008.FIELD_COMPANY_CODE, UserSessionUtils.getCompanyCode());
}}
);
return inInfo;
}
@Override
public EiInfo query(EiInfo inInfo) {
return super.query(inInfo);
}
@OperationLogAnnotation(operModul = "报工管理",operType = "修改",operDesc = "修改操作")
@Override
public EiInfo update(EiInfo inInfo) {
int i = 0;
try {
HPSC008 hpxs002 = new HPSC008();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
for (i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
hpxs002.fromMap(map);
hpxs002.setDeleteFlag(CommonConstant.YesNo.NO_0);
DaoUtils.update(HPSC008.UPDATE, hpxs002);
}
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 = "新增操作")
@Override
public EiInfo insert(EiInfo inInfo) {
int i = 0;
try {
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
Map queryMap = new HashMap();
queryMap.put(HPSC010.FIELD_REGISTER_DATE,eiBlock.getCellStr(ACConstants.ROW_CODE_0,HPSC010.FIELD_REGISTER_DATE));
queryMap.put(HPSC010.FIELD_FACTORY_CODE,eiBlock.getCellStr(ACConstants.ROW_CODE_0,HPSC010.FIELD_FACTORY_CODE));
List<Map> list = this.dao.query(HPSC010.QUERY_MAX,queryMap);
List<Map> listResult = eiBlock.getRows();
listResult.addAll(inInfo.getBlock(CommonConstant.Field.DETAIL).getRows());
HPSC008 hpxs008 = new HPSC008();
for (i = 0; i < listResult.size(); i++) {
Map<?, ?> map = listResult.get(i);
hpxs008.fromMap(map);
hpxs008.setDeleteFlag(CommonConstant.YesNo.NO_0);
for (Map map1:list) {
hpxs008.setRemark(map1.get(HPSC010.FIELD_ID).toString());
}
DaoUtils.insert(HPSC008.INSERT, hpxs008);
}
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;
}
}
...@@ -110,6 +110,76 @@ ...@@ -110,6 +110,76 @@
</select> </select>
<select id="queryResult" parameterClass="java.util.HashMap"
resultClass="com.baosight.hpjx.hp.sc.domain.HPSC008">
SELECT
ID as "id", <!-- ID -->
COMPANY_CODE as "companyCode", <!-- 企业编码 预留 -->
DEP_CODE as "depCode", <!-- 部门编码 预留 -->
REGISTER_DATE as "registerDate", <!-- 登记日期 -->
FACTORY_CODE as "factoryCode", <!-- 工厂代码 -->
GROUP_CODE as "groupCode", <!-- 生产组代码 -->
USER_ID as "userId", <!-- 员工代码 -->
GROUP_TYPE as "groupType", <!-- 生产类型 -->
PRDT_CODE as "prdtCode", <!-- 产品代码 -->
PRDT_NAME as "prdtName", <!-- 产品名称 -->
WEIGHT as "weight", <!-- 产量 -->
REMARK as "remark", <!-- 备注 -->
DELETE_FLAG as "deleteFlag", <!-- 是否删除0:否1.是 -->
CREATED_BY as "createdBy", <!-- 创建人 -->
CREATED_NAME as "createdName", <!-- 创建人名称 -->
CREATED_TIME as "createdTime", <!-- 创建时间 -->
UPDATED_BY as "updatedBy", <!-- 修改人 -->
UPDATED_TIME as "updatedTime", <!-- 修改人名称 -->
UPDATED_NAME as "updatedName" <!-- 修改时间 -->
FROM ${hpjxSchema}.T_HPXS001 WHERE 1=1 and GROUP_TYPE in ('1','2')
<include refid="condition" />
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
CREATED_TIME desc
</isEmpty>
</dynamic>
</select>
<select id="queryDetail" parameterClass="java.util.HashMap"
resultClass="java.util.HashMap">
SELECT
ID as "id", <!-- ID -->
COMPANY_CODE as "companyCode", <!-- 企业编码 预留 -->
DEP_CODE as "depCode", <!-- 部门编码 预留 -->
REGISTER_DATE as "registerDate", <!-- 登记日期 -->
FACTORY_CODE as "factoryCode", <!-- 工厂代码 -->
GROUP_CODE as "groupCode", <!-- 生产组代码 -->
USER_ID as "userId", <!-- 员工代码 -->
GROUP_TYPE as "groupType", <!-- 生产类型 -->
PRDT_CODE as "prdtCode", <!-- 产品代码 -->
PRDT_NAME as "prdtName", <!-- 产品名称 -->
WEIGHT as "weight", <!-- 产量 -->
REMARK as "remark", <!-- 备注 -->
DELETE_FLAG as "deleteFlag", <!-- 是否删除0:否1.是 -->
CREATED_BY as "createdBy", <!-- 创建人 -->
CREATED_NAME as "createdName", <!-- 创建人名称 -->
CREATED_TIME as "createdTime", <!-- 创建时间 -->
UPDATED_BY as "updatedBy", <!-- 修改人 -->
UPDATED_TIME as "updatedTime", <!-- 修改人名称 -->
UPDATED_NAME as "updatedName" <!-- 修改时间 -->
FROM ${hpjxSchema}.T_HPXS001 WHERE 1=1 and GROUP_TYPE not in ('1','2')
<include refid="condition" />
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
CREATED_TIME desc
</isEmpty>
</dynamic>
</select>
<select id="count" resultClass="int"> <select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hpjxSchema}.T_HPXS001 WHERE 1=1 SELECT COUNT(*) FROM ${hpjxSchema}.T_HPXS001 WHERE 1=1
<include refid="condition" /> <include refid="condition" />
...@@ -226,6 +296,22 @@ ...@@ -226,6 +296,22 @@
</isNotEmpty> </isNotEmpty>
</update> </update>
<update id="deleteRemark">
UPDATE ${hpjxSchema}.T_HPXS001
SET
DELETE_FLAG = #deleteFlag#, <!-- 是否删除0:否1.是 -->
UPDATED_BY = #updatedBy#, <!-- 修改人 -->
UPDATED_TIME = #updatedTime#, <!-- 修改人名称 -->
UPDATED_NAME = #updatedName# <!-- 修改时间 -->
WHERE REMARK = #remark#
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
</update>
<update id="update"> <update id="update">
UPDATE ${hpjxSchema}.T_HPXS001 UPDATE ${hpjxSchema}.T_HPXS001
SET SET
......
<%--
Created by IntelliJ IDEA.
User: 1
Date: 2024/4/3
Time: 14:04
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 cname="工厂" ename="factoryCode" blockId="inqu_status" row="0" colWidth="3"
filter="contains" defultValue="">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="factory_code_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFDateSpan startCname="登记日期" endCname="至" blockId="inqu_status"
startName="createdDateFrom" endName="createdDateTo" row="0" role="date"
format="yyyy-MM-dd" satrtRatio="4:8" endRatio="4:8">
</EF:EFDateSpan>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="single">
<EF:EFColumn ename="id" primaryKey="true" cname="内码" hidden="true"/>
<EF:EFColumn ename="companyCode" cname="企业编码" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="120" align="center"/>
<EF:EFColumn ename="registerDate" cname="登记日期" width="160" align="center" editType="date" readonly="true"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true"/>
<EF:EFComboColumn ename="factoryCode" cname="工厂" blockName="factory_code_block_id"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" readonly="true" width="120" required="true"
align="center" filter="contains" sort="true">
</EF:EFComboColumn>
<EF:EFColumn ename="weight" cname="产量" width="120" enable="false" format="{0:N2}" editType="text"
displayType="0.000" sort="true" align="right"
data-regex="/^-?[0-9]{1,16}([.][0-9]{1,2})?$/" maxLength="20" required="true"
data-errorprompt="请输入数字,该值最大可设置17位整数和2位小数!"
/>
<EF:EFColumn ename="userCount" cname="用工人数" width="120" enable="true" format="{0:N0}" editType="text"
displayType="0" sort="true" align="right"
data-regex="/^-?[0-9]{1,16}([.][0-9]{1,3})?$/" maxLength="20" required="true"
data-errorprompt="请输入数字,该值最大可设置17位整数!"
/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
\ No newline at end of file
<%--
Created by IntelliJ IDEA.
User: 1
Date: 2024/3/7
Time: 11:20
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 cname="工厂" ename="factoryCode" blockId="inqu_status" row="0" colWidth="3"
filter="contains" defultValue="">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="factory_code_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFSelect cname="生产组" ename="groupCode" blockId="inqu_status" row="0" colWidth="3"
filter="contains" defultValue="">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="group_code_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFSelect cname="员工" ename="userId" blockId="inqu_status" row="0" colWidth="3"
filter="contains" defultValue="">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="user_id_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFInput cname="产品" blockId="inqu_status" ename="prdtName" row="0" colWidth="3"/>
<EF:EFDateSpan startCname="登记日期" endCname="至" blockId="inqu_status"
startName="createdDateFrom" endName="createdDateTo" row="0" role="date"
format="yyyy-MM-dd" satrtRatio="4:8" endRatio="4:8">
</EF:EFDateSpan>
&lt;%&ndash;<EF:EFSelect cname="是否删除" ename="deleteFlag" blockId="inqu_status" row="0" colWidth="3" defaultValue="0">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hpjx.hpjx.deleteFlag"/>
</EF:EFSelect>&ndash;%&gt;
</div>
</EF:EFRegion>--%>
<EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row">
<EF:EFColumn ename="id" primaryKey="true" cname="内码" hidden="true"/>
<EF:EFColumn ename="companyCode" cname="企业编码" hidden="true"/>
<EF:EFColumn ename="registerDate" cname="登记日期" width="160" align="center" editType="date" readonly="true"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true"/>
<EF:EFComboColumn ename="factoryCode" cname="工厂" blockName="factory_record_block_id"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" readonly="true" width="120" required="true"
align="center" filter="contains" sort="true">
</EF:EFComboColumn>
<EF:EFComboColumn ename="groupCode" cname="生产组" blockName="group_record_block_id"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" readonly="true" width="120" required="true"
align="center" filter="contains" sort="true">
</EF:EFComboColumn>
<EF:EFComboColumn ename="groupType" cname="生产类型"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" readonly="true" width="80" required="true"
align="center" filter="contains" sort="true">
<EF:EFCodeOption codeName="hpjx.hpjx.productionType" />
</EF:EFComboColumn>
<EF:EFColumn ename="prdtName" cname="产品" enable="false" width="160" align="center" required="true"/>
<EF:EFColumn ename="weight" cname="产量(T)" width="120" enable="false" format="{0:N3}" editType="text"
displayType="0.000" sort="true" align="right"
data-regex="/^-?[0-9]{1,16}([.][0-9]{1,3})?$/" maxLength="20" required="true"
data-errorprompt="请输入数字,该值最大可设置17位整数和3位小数!"
/>
<%--<EF:EFColumn ename="remark" cname="备注" enable="true" width="200" align="center"/>--%>
</EF:EFGrid>
<EF:EFGrid blockId="detail" autoDraw="override" toolbarConfig="{hidden:'all'}" isFloat="true" checkMode="row">
<EF:EFColumn ename="id" primaryKey="true" cname="内码" hidden="true"/>
<EF:EFColumn ename="companyCode" cname="企业编码" hidden="true"/>
<EF:EFColumn ename="registerDate" cname="登记日期" width="160" align="center" editType="date" readonly="true"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true"/>
<EF:EFComboColumn ename="factoryCode" cname="工厂" blockName="factory_record_block_id"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" readonly="true" width="120" required="true"
align="center" filter="contains" sort="true">
</EF:EFComboColumn>
<EF:EFComboColumn ename="groupCode" cname="下料组" blockName="group_record_block_id"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" readonly="true" width="120" required="true"
align="center" filter="contains" sort="true">
</EF:EFComboColumn>
<EF:EFComboColumn ename="groupType" cname="下料类型"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" readonly="true" width="80" required="true"
align="center" filter="contains" sort="true">
<EF:EFCodeOption codeName="hpjx.hpjx.productionType" />
</EF:EFComboColumn>
<EF:EFColumn ename="prdtName" cname="产品" enable="false" width="160" align="center" required="true"/>
<EF:EFColumn ename="weight" cname="产量(T)" width="120" enable="false" format="{0:N3}" editType="text"
displayType="0.000" sort="true" align="right"
data-regex="/^-?[0-9]{1,16}([.][0-9]{1,3})?$/" maxLength="20" required="true"
data-errorprompt="请输入数字,该值最大可设置17位整数和3位小数!"
/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
$(function (){
var queryBlock = __eiInfo.getBlock("inqu_status").getMappedRows();
//$(".row").children().attr("class", "col-md-3");
IPLATUI.EFGrid = {
"result": {
pageable:false,
exportGrid:false,
/*pageable: {
pageSize: 10,
pageSizes: [10, 20, 30, 50, 100, 200],
},*/
columns: [{
field: "operator",
title: "操作",
template: function (item) {
let template = '';
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="deleteRow(' + item.rowNo + ')" >删除</a>';
return template
}
},{
field: "registerDate",
attributes: {
class: "i-input-readonly"
},
defaultValue: function () {
return currShortDate();
}
}],
loadComplete: function(grid) {
// 此 grid 对象
if (queryBlock[0]["userCount"] !== undefined || queryBlock[0]["userCount"] != null){
$("#inqu_status-0-userCount").val(queryBlock[0]["userCount"]);
}else {
$("#inqu_status-0-userCount").val(0);
}
},
onSave: function (e) {
// 阻止默认请求,使用自定义保存
e.preventDefault();
let btnNode = $(this);
//禁用按钮
btnNode.attr("disabled", true);
saveResult(btnNode);
},
onSuccess: function (e) {
if (e.eiInfo.extAttr.methodName == 'update' || e.eiInfo.extAttr.methodName == 'insert') {
query();
}
},
},
"detail":{
pageable:false,
exportGrid:false,
toolbarConfig:{
hidden: false,
},
columns: [{
field: "operator",
title: "操作",
template: function (item) {
let template = '';
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="detailDeleteRow(' + item.rowNo + ')" >删除</a>';
return template
}
},{
field: "registerDate",
attributes: {
class: "i-input-readonly"
},
defaultValue: function () {
return currShortDate();
}
}],
}
}
})
/**
* 保存汇总
*/
function saveResult(btn) {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
let methodType = $("#inqu_status-0-methodType").val();
let flag = true;
$.each(rows, function(index, item) {
let prdtName= item.get("prdtName");
if(isBlank(prdtName)){
message("选中的第"+(index+1)+"行\"产品\",不能为空!");
flag = false;
return false;
}
let weight= item.get("weight");
if(isBlank(weight)){
message("选中的第"+(index+1)+"行\"产量(T)\",不能为空!");
flag = false;
return false;
}
});
if(flag) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
var info = new EiInfo();
info.set("inqu_status-0-userCount",$("#inqu_status-0-userCount").val());
info.addBlock(JSUtils.checkedRows2Block("result"));
info.addBlock(JSUtils.checkedRows2Block("detail"))
EiCommunicator.send("HPSC010", methodType, info, {
onSuccess: function (ei) {
if (ei.getStatus() >= 0) {
try {
EiCommunicator.send("HPSC096", methodType, info, {
onSuccess: function (ei) {
parent.JSColorbox.setValueCallback(ei);
parent.JSColorbox.close();
},
onFail: function (ei) {
// 发生异常
NotificationUtil("操作失败,原因[" + ei + "]", "error");
}
})
} catch (e) {
// TODO: handle exception
}
if (ei.getStatus() == 0) {
NotificationUtil(ei, 'warning');
} else {
NotificationUtil(ei);
}
} else {
NotificationUtil(ei, "error");
}
},
onFail: function (ei) {
// 发生异常
NotificationUtil("操作失败,原因[" + ei + "]", "error");
}
});
//JSUtils.submitGridsData("result", "HPSC096", methodType, true);
//释放禁用按钮
btn.attr("disabled", false);
}
});
}
}
function deleteRow(rowNo) {
resultGrid.removeRows([rowNo]);// 刷新行号
refreshRowNo();
}
let refreshRowNo = function () {
let allRows = resultGrid.getDataItems();
for (let i = 0; i < allRows.length; i++) {
resultGrid.setCellValue(i, "rowNo", i);
resultGrid.refresh();
}
}
function detailDeleteRow(rowNo) {
//detailGrid.removeRows([rowNo]);// 刷新行号
detailRefreshRowNo(rowNo);
}
let detailRefreshRowNo = function (rowNo) {
let allRows = detailGrid.getDataItems();
for (let i = 0; i < allRows.length; i++) {
if (allRows[i].rowNo == rowNo){
detailGrid.removeRows(allRows[i]);
}else {
detailGrid.setCellValue(i, "rowNo", i);
detailGrid.refresh();
}
}
}
\ No newline at end of file
<%--
Created by IntelliJ IDEA.
User: 1
Date: 2024/4/3
Time: 15:03
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="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row">
<EF:EFColumn ename="rowNo" cname="行号" hidden="true"/>
<EF:EFColumn ename="remark" cname="上级ID" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="120" align="center"/>
<EF:EFColumn ename="registerDate" cname="登记日期" width="160" align="center" editType="date" readonly="true"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true"/>
<EF:EFComboColumn ename="factoryCode" cname="工厂" blockName="factory_code_block_id"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" readonly="true" width="120" required="true"
align="center" filter="contains" sort="true">
</EF:EFComboColumn>
<EF:EFComboColumn ename="groupCode" cname="生产组" blockName="group_record_block_id"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" readonly="true" width="120" required="true"
align="center" filter="contains" sort="true">
</EF:EFComboColumn>
<EF:EFComboColumn ename="groupType" cname="生产类型"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" readonly="true" width="80" required="true"
align="center" filter="contains" sort="true">
<EF:EFCodeOption codeName="hpjx.hpjx.productionType" />
</EF:EFComboColumn>
<EF:EFColumn ename="prdtName" cname="产品" enable="true" width="160" align="center"/>
<EF:EFColumn ename="weight" cname="产量(T)" width="120" enable="true" format="{0:N3}" editType="text"
displayType="0.000" sort="true" align="right"
data-regex="/^-?[0-9]{1,16}([.][0-9]{1,3})?$/" maxLength="20"
data-errorprompt="请输入数字,该值最大可设置17位整数和3位小数!"
/>
</EF:EFGrid>
<EF:EFGrid blockId="detail" autoDraw="override" toolbarConfig="{hidden:'all'}" isFloat="true" checkMode="row">
<EF:EFColumn ename="rowNo" cname="行号" hidden="true"/>
<EF:EFColumn ename="remark" cname="上级ID" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="120" align="center"/>
<EF:EFColumn ename="registerDate" cname="登记日期" width="160" align="center" editType="date" readonly="true"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true"/>
<EF:EFComboColumn ename="factoryCode" cname="工厂" blockName="factory_code_block_id"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" readonly="true" width="120" required="true"
align="center" filter="contains" sort="true">
</EF:EFComboColumn>
<EF:EFComboColumn ename="groupCode" cname="下料组" blockName="group_record_block_id"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" readonly="true" width="120" required="true"
align="center" filter="contains" sort="true">
</EF:EFComboColumn>
<EF:EFComboColumn ename="groupType" cname="下料类型"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" readonly="true" width="80" required="true"
align="center" filter="contains" sort="true">
<EF:EFCodeOption codeName="hpjx.hpjx.productionType" />
</EF:EFComboColumn>
<EF:EFColumn ename="prdtName" cname="产品" enable="true" width="160" align="center"/>
<EF:EFColumn ename="weight" cname="产量(T)" width="120" enable="true" format="{0:N3}" editType="text"
displayType="0.000" sort="true" align="right"
data-regex="/^-?[0-9]{1,16}([.][0-9]{1,3})?$/" maxLength="20"
data-errorprompt="请输入数字,该值最大可设置17位整数和3位小数!"
/>
</EF:EFGrid>
<EF:EFRegion id="inqu">
<div class="row">
<EF:EFInput cname="用工总人数" blockId="inqu_status" ename="userCount" row="0" type="number" colWidth="5" value="0"/>
<EF:EFInput cname="" blockId="inqu_status" ename="methodType" row="0" colWidth="3" hidden="true"/>
</div>
</EF:EFRegion>
</EF:EFRegion>
</EF:EFPage>
\ No newline at end of file
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