Commit 5c3b17c2 by 宋祥

Merge branch 'dev' of http://129.211.46.84:8800/platform/hg-smart into master-dc

parents 398708f9 55530798
......@@ -98,7 +98,7 @@
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
ID DESC
AFTER_SALE_DATE ASC
</isEmpty>
</dynamic>
</sql>
......
......@@ -25,7 +25,6 @@ import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.DateUtils;
import com.baosight.hggp.util.EiInfoUtils;
import com.baosight.hggp.util.ErrorCodeUtils;
import com.baosight.hggp.util.ExcelUtils;
import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.ObjectUtils;
......@@ -42,11 +41,7 @@ import com.baosight.iplat4j.ed.util.SequenceGenerator;
import org.apache.commons.collections.MapUtils;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
/**
* @author LiuYang
......@@ -307,11 +302,7 @@ public class ServiceHGKC005 extends ServiceEPBase {
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;
LogUtils.setMsg(inInfo, e, "提交失败");
}
return inInfo;
}
......@@ -374,6 +365,9 @@ public class ServiceHGKC005 extends ServiceEPBase {
hgkc006.setSource(InventorySource.INVENTORY.getCode());
hgkc006.setSubmitStatus(HGConstant.ProductStatus.WTJ);
hgkc006.setSourceCode(hgkc005.getCheckNo());
AssertUtils.isTrue(Objects.isNull(hgkc006.getSource()) || hgkc006.getSource() <= 0, "其它入库单数据来源不能为空!");
AssertUtils.isTrue(StringUtils.isBlank(hgkc006.getWhCode()), "其它入库单仓库不能为空!");
DaoUtils.insert(HGKC006.INSERT, hgkc006);
//明细数据处理
HGKC006A hgkc006A = new HGKC006A();
hgkc006A.setPrimaryId(hgkc006.getId());
......@@ -396,9 +390,10 @@ public class ServiceHGKC005 extends ServiceEPBase {
hgkc006A.setPrdtSpec(hgpz005.getSpec());
hgkc006A.setSource(InventorySource.INVENTORY.getCode());
hgkc006A.setInventTypeDetail(hgpz005.getInventTypeDetail());
hgkc006.getDetailList().add(hgkc006A);
HGKCTools.HgKc006.generateHgkc006(hgkc006);
HGKCTools.HgKc006.checkData(hgkc006A);
DaoUtils.insert(HGKC006A.INSERT, hgkc006A);
//hgkc006.getDetailList().add(hgkc006A);
//HGKCTools.HgKc006.generateHgkc006(hgkc006);
}
}
......
......@@ -8,17 +8,21 @@ import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.core.tools.Iplat4jTools;
import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.cw.tools.HGCWTools;
import com.baosight.hggp.hg.kc.domain.*;
import com.baosight.hggp.hg.kc.domain.HGKC006;
import com.baosight.hggp.hg.kc.domain.HGKC006A;
import com.baosight.hggp.hg.kc.tools.HGKCTools;
import com.baosight.hggp.hg.kc.utils.HGKCUtils;
import com.baosight.hggp.hg.xs.domain.Company;
import com.baosight.hggp.hg.xs.tools.HGXSTools;
import com.baosight.hggp.hg.xs.utils.HGXSUtils;
import com.baosight.hggp.hg.yx.domain.HGYX001;
import com.baosight.hggp.util.*;
import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.DateUtils;
import com.baosight.hggp.util.EiInfoUtils;
import com.baosight.hggp.util.ExcelUtils;
import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.contants.ACConstants;
import com.baosight.iplat4j.core.ei.EiBlock;
import com.baosight.iplat4j.core.ei.EiConstant;
......@@ -26,9 +30,13 @@ import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.service.impl.ServiceBase;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import org.springframework.util.CollectionUtils;
import java.util.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
/**
* 其他入库单
......@@ -177,28 +185,22 @@ public class ServiceHGKC006 extends ServiceBase {
hgkc006 = HGKCTools.HgKc006.getById(hgkc006.getId());
//查看是否能获取到账期,获取不到就提示
HGCWTools.HgCw001.getAccountPeriod(hgkc006.getCompanyCode(),hgkc006.getOtherEnterDate());
HGCWTools.HgCw001.getAccountPeriod(hgkc006.getCompanyCode(), hgkc006.getOtherEnterDate());
hgkc006.setSubmitStatus(HGConstant.SubmitStatus.S1);
DaoUtils.update(HGKC006.CHECK, hgkc006.toMap());
}
List<HGKC006A> hgkc006AList = HGKCTools.HgKc006A.getHgkc006aList(hgkc006.getId());
AssertUtils.isEmpty(hgkc006AList, "没有明细信息无法提交");
if(!CollectionUtils.isEmpty(hgkc006AList)){
for(HGKC006A hgkc006A : hgkc006AList){
//增加库存
HGKCUtils.HgKc010.updateInv(hgkc006A.getCompanyCode(),hgkc006A.getWhCode(),
hgkc006A.getInventCode(),hgkc006A.getInvQty(),
hgkc006A.getInvUnitWeight(),hgkc006A.getInvWeight());
}
for (HGKC006A hgkc006A : hgkc006AList) {
//增加库存
HGKCUtils.HgKc010.updateInv(hgkc006A.getCompanyCode(), hgkc006A.getWhCode(),
hgkc006A.getInventCode(), hgkc006A.getInvQty(),
hgkc006A.getInvUnitWeight(), hgkc006A.getInvWeight());
}
eiInfo.setStatus(EiConstant.STATUS_SUCCESS);
eiInfo.setMsg("提交成功!");
} catch (PlatException e) {
//eiInfo.setStatus(EiConstant.STATUS_FAILURE);
//eiInfo.setMsg("提交失败,原因参见详细错误描述!");
//eiInfo.setDetailMsg(e.getMessage());
LogUtils.setDetailMsg(eiInfo, e, "提交失败");
//logError("提交失败!", e.getMessage());
return eiInfo;
}
return eiInfo;
}
......
......@@ -268,7 +268,7 @@
-->
<insert id="insert">
INSERT INTO ${hggpSchema}.HGKC013A (ID, <!-- ID -->
INSERT INTO ${hggpSchema}.HGKC013A (
ACCOUNT_CODE, <!-- 企业编码 -->
DEP_CODE, <!-- 部门编码 -->
CREATED_BY, <!-- 记录创建者 -->
......@@ -296,7 +296,7 @@
PARENT_ID, <!-- 调度单ID -->
INVENT_TYPE_DETAIL
)
VALUES (#id#, #accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#,
VALUES (#accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#,
#updatedTime#, #deleteFlag#, #calloutWhCode#, #calloutWhName#, #callinWhCode#, #callinWhName#, #inventRecordId#,
#inventType#, #inventCode#, #inventName#, #spec#, #length#, #width#, #thick#, #quantity#, #unitWeight#,
#weight#, #parentId#,#inventTypeDetail#)
......
......@@ -818,23 +818,37 @@ public class HGKCTools {
public static void generateHgkc006(HGKC006 hgkc006) {
checkData(hgkc006);
DaoUtils.insert(HGKC006.INSERT, hgkc006);
checkDetailData(hgkc006);
DaoUtils.insertBatch(HGKC006A.INSERT, hgkc006.getDetailList());
}
private static void checkData(HGKC006 hgkc006) {
AssertUtils.isEmpty(hgkc006.getDetailList(), "其它入库单明细不能为空");
AssertUtils.isTrue(Objects.isNull(hgkc006.getId()) || hgkc006.getId() <= 0, "其它入库单ID不能为空!");
AssertUtils.isTrue(Objects.isNull(hgkc006.getSource()) || hgkc006.getSource() <= 0, "其它入库单数据来源不能为空!");
AssertUtils.isTrue(StringUtils.isBlank(hgkc006.getWhCode()), "其它入库单仓库不能为空!");
}
private static void checkDetailData(HGKC006 hgkc006) {
AssertUtils.isTrue(Objects.isNull(hgkc006.getId()) || hgkc006.getId() <= 0, "其它入库单ID不能为空!");
hgkc006.getDetailList().forEach(o -> {
o.setPrimaryId(hgkc006.getId());
AssertUtils.isTrue(StringUtils.isBlank(o.getWhCode()), "其它入库单明细仓库不能为空!");
AssertUtils.isTrue(StringUtils.isBlank(o.getInventCode()), "其它入库单明细存货编码不能为空!");
AssertUtils.isTrue(StringUtils.isBlank(o.getInventName()), "其它入库单明细存货名称不能为空!");
AssertUtils.isTrue(o.getInvQty().compareTo(BigDecimal.ZERO) <= 0, "其它入库单明细数量不能小于等于0!");
AssertUtils.isTrue(o.getInvUnitWeight().compareTo(BigDecimal.ZERO) <= 0, "其它入库单明细单重小于等于0!");
AssertUtils.isTrue(o.getInvWeight().compareTo(BigDecimal.ZERO) <= 0, "其它入库单明细总重小于等于0!");
// AssertUtils.isTrue(o.getInvUnitWeight().compareTo(BigDecimal.ZERO) <= 0, "其它入库单明细单重小于等于0!");
// AssertUtils.isTrue(o.getInvWeight().compareTo(BigDecimal.ZERO) <= 0, "其它入库单明细总重小于等于0!");
});
}
public static void checkData(HGKC006A hgkc006a) {
AssertUtils.isTrue(StringUtils.isBlank(hgkc006a.getWhCode()), "其它入库单明细仓库不能为空!");
AssertUtils.isTrue(StringUtils.isBlank(hgkc006a.getInventCode()), "其它入库单明细存货编码不能为空!");
AssertUtils.isTrue(StringUtils.isBlank(hgkc006a.getInventName()), "其它入库单明细存货名称不能为空!");
AssertUtils.isTrue(hgkc006a.getInvQty().compareTo(BigDecimal.ZERO) <= 0, "其它入库单明细数量不能小于等于0!");
AssertUtils.isTrue(hgkc006a.getInvUnitWeight().compareTo(BigDecimal.ZERO) <= 0, "其它入库单明细单重小于等于0!");
AssertUtils.isTrue(hgkc006a.getInvWeight().compareTo(BigDecimal.ZERO) <= 0, "其它入库单明细总重小于等于0!");
}
}
public static class HgKc006A {
......
......@@ -11,15 +11,13 @@ import com.baosight.hggp.hg.pz.domain.HGPZ004;
import com.baosight.hggp.hg.pz.domain.HGPZ005;
import com.baosight.hggp.hg.pz.domain.HGPZ005A;
import com.baosight.hggp.hg.pz.tools.HGPZTools;
import com.baosight.hggp.hg.sc.domain.HGSC005A;
import com.baosight.hggp.hg.sc.tools.HGSCTools;
import com.baosight.hggp.hg.sj.domain.HGSJ002;
import com.baosight.hggp.hg.sj.domain.HGSJ002A;
import com.baosight.hggp.hg.sj.tools.HGSJTools;
import com.baosight.hggp.hg.xs.tools.HGXSTools;
import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.EiInfoUtils;
import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.StringUtils;
import com.baosight.hggp.util.*;
import com.baosight.hggp.util.contants.ACConstants;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
......@@ -27,11 +25,7 @@ import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.service.impl.ServiceBase;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
/**
* 存货档案
......@@ -228,6 +222,8 @@ public class ServiceHGPZ005 extends ServiceBase {
public EiInfo delete(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
List<String> inventCodes = ObjectUtils.listKey(resultRows, HGPZ005.FIELD_INVENT_CODE);
List<HGSC005A> hgsc005AList = HGSCTools.THGSC005A.queryByProductCodes(inventCodes);
for (Map resultRow : resultRows) {
HGPZ005 hgpz005 = new HGPZ005();
hgpz005.fromMap(resultRow);
......@@ -236,6 +232,8 @@ public class ServiceHGPZ005 extends ServiceBase {
if (count > 0) {
// throw new PlatException(String.format("企业[%s]已关联用户,请先解除用户", hgpz005.getAccountName()));
}
Long num = Optional.ofNullable(hgsc005AList).orElse(new ArrayList<>()).stream().filter(hgsc005A -> hgsc005A.getProductCode().equals(hgpz005.getInventCode())).count();
AssertUtils.isTrue(num > 0, String.format("存货[%s]已关联生产任务,无法删除", hgpz005.getInventName()));
DaoUtils.update(HGPZ005.DELETE, hgpz005);
}
inInfo = this.query(inInfo);
......
......@@ -6,6 +6,7 @@ import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.core.dao.DaoBase;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.extapp.decheng.api.SbOpenApi;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.pz.domain.HGPZ009;
import com.baosight.hggp.hg.sb.domain.HGSB010;
import com.baosight.hggp.hg.xs.domain.User;
......@@ -69,7 +70,7 @@ public class ServiceHGSB010 extends ServiceEPBase {
if (params.containsKey("date")){
params.put("date", DateUtils.formatShort(params.get("date")));
}
params.put("logValues", Arrays.asList("1", "2", "4"));
params.put("logValues", Arrays.asList("1", "2", "3", "4"));
List<Map> result = new ArrayList<>();
List<Map> listMap = DaoBase.getInstance().query("HGSB010.queryBySbYes", params, 0,100);
List listMap2 = listMap.stream().map(map -> map.get("date")).sorted().distinct().collect(Collectors.toList());
......@@ -102,7 +103,7 @@ public class ServiceHGSB010 extends ServiceEPBase {
if (params.containsKey("date")){
params.put("date", DateUtils.formatShort(params.get("date")));
}
params.put("logValues", Arrays.asList("3", "5", "6"));
params.put("logValues", Arrays.asList("5", "6"));
List<Map> result = new ArrayList<>();
List<Map> listMap = DaoBase.getInstance().query("HGSB010.queryBySbYes", params, 0,100);
List listMap2 = listMap.stream().map(map -> map.get("date")).sorted().distinct().collect(Collectors.toList());
......@@ -126,7 +127,7 @@ public class ServiceHGSB010 extends ServiceEPBase {
}
public void sbYes(EiInfo inInfo, Map params){
params.put("logValues", Arrays.asList("1", "2", "4"));
params.put("logValues", Arrays.asList("1", "2", "3", "4"));
List<Map> result = (List<Map>) inInfo.get(EiConstant.resultBlock);
List<Map> list = new ArrayList<>();
List<Map> listMap = DaoBase.getInstance().query("HGSB010.queryBySbYes", params, 0,100);
......@@ -151,7 +152,7 @@ public class ServiceHGSB010 extends ServiceEPBase {
}
public void sbNo(EiInfo inInfo, Map params){
params.put("logValues", Arrays.asList("3", "5", "6"));
params.put("logValues", Arrays.asList("5", "6"));
List<Map> result = (List<Map>) inInfo.get(EiConstant.resultBlock);
List<Map> list = new ArrayList<>();
List<Map> listMap = DaoBase.getInstance().query("HGSB010.queryBySbYes", params, 0,100);
......@@ -213,4 +214,16 @@ public class ServiceHGSB010 extends ServiceEPBase {
}
return inInfo;
}
@Override
public EiInfo insert(EiInfo inInfo) {
List<HGSB010> resultRows = MapUtils.toDaoEPBases(inInfo, HGSB010.class);
for (HGSB010 hgsb010: resultRows) {
hgsb010.setEquipmentType("STARUS_TYPE");
hgsb010.setCompanyCode(UserSessionUtils.getAccountCode());
DaoUtils.insert(HGSB010.INSERT, hgsb010);
}
return inInfo;
}
}
......@@ -185,9 +185,11 @@
</isNotEmpty>
left join (
select EQUIPMENT_CODE, LOG_VALUE
from ${hggpSchema}.HGSB010 where EQUIPMENT_TYPE = 'STARUS_TYPE'
and CREATED_TIME =(
select MAX(CREATED_TIME) from ${hggpSchema}.HGSB010
from ${hggpSchema}.HGSB010
where EQUIPMENT_TYPE = 'STARUS_TYPE'
and (EQUIPMENT_CODE,CREATED_TIME) IN (
select EQUIPMENT_CODE, MAX(CREATED_TIME)
from ${hggpSchema}.HGSB010
where EQUIPMENT_TYPE = 'STARUS_TYPE'
<isNotEmpty prepend=" AND " property="accountCode">
ACCOUNT_CODE = #accountCode#
......@@ -195,6 +197,7 @@
<isNotEmpty prepend=" AND " property="date">
left(CREATED_TIME,8) = #date#
</isNotEmpty>
group by EQUIPMENT_CODE
)
<isNotEmpty prepend=" AND " property="accountCode">
ACCOUNT_CODE = #accountCode#
......
......@@ -163,7 +163,7 @@ public class HGSC004A extends DaoEPBase {
private String updatedBy = " "; /* 更新人*/
private String updatedName = " "; /* 修改人名称*/
private String updatedTime = " "; /* 更新时间*/
private Integer inventSource; /* 物料来源 1加工 2外购*/
private Integer inventSource = 0; /* 物料来源 1加工 2外购*/
@ExcelAnno(index = 4)
private String material = " "; /* 材质*/
@ExcelAnno(index = 11)
......
......@@ -67,6 +67,7 @@ public class ServiceHGSC005 extends ServiceBase {
List<HGSC005A> hgsc005AList = HGSCTools.THGSC005A.queryByPlanCodes(planCodes);
this.checkCommitDate(hgsc005AList);
List<Long> ids = MapUtils.toDaoEPBases(resultRows,HGSC005.class).stream().filter(o -> o.getCommitStatus().compareTo(CommonConstant.YesNo.NO_0)==0).map(HGSC005::getId).collect(Collectors.toList());
AssertUtils.isEmpty(ids, "没有找到未提交生产计划,无法提交!");
DaoUtils.update(HGSC005.BATCH_COMMIT, new HashMap<String,Object>(){{put("ids",ids);}});
//生成生产订单
HGSCTools.THGSC006.generatorOrder(MapUtils.toDaoEPBases(inInfo,HGSC005.class), hgsc005AList);
......
......@@ -88,7 +88,7 @@
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
CREATED_TIME desc
PLAN_MATERIAL_DATE desc
</isEmpty>
</dynamic>
......
......@@ -789,6 +789,15 @@ public class HGSCTools {
return CollectionUtils.isEmpty(results) ? null : results;
}
public static List<HGSC005A> queryByProductCodes(List<String> ProductCodes){
AssertUtils.isEmpty(ProductCodes, "产品编码不能为空!");
Map paramMap = new HashMap();
paramMap.put("productCodes", ProductCodes);
List<HGSC005A> results = DaoBase.getInstance().query(HGSC005A.QUERY, paramMap);
return CollectionUtils.isEmpty(results) ? null : results;
}
/**
* 根据工序查询
*
......
......@@ -374,14 +374,13 @@ public class ServiceHGWD001D extends TreeService {
leafMap.put("filePath", dbWd001.getFilePath());
if (!isManager && !isSpare) {
leafMap.put("isAuth", "1");
// 从已授权的信息中查找出自己
HGWD003 dbWd003 = dbWd003s == null ? null : dbWd003s.stream().filter(item
-> item.getUserId().equals(userId)).findFirst().orElse(null);
leafMap.put("downloadFlag", dbWd003 == null ? "0" : dbWd003.getDownloadFlag());
} else {
leafMap.put("isAuth", "0");
leafMap.put("downloadFlag", "1");
}
// 从已授权的信息中查找出自己
HGWD003 dbWd003 = dbWd003s == null ? null : dbWd003s.stream().filter(item
-> item.getUserId().equals(userId)).findFirst().orElse(null);
leafMap.put("downloadFlag", dbWd003 == null ? "0" : dbWd003.getDownloadFlag());
results.add(leafMap);
}
// 设置叶子节点
......@@ -472,8 +471,12 @@ public class ServiceHGWD001D extends TreeService {
*/
public int getChildCount(String fileId, boolean isManager, boolean isSpare, String pageCode) {
List<String> childIds = HgWdUtils.HgWd001.queryChildrenId(fileId, isManager, isSpare); //查询子级目录
List<HGWD003> dbWd003List = null;
// 已授权人员信息
List<HGWD003> dbWd003List = HGWDTools.HgWd003.list(childIds);
if (!isSpare){
dbWd003List = HGWDTools.HgWd003.list(childIds);
}
List<HGWD099> fWd099s = HGWDTools.HgWd099.queryByBiz("WD", childIds, pageCode);
int dbWd099s = fWd099s == null ? 0 : fWd099s.size();
int count = 0;
......
......@@ -4,8 +4,10 @@ import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.ChangeTypeEnum;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoBase;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.enums.OrgTypeEnum;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.core.tools.Iplat4jTools;
import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.sc.domain.HGSC001;
......@@ -13,8 +15,10 @@ import com.baosight.hggp.hg.sc.tools.HGSCTools;
import com.baosight.hggp.hg.wd.constant.HgWdConstant;
import com.baosight.hggp.hg.wd.domain.HGWD001;
import com.baosight.hggp.hg.wd.domain.HGWD001A;
import com.baosight.hggp.hg.wd.domain.HGWD003;
import com.baosight.hggp.hg.wd.tools.HGWDTools;
import com.baosight.hggp.hg.xs.domain.Org;
import com.baosight.hggp.hg.xs.domain.User;
import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.EiInfoUtils;
......@@ -25,6 +29,7 @@ import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import org.apache.commons.collections.CollectionUtils;
import java.util.ArrayList;
import java.util.Arrays;
......@@ -83,6 +88,9 @@ public class ServiceHGWD001E extends ServiceEPBase {
}
Map<String, List<Map<String, Object>>> edcm01Map = edcm01List.stream().collect(Collectors.groupingBy(map -> map.get("codesetCode").toString(), Collectors.toList()));
List<HGWD001> hgwd001s = new ArrayList<>();
List<User> users = DaoBase.getInstance().query("HGWD003A.query",new HashMap<String, Object>(){{
put("userId", UserSessionUtils.getUserId());
}});
// 写入数据
for (Map resultRow : resultRows) {
HGWD001 hgwd001 = new HGWD001();
......@@ -99,7 +107,7 @@ public class ServiceHGWD001E extends ServiceEPBase {
hgwd001.setFileIdPath(wd001.getFileIdPath() + "/" + wd001.getFileId());
}
if (hgwd001.getId() == null || hgwd001.getId() == 0) {
this.add(hgwd001);
this.add(hgwd001,users);
} else {
List<Map<String, Object>> mapList = edcm01Map.get("hggp.hgwd.fileType");
this.modify(hgwd001,mapList);
......@@ -118,7 +126,7 @@ public class ServiceHGWD001E extends ServiceEPBase {
/**
* 新增操作
*/
public void add(HGWD001 hgwd001) {
public void add(HGWD001 hgwd001, List<User> users) {
hgwd001.setFileId(SequenceGenerator.getNextSequence(HGConstant.SequenceId.WD_FILE_ID));
hgwd001.setDocVersion(hgwd001.getDocVersion() + 1);
DaoUtils.insert(HGWD001.INSERT, hgwd001);
......@@ -132,6 +140,18 @@ public class ServiceHGWD001E extends ServiceEPBase {
hgwd001a.setChangeEnd(hgwd001.getFileName());
hgwd001a.setMatId(hgwd001.getId());
HGWDTools.HgWd001.addHGWD001A(hgwd001a);
if (CollectionUtils.isNotEmpty(users)){
User user = users.get(0);
HGWD003 fWd003 = new HGWD003();
fWd003.setUserId(user.getUserId());
fWd003.setUserName(user.getUserId());
fWd003.setExtId(user.getExtId());
fWd003.setOrgId(user.getDepCode());
fWd003.setOrgCname(user.getDepName());
fWd003.setFileId(hgwd001.getFileId());
DaoUtils.insert(HGWD003.INSERT, fWd003);
}
}
/**
......
......@@ -496,7 +496,7 @@ public class HGWDTools {
List<HGWD099> results = DaoBase.getInstance().query(HGWD099.QUERY,
new HashMap<String, Object>() {{
put("bizType", bizType==null?"WD":bizType);
put("status", "HGWD002".equals(pageCode)?1:0);
put("status", "HGWD002".equals(pageCode)?1:null);
put("bizIds", bizIds);
}}
);
......
......@@ -192,7 +192,7 @@
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
id desc
check_date asc
</isEmpty>
</dynamic>
......
......@@ -211,8 +211,8 @@
</div>
<div class="device-main device-span">
<div style="display: flex;width: 100%;margin-left: 1vw;height: 3vh">
<div style="margin-right: 0.5vw;color: #FFFFFF;font-size: 0.8vw;">设备</div>
<div style="color: #01A9FF;font-size: 1vw;">{{ item.deviceModel }}</div>
<div style="margin-right: 0.5vw;color: #FFFFFF;font-size: 0.8vw;">设备</div>
<div style="color: #01A9FF;font-size: 1vw;">{{ item.deviceCode }}</div>
</div>
<div style="height: 15.5vh;width: 100%;display: flex;justify-content: center;align-items: center;">
<div v-if="item.imgUrl" class="device-img">
......@@ -254,11 +254,13 @@
</div>
<div class="device-main device-span">
<div style="display: flex;width: 100%;margin-left: 1vw;height: 3vh">
<div style="margin-right: 0.5vw;color: #FFFFFF;font-size: 0.8vw;">设备</div>
<div style="color: #01A9FF;font-size: 1vw;">{{ item.deviceModel }}</div>
<div style="margin-right: 0.5vw;color: #FFFFFF;font-size: 0.8vw;">设备</div>
<div style="color: #01A9FF;font-size: 1vw;">{{ item.deviceCode }}</div>
</div>
<div style="height: 15.5vh;width: 100%;display: flex;justify-content: center;align-items: center;">
<img v-if="item.imgUrl" :src="item.imgUrl" style="height: 100%;" alt="">
<div v-if="item.imgUrl" class="device-img">
<img :src="item.imgUrl" style="height: 100%;" alt="">
</div>
<img v-else src="${ctx}/common/img/avi.png" style="width: 3vw;height: 6vh;" alt/>
</div>
</div>
......@@ -376,44 +378,17 @@
inInfo.set('inqu_status-0-date',this.dataPicker)
IPLAT.EiCommunicator.send('HGSB010', 'queryBySbStatus', inInfo, {
onSuccess: function (res) {
let deviceList = [
{
deviceName:'数控龙门加工中心',
status:'3',
deviceModel:'NSP42014C',
imgUrl:`${ctx}/common/img/device_01.jpg`
},
{
deviceName:'数控平面钻床1号',
status:'3',
deviceModel:'PMZ2016',
},
{
deviceName:'数控平面钻床2号',
status:'3',
deviceModel:'PMZ2016',
},
{
deviceName:'数控平面钻床3号',
status:'3',
deviceModel:'PMZ2016',
},
{
deviceName:'数控平面钻床4号',
status:'3',
deviceModel:'PMZ2016',
}
]
_this.queryBySbStatusList = []
if(res.extAttr.result.length){
_this.queryBySbStatusList = res.extAttr.result;
let deviceList = res.extAttr.result
deviceList.sort((a,b) => b.deviceCode.length - a.deviceCode.length );
_this.queryBySbStatusList = deviceList.map(item => {
return {
...item,
imgUrl: item.deviceCode === 'SB000001'?`${ctx}/common/img/device_01.jpg`:`${ctx}/common/img/device_02.png`
}
});
}
let newArr = deviceList.slice(_this.queryBySbStatusList.length,deviceList.length);
_this.queryBySbStatusList.push(...newArr)
_this.querySbYes();
_this.querySbNo();
......@@ -447,12 +422,18 @@
if(res.extAttr.result.length){
const dataList = res.extAttr.result;
_this.querySbYesList = dataList.map((item, index) => {
const getChartOptionByIndex = (index) => {
return {
_this.querySbYesList = _this.queryBySbStatusList.map(item => {
let yData = [];
let d = dataList.find(val => val.name === item.deviceCode)
if(d){
yData = d.data;
}
// 返回包含正确 option 属性的对象
return {
option: {
title: {
left: 'left',
text: '设备作业时长/分钟',
text: '设备作业时长/小时',
textStyle: {
color: '#ffffff' // 设置标题字体颜色为白色
}
......@@ -468,7 +449,6 @@
},
yAxis: {
type: 'value',
data: ['0', '0', '0', '0', '0', '0', '0'],
axisLabel: {
textStyle: {
color: '#ffffff' // 设置y轴标签字体颜色为白色
......@@ -485,7 +465,7 @@
},
series: [
{
data: dataList[index].data,
data: yData.map(item => (item/60).toFixed(2)),
type: 'line',
smooth: true,
itemStyle: {
......@@ -497,87 +477,11 @@
}
]
};
};
// 返回包含正确 option 属性的对象
return {
...item,
option: getChartOptionByIndex(index) // 现在这里是一个对象,而不是字符串
}
};
});
}
let str = ''
let dateArr = [];
if(_this.querySbYesDate.length){
str = dayjs().format('YYYY') + _this.querySbYesDate[_this.querySbYesDate.length-1];
dateArr.unshift(_this.querySbYesDate[_this.querySbYesDate.length-1])
for (let i = 0; i < 6; i++){
dateArr.unshift(dayjs(str).subtract(i+1,'day').format('MMDD'));
}
}else{
for (let i = 0; i < 7; i++){
dateArr.unshift(dayjs(_this.dataPicker).subtract(i,'day').format('MMDD'));
}
}
let list = []
for (let i = 0; i < 5; i++) {
list.push( {
option:{
title: {
left: 'left',
text: '设备作业时长/分钟',
textStyle: {
color: '#ffffff' // 设置标题字体颜色为白色
}
},
xAxis: {
type: 'category',
data: dateArr,
axisLabel: {
textStyle: {
color: '#ffffff' // 设置y轴标签字体颜色为白色
}
}
},
yAxis: {
type: 'value',
axisLabel: {
textStyle: {
color: '#ffffff' // 设置y轴标签字体颜色为白色
}
}
},
grid: {
top: '17%', // 图表距离容器顶部的距离
bottom: '2%', // 图表距离容器底部的距离,为下方的文字留出空间
left: '2%',
right: '2%',
containLabel: true // 确保标签(如坐标轴标签)在网格内
},
series: [
{
data: _this.onResetData(),
type: 'line',
smooth: true,
itemStyle: {
color: '#01b9ff'
},
areaStyle: {
color: '#245085'
},
}
]
}
})
}
let newArr = list.slice(_this.querySbYesList.length,list.length);
_this.querySbYesList.push(...newArr)
console.log(_this.querySbYesList,999998888)
},
onFail: function (err) {
......@@ -598,12 +502,17 @@
_this.querySbNoList = [];
if(res.extAttr.result.length ){
const dataList = res.extAttr.result;
_this.querySbNoList = dataList.map((item, index) => {
const getChartOptionByIndex = (index) => {
return {
_this.querySbNoList = _this.queryBySbStatusList.map((item, index) => {
let yData = [];
let d = dataList.find(val => val.name === item.deviceCode)
if(d){
yData = d.data;
}
return {
option: {
title: {
left: 'left',
text: '设备故障时长/分钟',
text: '设备暂停时长/小时',
textStyle: {
color: '#ffffff' // 设置标题字体颜色为白色
}
......@@ -619,7 +528,6 @@
},
yAxis: {
type: 'value',
data: ['0', '0', '0', '0', '0', '0', '0'],
axisLabel: {
textStyle: {
color: '#ffffff' // 设置y轴标签字体颜色为白色
......@@ -636,7 +544,7 @@
},
series: [
{
data: dataList[index].data,
data: yData.map(item => (item/60).toFixed(2)),
type: 'line',
smooth: true,
itemStyle: {
......@@ -646,91 +554,11 @@
color: '#245085'
},
}
]
};
};
// 返回包含正确 option 属性的对象
return {
...item,
option: getChartOptionByIndex(index) // 现在这里是一个对象,而不是字符串
}
};
});
}
let str = ''
let dateArr = [];
if( _this.querySbNODate.length){
str = dayjs().format('YYYY') + _this.querySbNODate[ _this.querySbNODate.length-1];
dateArr.unshift( _this.querySbNODate[ _this.querySbNODate.length-1])
for (let i = 0; i < 6; i++){
dateArr.unshift(dayjs(str).subtract(i+1,'day').format('MMDD'));
}
}else{
for (let i = 0; i < 7; i++){
console.log(dayjs(_this.dataPicker).subtract(i,'day').format('MMDD'),"2sdadasdas")
dateArr.unshift(dayjs(_this.dataPicker).subtract(i,'day').format('MMDD'));
}
}
let list = []
for (let i = 0; i < 5; i++) {
list.push( {
option: {
title: {
left: 'left',
text: '设备故障时长/分钟',
textStyle: {
color: '#ffffff' // 设置标题字体颜色为白色
}
},
xAxis: {
type: 'category',
data: dateArr,
axisLabel: {
textStyle: {
color: '#ffffff' // 设置y轴标签字体颜色为白色
}
}
},
yAxis: {
type: 'value',
axisLabel: {
textStyle: {
color: '#ffffff' // 设置y轴标签字体颜色为白色
}
}
},
grid: {
top: '15%', // 图表距离容器顶部的距离
bottom: '2%', // 图表距离容器底部的距离,为下方的文字留出空间
left: '2%',
right: '2%',
containLabel: true // 确保标签(如坐标轴标签)在网格内
},
series: [
{
data: _this.onResetData(0,100),
type: 'line',
smooth: true,
itemStyle: {
color: '#01b9ff'
},
areaStyle: {
color: '#245085'
},
}
]
}
})
}
let newArr = list.slice(_this.querySbNoList.length,list.length);
_this.querySbNoList.push(...newArr)
console.log(_this.querySbNoList,77776666)
},
onFail: function (err) {
......
......@@ -16,7 +16,7 @@
<div style="width: 50%;height: 100%">
<div class="content-content-img device-img1" style="width: 79%;margin-left: 3.2vw;">
<img :src="`${ctx}/common/img/device-img3-content.png`" class="device-img1-content img" alt/>
<div class="content-content-title" style="justify-content: flex-start;margin-top: 2.8vh;padding-left: 1.5vw">组立机</div>
<div class="content-content-title" style="justify-content: flex-start;margin-top: 2.8vh;margin-left: 0.5vw;">龙门加工中心</div>
</div>
<div style="width: 79%;margin-left: 3.2vw;height: 28vh;margin-top: 2vh">
<div class="content-device-img img">
......@@ -26,17 +26,41 @@
</div>
</div>
<div class="right-device img">
<div style="width: 100%;height: 30%;display: flex;margin-top: 3vh;">
<div class="content-content-title" style="width: 40%;">组立机</div>
<img :src="`${ctx}/common/img/device-img3-content.png`" class="device-img1-content img" style="margin: 0;" alt/>
<!-- <div style="width: 100%;height: 30%;display: flex;margin-top: 3vh;">-->
<!-- <div class="content-content-title" style="width: 40%;">组立机</div>-->
<!-- <img :src="`${ctx}/common/img/device-img3-content.png`" class="device-img1-content img" style="margin: 0;" alt/>-->
<!-- </div>-->
<!-- <div style="width: 100%;height: 30%;display: flex;margin-top: 2vh;">-->
<!-- <div class="content-content-title" style="width: 40%;">埋弧焊机</div>-->
<!-- <img :src="`${ctx}/common/img/device-img4-content.png`" class="device-img1-content img" style="margin: 0;" alt/>-->
<!-- </div>-->
<div class="device-item">
<div class="name" style="width: 40%;">
<span class="text-1">数控平面钻床</span>
<span class="text-2">(HG004)</span>
</div>
<img :src="`${ctx}/common/img/device-img5-content.png`" class="device-img1-content img" alt/>
</div>
<div style="width: 100%;height: 30%;display: flex;margin-top: 2vh;">
<div class="content-content-title" style="width: 40%;">埋弧焊机</div>
<img :src="`${ctx}/common/img/device-img4-content.png`" class="device-img1-content img" style="margin: 0;" alt/>
<div class="device-item">
<div class="name" style="width: 40%;">
<span class="text-1">数控平面钻床</span>
<span class="text-2">(HG005)</span>
</div>
<img :src="`${ctx}/common/img/device-img5-content.png`" class="device-img1-content img" alt/>
</div>
<div style="width: 100%;height: 30%;display: flex;margin-top: 2vh;">
<div class="content-content-title" style="width: 40%;">龙门加工中心</div>
<img :src="`${ctx}/common/img/device-img5-content.png`" class="device-img1-content img" style="margin: 0;" alt/>
<div class="device-item">
<div class="name" style="width: 40%;">
<span class="text-1">数控平面钻床</span>
<span class="text-2">(HG006)</span>
</div>
<img :src="`${ctx}/common/img/device-img5-content.png`" class="device-img1-content img" alt/>
</div>
<div class="device-item">
<div class="name" style="width: 40%;">
<span class="text-1">数控平面钻床</span>
<span class="text-2">(HG007)</span>
</div>
<img :src="`${ctx}/common/img/device-img5-content.png`" class="device-img1-content img" alt/>
</div>
</div>
</div>
......@@ -137,11 +161,42 @@ module.exports = {
display: flex;
justify-content: center;
align-items: center;
//background-image: url("../../../../../common/img/titleContentDevice.png");
/*background-image: url("../../../../../common/img/titleContentDevice.png");*/
}
.right-device{
width: 46%;
height: 100%;
background-image: url("../../../../../common/img/rightLongBg.png");
}
.device-item{
display: flex;
flex-direction: row;
/*justify-content: center;*/
align-items: center;
width: 100%;
height: 25%;
padding-left: 1%;
}
.device-item .device-img1-content{
margin: 2% 0 0 1%;
}
.device-item .name{
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.device-item .name .text-1{
font-family: Adobe Heiti Std;
font-weight: normal;
font-size: 1vw;
color: #FFFFFF;
background: linear-gradient(180deg, #ACE5FF 0%, #FFFFFF 100%);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
.device-item .name .text-2{
font-size: 0.8vw;
color: #FFFFFF;
}
</style>
......@@ -286,7 +286,7 @@ function submitFunc() {
return;
}
var flag = true;
rows.forEach(function (index,row) {
rows.forEach(function (row,index) {
if (isBlank(row.id)){
message("选中的第"+(index+1)+"行未保存的数据,请先保存!");
flag = false;
......
......@@ -65,11 +65,11 @@ let select = function () {
return;
}
for (let i = 0; i < rows.length; i++) {
let entityAmount = rows[i]['entityAmount'];
if (!isPositiveInteger(entityAmount)) {
message("勾选的第" + (i + 1) + "行实物数量必须是大于0的整数");
return;
}
// let entityAmount = rows[i]['entityAmount'];
// if (!isPositiveInteger(entityAmount)) {
// message("勾选的第" + (i + 1) + "行实物数量必须是大于0的整数");
// return;
// }
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据生成盘点单吗? ", {
ok: function () {
......
......@@ -105,27 +105,36 @@ function commit() {
message2("提交","没有选中的行");
return;
}
IPLAT.confirm({
title:'提交',
message:'确认提交此数据么?',
okFn:function () {
var post = new EiInfo();
post.addBlock(resultGrid.getCheckedBlockData());
post.set("recursion", true);
EiCommunicator.send("HGSC005","commit",post,{
onSuccess: function (ei) {
if (ei.getStatus() >= 0) {
NotificationUtil(ei);
resultGrid.dataSource.query();
} else {
NotificationUtil(ei, "error");
}
},
onFail: function (ei) {
// 发生异常
NotificationUtil("操作失败,原因[" + ei + "]", "error");
}
});
var flag = true;
rows.forEach(function (row,index) {
if (row.commitStatus == "2") {
message("选中的第"+(index+1)+"行数据已提交,无法重复提交!");
flag = false;
}
})
if (flag){
IPLAT.confirm({
title:'提交', message:'确认提交此数据么?',
okFn:function () {
var post = new EiInfo();
post.addBlock(resultGrid.getCheckedBlockData());
post.set("recursion", true);
EiCommunicator.send("HGSC005","commit",post,{
onSuccess: function (ei) {
if (ei.getStatus() >= 0) {
NotificationUtil(ei);
resultGrid.dataSource.query();
} else {
NotificationUtil(ei, "error");
}
},
onFail: function (ei) {
// 发生异常
NotificationUtil("操作失败,原因[" + ei + "]", "error");
}
});
}
})
}
}
......@@ -75,7 +75,7 @@ $(function (){
})
}
},
template: function (dataItem) {
/*template: function (dataItem) {
for (let i = 0; i < processCodes.length; i++) {
if (processCodes[i]['valueField'] === dataItem['processCode']) {
dataItem['processName'] = processCodes[i]['textField'].split("]")[1];
......@@ -84,7 +84,7 @@ $(function (){
}
}
return dataItem['processCode'];
},
},*/
editor: function (container, options) {
this.filter(options);
}
......@@ -123,11 +123,19 @@ $(function (){
if (e.field == "factoryCode") {
loadChange(grid,e,"processCode");
}else if (e.field == "processCode") {
let dataItem = e.items[0];
for (let i = 0; i < processCodes.length; i++) {
if (processCodes[i]['valueField'] === dataItem['processCode']) {
resultGrid.setCellValue(dataItem,"unit",processCodes[i]['param3Field']);
resultGrid.setCellValue(dataItem,"processName",processCodes[i]['textField'].split("]")[1])
break;
}
}
if (e.items[0].factoryCode.length===0){
loadChange(grid,e,"factoryCode");
}else {
loadChange(grid,e,"unit");
}
loadChange(grid,e,"unit");
loadChange(grid,e,"processClass");
}
});
},
......@@ -173,7 +181,7 @@ $(function (){
exportGrid : {
exportFileName: function (gridInstance) {
// 导出的文件名包含时间戳 yyyy-MM-dd HH:mm:ss
return "工艺流程_" + kendo.toString(new Date(), IPLAT.FORMAT.DATE_14_PR);
return "工序单价_" + kendo.toString(new Date(), IPLAT.FORMAT.DATE_14_PR);
},
exportFileType: "xls",
exportBlockId: "result",
......
......@@ -809,6 +809,7 @@ function uploadFileCallback(data) {
}else {
JSColorbox.close();
resultGrid.dataSource.page(1);
editCallback();
}
},
......
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