Commit 3d867afc by liuyang

2024-10-23

1.生产订单批量派工和批量改派在班组人员增加录入功能,录入人员姓名,保存后在列表人员明细
parent decd31d5
package com.baosight.hggp.hg.sc.service;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.hg.sc.domain.HGSC007B;
import com.baosight.hggp.util.EiInfoUtils;
import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.MapUtils;
import com.baosight.hggp.util.StringUtils;
import com.baosight.hggp.util.contants.ACConstants;
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.List;
import java.util.Map;
/**
* @author LiuYang
* @version 1.0 2024/10/23
* @description
*/
public class ServiceHGSC098B extends ServiceEPBase {
@Override
public EiInfo initLoad(EiInfo inInfo) {
return inInfo;
}
@Override
public EiInfo query(EiInfo inInfo) {
/*String orderDetailIds = inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0,"orderDetailIds");
if (StringUtils.isNotEmpty(orderDetailIds)){
String[] ids = orderDetailIds.split(",");
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, "orderDetailIds", ids);
}*/
return super.query(inInfo, HGSC007B.QUERY);
}
@Override
public EiInfo delete(EiInfo inInfo) {
return super.delete(inInfo,HGSC007B.DELETE);
}
@Override
public EiInfo update(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (Map resultRow: resultRows) {
HGSC007B hgsc007B = new HGSC007B();
hgsc007B.fromMap(resultRow);
DaoUtils.update(HGSC007B.UPDATE, hgsc007B);
}
inInfo.setMsg("修改成功");
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
}catch (Exception e){
LogUtils.setDetailMsg(inInfo, e, "修改失败");
}
return inInfo;
}
@Override
public EiInfo insert(EiInfo inInfo) {
try {
Map params = EiInfoUtils.getFirstRow(inInfo);
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (Map resultRow: resultRows) {
HGSC007B hgsc007B = new HGSC007B();
hgsc007B.fromMap(resultRow);
hgsc007B.setDeleteFlag(CommonConstant.YesNo.NO_0);
hgsc007B.setOrderId(Long.parseLong(params.get("orderId").toString()));
//hgsc007B.setOrderDetailId(Long.parseLong(params.get("orderDetailId").toString()));
DaoUtils.insert(HGSC007B.INSERT, hgsc007B);
}
inInfo.setMsg("添加成功");
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
}catch (Exception e){
LogUtils.setDetailMsg(inInfo, e, "添加失败");
}
return inInfo;
}
}
......@@ -66,6 +66,9 @@
<isNotEmpty prepend=" AND " property="userName">
user_name like concat('%', #userName#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="orderDetailIds">
order_detail_id IN <iterate close=")" open="(" conjunction="," property="orderDetailIds">#orderDetailIds[]#</iterate>
</isNotEmpty>
</sql>
<sql id="orderBy">
......
......@@ -13,7 +13,7 @@ $(function () {
field: "operator",
template: function (item) {
let template = '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="showInfo(\'' + item.orderCode + '\')" >订单详情</a>';
+ 'onclick="showInfo(\'' + item.orderCode + '\',' + item.id + ')" >订单详情</a>';
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="showUploadFile(' + item.matId + ')" >附件详情</a>';
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
......@@ -44,9 +44,9 @@ $(window).load(function () {
query();
});
function showInfo(orderCode) {
function showInfo(orderCode,id) {
JSColorbox.open({
href: "HGSC006A?methodName=initLoad&inqu_status-0-orderCode=" + orderCode + "&efParentFormEname=HGSC006",
href: "HGSC006A?methodName=initLoad&inqu_status-0-orderCode=" + orderCode + "&inqu_status-0-orderId=" + id + "&efParentFormEname=HGSC006",
title: "<div style='text-align: center;'>生产订单详情</div>",
width: "90%",
height: "90%"
......
......@@ -87,7 +87,11 @@ function assign() {
if(flag) {
let companyCode = rows[0].companyCode;
JSColorbox.open({
href: "HGSC098?methodName=initLoad&inqu_status-0-companyCode=" + companyCode + "&inqu_status-0-productType=" + productType,
href: "HGSC098?methodName=initLoad" +
"&inqu_status-0-companyCode=" + companyCode +
"&inqu_status-0-orderId=" + $("#inqu_status-0-orderId").val() +
"&inqu_status-0-orderDetailIds=" + ids +
"&inqu_status-0-productType=" + productType,
title: "<div style='text-align: center;'>选择组织</div>",
width: "90%",
height: "90%",
......@@ -152,7 +156,10 @@ function assignAll() {
if(flag) {
let companyCode = rows[0].companyCode;
JSColorbox.open({
href: "HGSC098?methodName=initLoad&inqu_status-0-companyCode=" + companyCode + "&inqu_status-0-productType=" + productType,
href: "HGSC098?methodName=initLoad" +
"&inqu_status-0-companyCode=" + companyCode +
"&inqu_status-0-orderId=" + $("#inqu_status-0-orderId").val() +
"&inqu_status-0-productType=" + productType,
title: "<div style='text-align: center;'>选择组织</div>",
width: "90%",
height: "90%",
......@@ -215,7 +222,10 @@ function assignChange() {
if(flag) {
let companyCode = rows[0].companyCode;
JSColorbox.open({
href: "HGSC098?methodName=initLoad&inqu_status-0-companyCode=" + companyCode + "&inqu_status-0-productType=" + productType,
href: "HGSC098?methodName=initLoad" +
"&inqu_status-0-companyCode=" + companyCode + "" +
"&inqu_status-0-orderId=" + $("#inqu_status-0-orderId").val() +
"&inqu_status-0-productType=" + productType,
title: "<div style='text-align: center;'>改派订单</div>",
width: "90%",
height: "90%",
......@@ -287,7 +297,10 @@ function assignChangeAll() {
if(flag) {
let companyCode = rows[0].companyCode;
JSColorbox.open({
href: "HGSC098?methodName=initLoad&inqu_status-0-companyCode=" + companyCode + "&inqu_status-0-productType=" + productType,
href: "HGSC098?methodName=initLoad" +
"&inqu_status-0-companyCode=" + companyCode +
"&inqu_status-0-orderId=" + $("#inqu_status-0-orderId").val() +
"&inqu_status-0-productType=" + productType,
title: "<div style='text-align: center;'>改派订单</div>",
width: "90%",
height: "90%",
......
......@@ -14,6 +14,7 @@
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<EF:EFInput ename="inqu_status-0-orderCode" cname="订单编码" type="hidden"/>
<EF:EFInput ename="inqu_status-0-orderId" cname="订单编码" type="hidden"/>
<EF:EFInput ename="inqu_status-0-productCode" cname="产品编码" placeholder="模糊查询" colWidth="3"/>
<EF:EFInput ename="inqu_status-0-productName" cname="产品名称" placeholder="模糊查询" colWidth="3"/>
<EF:EFInput ename="inqu_status-0-projName" cname="项目名称" placeholder="模糊查询" colWidth="3"/>
......
......@@ -231,7 +231,7 @@ let saveResult = function (btnNode) {
flag = false;
return false;
}
if (!isPositiveInteger(pcsWeight)) {
if (isBlank(pcsWeight) || !isNumber(pcsWeight) || pcsWeight <= 0) {
message("勾选的第" + (index + 1) + "行加工重量必须是大于0");
flag = false;
return false;
......@@ -274,6 +274,16 @@ let saveDetail = function (btnNode) {
flag = false;
return false;
}
if (!isPositiveInteger(item.pcsQty)) {
message("勾选的第" + (index + 1) + "行加工数量必须是大于0");
flag = false;
return false;
}
if (isBlank(item.pcsWeight) || !isNumber(item.pcsWeight) || item.pcsWeight <= 0) {
message("勾选的第" + (index + 1) + "行加工重量必须是大于0");
flag = false;
return false;
}
});
if (flag) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
......
......@@ -15,8 +15,11 @@ $(function () {
title: "班组人员",
template: function (item) {
if (!isBlank(item.groupCode)){
return '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
let template = '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="showGroupUser(\''+ item.groupCode + '\')" >查看</a>';
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="addGroupUser(\''+ item.factoryCode + '\',\''+ item.factoryName + '\',\''+ item.groupCode + '\',\''+ item.groupName + '\')" >添加人员</a>';
return template;
}else {
message("未选择班组")
return "";
......@@ -68,4 +71,19 @@ function showGroupUser(id) {
width: "90%",
height: "90%",
});
}
/*"&inqu_status-0-orderDetailIds=" + $("#inqu_status-0-orderDetailIds").val() + "" +*/
function addGroupUser(factoryCode,factoryName,groupCode,groupName) {
JSColorbox.open({
href: "HGSC098B?methodName=initLoad" +
"&inqu_status-0-factoryCode=" + factoryCode + "" +
"&inqu_status-0-factoryName=" + factoryName + "" +
"&inqu_status-0-orderId=" + $("#inqu_status-0-orderId").val() + "" +
"&inqu_status-0-groupCode=" + groupCode + "" +
"&inqu_status-0-groupName=" + groupName + "&efParentFormEname=HGSC098",
title: "<div style='text-align: center;'>添加班组人员</div>",
width: "90%",
height: "90%",
})
}
\ No newline at end of file
......@@ -8,6 +8,8 @@
<EF:EFPage title="组织机构">
<EF:EFRegion id="inqu" title="查询条件">
<EF:EFInput cname="公司编码" ename="companyCode" blockId="inqu_status" row="0" type="hidden"/>
<EF:EFInput cname="订单Id" ename="orderId" blockId="inqu_status" row="0" type="hidden"/>
<EF:EFInput cname="任务详情ID" ename="orderDetailIds" blockId="inqu_status" row="0" type="hidden"/>
<EF:EFInput cname="产品类型" ename="productType" blockId="inqu_status" row="0" type="hidden"/>
<div class="row">
<EF:EFSelect ename="inqu_status-0-factoryCode" cname="工厂" colWidth="4" filter="contains"
......
$(function () {
IPLATUI.EFGrid.result = {
pageable: {
pageSize: 10,
pageSizes: [10, 20, 50, 100, 200],
},
onAdd: function (e) {
$.each(e.items, function (index, item) {
item['factoryCode'] = $("#inqu_status-0-factoryCode").val();
item['factoryName'] = $("#inqu_status-0-factoryName").val();
item['groupCode'] = $("#inqu_status-0-groupCode").val();
item['groupName'] = $("#inqu_status-0-groupName").val();
});
},
columns: []
}
// 查询
$("#QUERY").on("click", query);
});
/**
* 初始化
*/
$(window).load(function () {
// 查询
query();
});
/**
* 查询
*/
function query() {
resultGrid.dataSource.page(1);
}
\ No newline at end of file
<%--
Created by IntelliJ IDEA.
User: 1
Date: 2024/10/23
Time: 10:59
To change this template use File | Settings | File Templates.
--%>
<!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="查询条件">
<EF:EFInput ename="orderId" cname="生产订单编号" blockId="inqu_status" row="0" type="hidden"/>
<%--<EF:EFInput ename="orderDetailIds" cname="生产订单ID" blockId="inqu_status" row="0" type="hidden"/>--%>
<div class="row">
<EF:EFInput ename="factoryCode" cname="工厂编码" blockId="inqu_status" row="0" colWidth="3" type="hidden"/>
<EF:EFInput ename="factoryName" cname="工厂名称" blockId="inqu_status" row="0" colWidth="3" type="hidden"/>
<EF:EFInput ename="groupCode" cname="班组编码" blockId="inqu_status" row="0" colWidth="3" type="hidden"/>
<EF:EFInput ename="groupName" cname="班组名称" blockId="inqu_status" row="0" colWidth="3" type="hidden"/>
<EF:EFInput ename="userName" cname="人员姓名" blockId="inqu_status" row="0" colWidth="3"/>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="数据集" fitHeight="true">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" autoBind="false">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="factoryCode" cname="工厂编码" enable="false" width="120" align="center"/>
<EF:EFColumn ename="factoryName" cname="工厂名称" enable="false" width="120" align="center"/>
<EF:EFColumn ename="groupCode" cname="班组编码" enable="false" width="120" align="center"/>
<EF:EFColumn ename="groupName" cname="班组名称" enable="false" width="120" align="center"/>
<EF:EFColumn ename="userName" cname="人员名称" enable="true" width="120" align="center"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
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