Commit 75e83339 by 江和松

变更详情提交

parent d39b079e
......@@ -86,6 +86,7 @@ public class ServiceHGSC004A extends ServiceBase {
hgsc005a.setProductType(ProductTypeEnum.PART.getCode());
}
HGSCTools.THGSC005A.delete(hgsc005a);
HGSCTools.THGSC004B.save(hgsc004A,null);
}
}else{
DaoUtils.update(HGSC004A.BATCH_DELETE, new HashMap<String,Object>(){{put("ids",ids);}});
......@@ -132,25 +133,32 @@ public class ServiceHGSC004A extends ServiceBase {
this.checkSaveData(hgsc004a,hgsc003);
if(Objects.nonNull(hgsc004a.getId())&&hgsc004a.getId()!=0){
if(hgsc004a.getLv().intValue() == 3){
hgsc004a.setProductType(ProductTypeEnum.STRUCT.getCode().toString());
}else{
hgsc004a.setProductType(ProductTypeEnum.PART.getCode().toString());
}
//主表全部提交时需要有改变状态
if(hgsc004.getMaterialStatus().intValue() == HGConstant.MaterialStatus.QBTJ){
hgsc004a.setChangeType(HGConstant.ChangeType.TH);
if(hgsc004a.getLv().intValue() == 3){
hgsc004a.setProductType(ProductTypeEnum.STRUCT.getCode().toString());
}else{
hgsc004a.setProductType(ProductTypeEnum.PART.getCode().toString());
}
HGSC004A oldHGSC004A = (HGSC004A) super.dao.get(HGSC004A.QUERY,HGSC004A.FIELD_id,hgsc004a.getId());
HGSCTools.THGSC004B.save(oldHGSC004A,hgsc004a);
}
DaoUtils.update(HGSC004A.UPDATE, hgsc004a);
}else {
hgsc004a.setProductStatus(HGConstant.ProductStatus.WTJ);
Map<String,Object> mapA = new HashMap<>();
if(hgsc004a.getLv().intValue() == 3){
hgsc004a.setProductType(ProductTypeEnum.STRUCT.getCode().toString());
}else{
hgsc004a.setProductType(ProductTypeEnum.PART.getCode().toString());
}
//主表全部提交时需要有改变状态
if(hgsc004.getMaterialStatus().intValue() == HGConstant.MaterialStatus.QBTJ){
if(hgsc004a.getLv().intValue() == 3){
hgsc004a.setProductType(ProductTypeEnum.STRUCT.getCode().toString());
}else{
hgsc004a.setProductType(ProductTypeEnum.PART.getCode().toString());
}
hgsc004a.setChangeType(HGConstant.ChangeType.ZJ);
Long maxId = (Long) super.dao.get(HGSC004A.MAX_ID,null,null);
hgsc004a.setId(maxId+1);
HGSCTools.THGSC004B.save(null,hgsc004a);
}
DaoUtils.insert(HGSC004A.INSERT, hgsc004a);
......@@ -235,6 +243,8 @@ public class ServiceHGSC004A extends ServiceBase {
String materialId = eiBlock.getCellStr(ACConstants.ROW_CODE_0, HGSC004A.FIELD_material_id);
HGSC004 hgsc004 = (HGSC004) super.dao.get(HGSC004.QUERY_BY_ID,HGSC004.FIELD_id,materialId);
//校验计划父单据是否提交,提交了不让新增
HGSCTools.THGSC004A.checkFatherSubmitStatus(hgsc004.getId());
for (i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
hgsc004a.fromMap(map);
......@@ -250,8 +260,6 @@ public class ServiceHGSC004A extends ServiceBase {
}else{
hgsc005a.setProductType(ProductTypeEnum.PART.getCode());
}
//校验计划父单据是否提交,提交了不让新增
HGSCTools.THGSC004A.checkFatherSubmitStatus(hgsc004.getId());
HGSCTools.THGSC005A.save(hgsc005a);
}else{
Map<String,Object> mapA = new HashMap<>();
......
package com.baosight.hggp.hg.sc.service;
import com.baosight.hggp.hg.sc.domain.HGSC004B;
import com.baosight.hggp.util.*;
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;
/**
* @Author jhs
* @Date 2024/5/14 14:46
*/
public class ServiceHGSC004E extends ServiceBase {
public EiInfo initLoad(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HGSC004B.QUERY, new HGSC004B());
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
public EiInfo query(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HGSC004B.QUERY, new HGSC004B());
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
}
package com.baosight.hggp.hg.sc.tools;
import cn.hutool.core.bean.BeanUtil;
import com.baosight.hggp.common.AssignStatusEnum;
import com.baosight.hggp.common.ComputeTypeEnum;
import com.baosight.hggp.common.ProductTypeEnum;
......@@ -101,6 +102,22 @@ public class HGSCTools {
AssertUtils.isTrue(hgsc005.getCommitStatus().compareTo(CommonConstant.YesNo.NO_0)==1, "生产计划已提交,不能操作!");
}
}
public static class THGSC004B{
public static void save(HGSC004A oldHGSC004A,HGSC004A newHGSC004A) {
HGSC004B hgsc004B = new HGSC004B();
if(Objects.nonNull(oldHGSC004A)){
//变更删除存在历史信息,存历史信息
BeanUtil.copyProperties(oldHGSC004A,hgsc004B,"id");
hgsc004B.setMaterialDetailId(oldHGSC004A.getId());
}else{
//新增的存新录入的信息
BeanUtil.copyProperties(newHGSC004A,hgsc004B,"id");
hgsc004B.setMaterialDetailId(newHGSC004A.getId());
}
AssertUtils.isTrue(Objects.isNull(hgsc004B) || hgsc004B.getMaterialDetailId().intValue() == 0, "生产计划已提交,不能操作!");
DaoUtils.insert(HGSC004B.INSERT,hgsc004B);
}
}
public static class THGSC005{
public static List<HGSC005> buildFinishRate(List<HGSC005> hgsc005List){
......
......@@ -98,10 +98,13 @@ $(function () {
title: "操作",
template: function (item) {
let status = item.productStatus;
let changeType = item.changeType;
let template = '';
if (item.id){
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="showDetail(' + item.id +')" >变更详情</a>';
if(changeType != 0){
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="showDetail(' + item.id +')" >变更详情</a>';
}
if (status == 0) {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="updateProductStatus(' + item.id + ',1)" >提交</a>';
......@@ -521,6 +524,18 @@ let dynamicColumnName = function () {
}
}
/**
* 显示详情
*/
function showDetail(id) {
JSColorbox.open({
href: "HGSC004E?methodName=initLoad&inqu_status-0-materialDetailId=" + id,
title: "<div style='text-align: center;'>变更详情记录</div>",
width: "90%",
height: "90%",
});
}
function updateProductStatus(id,status) {
let inEiInfo = new EiInfo();
inEiInfo.set("result-0-id", id);
......
$(function () {
IPLATUI.EFGrid = {
"result": {
}
};
$("#ef_form_head").hide();
// 查询
$("#QUERY").on("click", query);
});
/**
* 页面加载时执行
*/
$(window).load(function () {
// 初始化查询
query();
});
/**
* 查询
*/
var query = function (e) {
resultGrid.dataSource.page(1);
}
<!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="result" title="变更详情信息">
<EF:EFGrid blockId="result" autoDraw="override" checkMode="row" isFloat="true">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="lv" cname="层级" hidden="true"/>
<EF:EFColumn enable="false" ename="parentProdCode" hidden="true" cname="上级产品编号"/>
<EF:EFColumn enable="false" ename="parentProdName" hidden="true" cname="上级产品名称"/>
<EF:EFColumn enable="false" ename="productId" hidden="true" cname="产品id"/>
<EF:EFColumn enable="false" ename="productType" hidden="true" cname="产品类型"/>
<EF:EFColumn enable="false" ename="inventType" hidden="true" cname="库存类型"/>
<EF:EFColumn ename="operator" cname="操作" width="140" enable="false" readonly="false"/>
<EF:EFComboColumn cname="变更类型" ename="changeType" width="90" align="center" enable="false" required="false">
<EF:EFCodeOption codeName="hggp.sc.changeType" />
</EF:EFComboColumn>
<EF:EFColumn ename="productCode" required="true" cname="产品编号" enable="false"/>
<EF:EFColumn ename="productName" cname="产品名称" width="120" align="center" enable="false"/>
<EF:EFColumn ename="quantity" required="true" cname="数量" enable="false" enable="false"/>
<EF:EFColumn ename="singleWeight" required="true" format="{0:N3}" cname="单重(kg)" enable="false"/>
<EF:EFColumn enable="true" required="true" format="{0:N3}" ename="totalWeight" cname="总重(kg)" enable="false"/>
<EF:EFComboColumn cname="提交状态" ename="productStatus" width="90" align="center" required="false" enable="false">
<EF:EFCodeOption codeName="hggp.sc.productStatus" />
</EF:EFComboColumn>
</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