Commit 308869c9 by 宋祥

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

parents 3154428c 9daa8b3e
...@@ -119,10 +119,11 @@ public class ServiceHGSC005A extends ServiceBase { ...@@ -119,10 +119,11 @@ public class ServiceHGSC005A extends ServiceBase {
public EiInfo schedule(EiInfo inInfo) { public EiInfo schedule(EiInfo inInfo) {
try { try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo); Map queryMap = EiInfoUtils.getFirstRow(inInfo);
String processName = MapUtils.getString(queryMap, "processName");
String planCode = MapUtils.getString(queryMap, "planCode"); String planCode = MapUtils.getString(queryMap, "planCode");
HGSC005 dbSc005 = HGSCTools.THGSC005.queryByPlanCode(planCode); HGSC005 dbSc005 = HGSCTools.THGSC005.queryByPlanCode(planCode);
this.checkScheduleData(dbSc005); this.checkScheduleData(dbSc005);
int count = HGSCTools.THGSC005A.schedule(planCode); int count = HGSCTools.THGSC005A.schedule(planCode, processName);
dbSc005.setIsSchedule(CommonConstant.YesNo.YES_1); dbSc005.setIsSchedule(CommonConstant.YesNo.YES_1);
DaoUtils.update(HGSC005.UPDATE, dbSc005); DaoUtils.update(HGSC005.UPDATE, dbSc005);
inInfo = this.query(inInfo); inInfo = this.query(inInfo);
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN" "http://ibatis.apache.org/dtd/sql-map-2.dtd"> <!-- table information <!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://www.ibatis.com/dtd/sql-map-2.dtd">
Generate time : 2024-05-17 17:15:03
Version : 1.0
schema : hggp
tableName : HGSC005A
id BIGINT NOT NULL primarykey,
mat_id BIGINT NOT NULL,
mat_detail_id BIGINT NOT NULL,
tech_flow_id BIGINT,
tech_flow_name BIGINT,
invent_process_id BIGINT,
process_name VARCHAR,
company_code VARCHAR NOT NULL,
company_name VARCHAR NOT NULL,
dep_code VARCHAR,
dep_name VARCHAR,
proj_code VARCHAR,
proj_name VARCHAR,
plan_code VARCHAR,
product_type TINYINT,
product_code VARCHAR,
product_name VARCHAR,
finish_date VARCHAR,
plan_start_date VARCHAR,
plan_end_date VARCHAR,
quantity TINYINT,
finish_quantity TINYINT,
unfinish_quantity TINYINT,
account_code VARCHAR NOT NULL,
created_by VARCHAR,
created_name VARCHAR,
created_time VARCHAR,
updated_by VARCHAR,
updated_name VARCHAR,
updated_time VARCHAR
-->
<sqlMap namespace="HGSC005A"> <sqlMap namespace="HGSC005A">
<sql id="condition"> <sql id="condition">
<!--<include refid="HGXSDataAuth.authCondition"/>--> <!--<include refid="HGXSDataAuth.authCondition"/>-->
<isNotEmpty prepend=" AND " property="id"> <isNotEmpty prepend=" AND " property="id">
id = #id# id = #id#
</isNotEmpty> </isNotEmpty>
...@@ -156,46 +120,45 @@ ...@@ -156,46 +120,45 @@
</isNotEmpty> </isNotEmpty>
</sql> </sql>
<select id="query" parameterClass="java.util.HashMap" <select id="query" resultClass="com.baosight.hggp.hg.sc.domain.HGSC005A">
resultClass="com.baosight.hggp.hg.sc.domain.HGSC005A"> SELECT
SELECT id as "id",
id as "id", mat_id as "matId", <!-- 物料清单ID -->
mat_id as "matId", <!-- 物料清单ID --> mat_detail_id as "matDetailId", <!-- 物料清单明细ID -->
mat_detail_id as "matDetailId", <!-- 物料清单明细ID --> tech_flow_id as "techFlowId", <!-- 工艺流程ID -->
tech_flow_id as "techFlowId", <!-- 工艺流程ID --> tech_flow_name as "techFlowName", <!-- 工艺流程名称 -->
tech_flow_name as "techFlowName", <!-- 工艺流程名称 --> invent_process_id as "inventProcessId", <!-- 存货工序ID,对应HGPZ005A.id -->
invent_process_id as "inventProcessId", <!-- 存货工序ID,对应HGPZ005A.id --> process_code as "processCode", <!-- 工序编码 -->
process_code as "processCode", <!-- 工序编码 --> process_name as "processName", <!-- 工序名称 -->
process_name as "processName", <!-- 工序名称 --> company_code as "companyCode", <!-- 公司编码 -->
company_code as "companyCode", <!-- 公司编码 --> process_order as "processOrder", <!-- 加工顺序 -->
process_order as "processOrder", <!-- 加工顺序 --> company_name as "companyName", <!-- 公司名称 -->
company_name as "companyName", <!-- 公司名称 --> dep_code as "depCode", <!-- 部门编码 -->
dep_code as "depCode", <!-- 部门编码 --> dep_name as "depName", <!-- 部门名称 -->
dep_name as "depName", <!-- 部门名称 --> proj_code as "projCode", <!-- 项目编码 -->
proj_code as "projCode", <!-- 项目编码 --> proj_name as "projName", <!-- 项目名称 -->
proj_name as "projName", <!-- 项目名称 --> plan_code as "planCode", <!-- 计划编码 -->
plan_code as "planCode", <!-- 计划编码 --> product_type as "productType", <!-- 产品类型 -->
product_type as "productType", <!-- 产品类型 --> product_code as "productCode", <!-- 产品编号 -->
product_code as "productCode", <!-- 产品编号 --> product_name as "productName", <!-- 产品名称 -->
product_name as "productName", <!-- 产品名称 --> finish_date as "finishDate", <!-- 完工日期 -->
finish_date as "finishDate", <!-- 完工日期 --> plan_start_date as "planStartDate", <!-- 计划开始日期 -->
plan_start_date as "planStartDate", <!-- 计划开始日期 --> plan_end_date as "planEndDate", <!-- 计划结束日期 -->
plan_end_date as "planEndDate", <!-- 计划结束日期 --> quantity as "quantity", <!-- 数量 -->
quantity as "quantity", <!-- 数量 --> finish_quantity as "finishQuantity", <!-- 完工数量 -->
finish_quantity as "finishQuantity", <!-- 完工数量 --> unfinish_quantity as "unfinishQuantity", <!-- 未完工数量 -->
unfinish_quantity as "unfinishQuantity", <!-- 未完工数量 --> single_weight as "singleWeight", <!-- 单重 -->
single_weight as "singleWeight", <!-- 单重 --> total_weight as "totalWeight", <!-- 总重 -->
total_weight as "totalWeight", <!-- 总重 --> finish_weight as "finishWeight", <!-- 完工重量 -->
finish_weight as "finishWeight", <!-- 完工重量 --> unfinish_weight as "unfinishWeight", <!-- 未完工重量 -->
unfinish_weight as "unfinishWeight", <!-- 未完工重量 --> account_code as "accountCode", <!-- 帐套 -->
account_code as "accountCode", <!-- 帐套 --> created_by as "createdBy", <!-- 创建人 -->
created_by as "createdBy", <!-- 创建人 --> created_name as "createdName", <!-- 创建人名称 -->
created_name as "createdName", <!-- 创建人名称 --> created_time as "createdTime", <!-- 创建时间 -->
created_time as "createdTime", <!-- 创建时间 --> updated_by as "updatedBy", <!-- 更新人 -->
updated_by as "updatedBy", <!-- 更新人 --> updated_name as "updatedName", <!-- 修改人名称 -->
updated_name as "updatedName", <!-- 修改人名称 --> updated_time as "updatedTime" <!-- 更新时间 -->
updated_time as "updatedTime" <!-- 更新时间 --> FROM ${hggpSchema}.HGSC005A WHERE 1=1
FROM ${hggpSchema}.HGSC005A WHERE 1=1
<include refid="condition" /> <include refid="condition" />
<dynamic prepend="ORDER BY"> <dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy"> <isNotEmpty property="orderBy">
......
...@@ -615,6 +615,11 @@ public class HGSCTools { ...@@ -615,6 +615,11 @@ public class HGSCTools {
} }
} }
/**
*
* @author:songx
* @date:2024/9/4,22:02
*/
public static class THGSC005A{ public static class THGSC005A{
public static HGSC005A getById(Long id){ public static HGSC005A getById(Long id){
...@@ -639,6 +644,22 @@ public class HGSCTools { ...@@ -639,6 +644,22 @@ public class HGSCTools {
List<HGSC005A> results = DaoBase.getInstance().query(HGSC005A.QUERY, paramMap); List<HGSC005A> results = DaoBase.getInstance().query(HGSC005A.QUERY, paramMap);
return CollectionUtils.isEmpty(results) ? null : results; return CollectionUtils.isEmpty(results) ? null : results;
} }
/**
* 根据工序查询
*
* @param planCode
* @param processName
* @return
*/
public static List<HGSC005A> queryByPlanCode(String planCode, String processName) {
AssertUtils.isEmpty(planCode, "计划编码不能为空!");
Map paramMap = new HashMap();
paramMap.put(HGSC005A.FIELD_plan_code, planCode);
paramMap.put(HGSC005A.FIELD_process_name, processName);
List<HGSC005A> results = DaoBase.getInstance().query(HGSC005A.QUERY, paramMap);
return CollectionUtils.isEmpty(results) ? null : results;
}
public static List<HGSC005A> queryByMatId(Long matId){ public static List<HGSC005A> queryByMatId(Long matId){
AssertUtils.isTrue(Objects.isNull(matId)||matId<=0, "物料清单ID不能为空!"); AssertUtils.isTrue(Objects.isNull(matId)||matId<=0, "物料清单ID不能为空!");
...@@ -1039,10 +1060,11 @@ public class HGSCTools { ...@@ -1039,10 +1060,11 @@ public class HGSCTools {
* 排产 * 排产
* *
* @param planCode * @param planCode
* @param processName 工序
* @return * @return
*/ */
public static int schedule(String planCode) { public static int schedule(String planCode, String processName) {
List<HGSC005A> hgsc005AList = queryByPlanCode(planCode); List<HGSC005A> hgsc005AList = queryByPlanCode(planCode, processName);
// hgsc005AList.sort(Comparator.comparing(HGSC005A::getProductType).thenComparing(HGSC005A::getProcessOrder,Comparator.reverseOrder())); // hgsc005AList.sort(Comparator.comparing(HGSC005A::getProductType).thenComparing(HGSC005A::getProcessOrder,Comparator.reverseOrder()));
//通过工序编码查询工序设置 //通过工序编码查询工序设置
List<String> processCodes = hgsc005AList.stream().map(HGSC005A::getProcessCode) List<String> processCodes = hgsc005AList.stream().map(HGSC005A::getProcessCode)
...@@ -1080,12 +1102,14 @@ public class HGSCTools { ...@@ -1080,12 +1102,14 @@ public class HGSCTools {
} }
} }
for (HGSC005A planInfo : partList) { for (HGSC005A planInfo : partList) {
remainder = calculateWordHour(planInfo,hgsj001List,hgpz005List,hgpz005AList,minDate,remainder); remainder = calculateWordHour(planInfo, hgsj001List, hgpz005List, hgpz005AList, minDate, remainder);
minDate = DateUtil.toDate(planInfo.getPlanStartDate(),DateUtil.DATE10_PATTERN).compareTo(DateUtil.toDate(minDate,DateUtil.DATE10_PATTERN)) <=0?planInfo.getPlanStartDate():minDate; minDate = DateUtil.toDate(planInfo.getPlanStartDate(), DateUtil.DATE10_PATTERN)
DaoUtils.update(HGSC005A.UPDATE,planInfo); .compareTo(DateUtil.toDate(minDate, DateUtil.DATE10_PATTERN)) <= 0 ? planInfo.getPlanStartDate()
} : minDate;
return hgsc005AList.size(); DaoUtils.update(HGSC005A.UPDATE, planInfo);
} }
return hgsc005AList.size();
}
private static String handleEndDate(String endDate ,HGSC005A planInfo){ private static String handleEndDate(String endDate ,HGSC005A planInfo){
if(StringUtils.isBlank(endDate)&&StringUtils.isNotBlank(planInfo.getFinishDate())){ if(StringUtils.isBlank(endDate)&&StringUtils.isNotBlank(planInfo.getFinishDate())){
......
package com.baosight.hggp.hg.wd.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.util.LogUtils;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
/**
* word预览
*
* @author:songx
* @date:2024/9/4,15:22
*/
public class ServiceHGWD098 extends ServiceEPBase {
/**
* 画面初始化
*
* @param inInfo
* @return
*/
@Override
@OperationLogAnnotation(operModul = "word预览", operType = "查询", operDesc = "初始化")
public EiInfo initLoad(EiInfo inInfo) {
try {
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
}
...@@ -17,11 +17,12 @@ $(function () { ...@@ -17,11 +17,12 @@ $(function () {
//排产 //排产
$("#BNT_SCHEDULE").on("click", schedule); $("#BNT_SCHEDULE").on("click", schedule);
}, },
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(); || e.eiInfo.extAttr.methodName == 'update') {
} query();
} }
}
} }
}); });
...@@ -41,28 +42,9 @@ $(window).load(function () { ...@@ -41,28 +42,9 @@ $(window).load(function () {
* 排产 * 排产
*/ */
function schedule() { function schedule() {
var planCode = $("#inqu_status-0-planCode").val(); JSUtils.confirm("自动排产将覆盖原排产数据,请谨慎操作,确认对当前数据进行排产? ", {
IPLAT.confirm({ ok: function () {
title: '提交', JSUtils.submitGridsData("result", "HGSC005A", "schedule", true);
message: '自动排产将覆盖原排产数据,请谨慎操作,确认对当前数据进行排产?',
okFn: function () {
var inInfo = new EiInfo();
inInfo.set("inqu_status-0-planCode", planCode);
EiCommunicator.send("HGSC005A", "schedule", inInfo, {
onSuccess: function (ei) {
if (ei.getStatus() >= 0) {
$("#inqu_status-0-isSchedule").val('1');
NotificationUtil(ei);
resultGrid.dataSource.query();
} else {
NotificationUtil(ei, "error");
}
},
onFail: function (ei) {
// 发生异常
NotificationUtil("操作失败,原因[" + ei + "]", "error");
}
});
} }
}); });
} }
...@@ -263,21 +263,24 @@ let preview = function () { ...@@ -263,21 +263,24 @@ let preview = function () {
message("请选择数据"); message("请选择数据");
return; return;
} }
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"预览\"操作? ", { JSUtils.submitGridsData("result", "HGWD001B", "add", false,
ok: function () { function (res) {
JSUtils.submitGridsData("result", "HGWD001B", "add", false, if (res.status > -1) {
function (res) { for (let i = 0; i < rows.length; i++) {
if (res.status > -1) { let row = rows[i];
for (let i = 0; i < rows.length; i++) { let docType = row['docType'];
window.open(downloadHref(rows[i]['docId'], true), '_blank'); if (!isBlank(docType) && docType.toLowerCase() == ".docx") {
} let url = "HGWD098?inqu_status-0-docId=" + row['docId'];
window.open(url, '_blank');
} else { } else {
message(res.msg); window.open(downloadHref(rows[i]['docId'], true), '_blank');
} }
} }
); } else {
message(res.msg);
}
} }
}); );
} }
/** /**
......
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
</EF:EFRegion> </EF:EFRegion>
<EF:EFRegion id="result" title="明细信息"> <EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" queryMethod="query" sort="setted"> <EF:EFGrid blockId="result" autoDraw="override" queryMethod="query" sort="setted" checkMode="row">
<EF:EFColumn ename="id" cname="ID" hidden="true"/> <EF:EFColumn ename="id" cname="ID" hidden="true"/>
<EF:EFColumn ename="fileId" cname="ID" hidden="true"/> <EF:EFColumn ename="fileId" cname="ID" hidden="true"/>
<EF:EFColumn ename="docId" cname="文件ID" enable="false" width="200" align="center" sort="false" <EF:EFColumn ename="docId" cname="文件ID" enable="false" width="200" align="center" sort="false"
......
$(document).ready(function () {
let docId = $("#inqu_status-0-docId").val();
if (isBlank(docId)) {
message("文件ID不能为空");
return;
}
fetch(downloadHref(docId, true)).then(res => {
return res.arrayBuffer();
}).then(arrayBuffer => {
renderDocx(arrayBuffer);
});
});
/**
* 渲染word
*
* @param file
*/
function renderDocx(file) {
docx.renderAsync(file, document.getElementById("docx-container")).then((x) => {
console.log("docx: finished")
});
}
<!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}"/>
<script src="${ctx}/common/docxjs/jszip.min.js"></script>
<script src="${ctx}/common/docxjs/docx-preview.js"></script>
<EF:EFPage title="WORD预览">
<EF:EFRegion id="result" title="展示区域" fitHeight="true">
<EF:EFInput cname="文件ID" ename="docId" blockId="inqu_status" row="0" type="hidden"/>
<div id="docx-container"></div>
</EF:EFRegion>
</EF:EFPage>
This source diff could not be displayed because it is too large. You can view the blob instead.
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