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,8 +120,7 @@ ...@@ -156,8 +120,7 @@
</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 -->
......
...@@ -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){
...@@ -640,6 +645,22 @@ public class HGSCTools { ...@@ -640,6 +645,22 @@ public class HGSCTools {
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不能为空!");
Map paramMap = new HashMap(); Map paramMap = new HashMap();
...@@ -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,9 +1102,11 @@ public class HGSCTools { ...@@ -1080,9 +1102,11 @@ 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;
DaoUtils.update(HGSC005A.UPDATE, planInfo);
} }
return hgsc005AList.size(); return hgsc005AList.size();
} }
......
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;
}
}
...@@ -18,7 +18,8 @@ $(function () { ...@@ -18,7 +18,8 @@ $(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'
|| e.eiInfo.extAttr.methodName == 'update') {
query(); 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 + "]条数据做\"预览\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGWD001B", "add", false, JSUtils.submitGridsData("result", "HGWD001B", "add", false,
function (res) { function (res) {
if (res.status > -1) { if (res.status > -1) {
for (let i = 0; i < rows.length; i++) { for (let i = 0; i < rows.length; i++) {
let row = rows[i];
let docType = row['docType'];
if (!isBlank(docType) && docType.toLowerCase() == ".docx") {
let url = "HGWD098?inqu_status-0-docId=" + row['docId'];
window.open(url, '_blank');
} else {
window.open(downloadHref(rows[i]['docId'], true), '_blank'); window.open(downloadHref(rows[i]['docId'], true), '_blank');
} }
}
} else { } else {
message(res.msg); 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