Commit 81cdef7c by 江和松

物料清单提交操作修改

parent 8f53492b
......@@ -348,6 +348,12 @@ public enum DdynamicEnum {
* 编写: ly
*/
DELIVERY_CODE_BOX_BLOCK_ID("deliveryCodeBox_block_id","deliveryCode","projName","id","HGYX001.queryReturnCodeBox"),
/**
* 项目下拉框根据权限查
*/
PROJ_RECORD_BY_ROLE_BLOCK_ID("projRecordByRole_block_id","projCode", "projName","companyCode","companyName", "HGSC001.queryProjectByRoleBox"),
;
......
......@@ -11,6 +11,7 @@ import com.baosight.hggp.hg.cg.tools.HGCGTools;
import com.baosight.hggp.hg.cg.utils.HGCGUtils;
import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.constant.HGSqlConstant;
import com.baosight.hggp.hg.xs.domain.Company;
import com.baosight.hggp.hg.xs.domain.User;
import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.CommonMethod;
......@@ -48,6 +49,7 @@ public class ServiceHGCG002 extends ServiceBase {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.SUP_RECORD_BLOCK_ID));
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_RECORD_BLOCK_ID));
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.SPEC_NAME_BLOCK_ID));
EiInfoUtils.addBlock(inInfo,"roleCompany", UserSessionUtils.getRoleCompany(), Company.class);
EiInfoUtils.addBlock(inInfo,"userByCompany", UserSessionUtils.getUserByCompany(UserSessionUtils.getAccountCode()), User.class);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGCG002().eiMetadata);
} catch (Exception e) {
......
......@@ -32,7 +32,7 @@ public class ServiceHGSC003 extends ServiceBase {
Map map = new HashMap();
map.put(HGSC003.FIELD_account_code, UserSessionUtils.getAccountCode());
CommonMethod.initBlock(inInfo,
Arrays.asList(DdynamicEnum.COMPANY_BOX_BLOCK_ID,DdynamicEnum.PROJ_RECORD_BLOCK_ID),map,false
Arrays.asList(DdynamicEnum.COMPANY_BOX_BLOCK_ID,DdynamicEnum.PROJ_RECORD_BY_ROLE_BLOCK_ID),map,false
);
} catch (Exception e){
LogUtils.setDetailMsg(inInfo,e,"初始化失败");
......@@ -43,11 +43,6 @@ public class ServiceHGSC003 extends ServiceBase {
public EiInfo query(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HGSC003.QUERY, new HGSC003());
Map map = new HashMap();
map.put(HGSC003.FIELD_account_code, UserSessionUtils.getAccountCode());
CommonMethod.initBlock(inInfo,
Arrays.asList(DdynamicEnum.COMPANY_BOX_BLOCK_ID,DdynamicEnum.PROJ_RECORD_BLOCK_ID),map,false
);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
......@@ -178,7 +173,7 @@ public class ServiceHGSC003 extends ServiceBase {
map.put(HGSC001.FIELD_account_code, UserSessionUtils.getAccountCode());
map.put(HGSC001.FIELD_company_code, companyCode);
map.put(HGSC001.FIELD_approval_status, approvalStatus);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.PROJ_RECORD_BLOCK_ID), map,false);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.PROJ_RECORD_BY_ROLE_BLOCK_ID), map,false);
return inInfo;
}
......@@ -192,10 +187,12 @@ public class ServiceHGSC003 extends ServiceBase {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
String companyCode = MapUtils.getString(queryMap, HGSC003.FIELD_company_code);
String blueprintStatus = MapUtils.getString(queryMap, HGSC003.FIELD_blueprint_status);
String projCode = MapUtils.getString(queryMap, HGSC003.FIELD_proj_code);
Map map = new HashMap();
map.put(HGSC003.FIELD_account_code, UserSessionUtils.getAccountCode());
map.put(HGSC003.FIELD_company_code, companyCode);
map.put(HGSC003.FIELD_blueprint_status, blueprintStatus);
map.put(HGSC003.FIELD_proj_code, projCode);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.BLUEPRINT_BOX_BLOCK_ID), map,false);
return inInfo;
......
......@@ -8,6 +8,8 @@ import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.sc.domain.HGSC003;
import com.baosight.hggp.hg.sc.domain.HGSC004;
import com.baosight.hggp.hg.sc.domain.HGSC004A;
import com.baosight.hggp.hg.sc.tools.HGSCTools;
import com.baosight.hggp.hg.xs.domain.Company;
import com.baosight.hggp.util.*;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
......@@ -28,13 +30,14 @@ public class ServiceHGSC004 extends ServiceBase {
public EiInfo initLoad(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HGSC004.QUERY, new HGSC004());
EiInfoUtils.addBlock(inInfo,"roleCompany", UserSessionUtils.getRoleCompany(), Company.class);
Map map = new HashMap();
map.put(HGSC004.FIELD_account_code, UserSessionUtils.getAccountCode());
map.put(HGSC003.FIELD_blueprint_status, HGConstant.EnablingStatus.QY);
CommonMethod.initBlock(inInfo,
Arrays.asList(DdynamicEnum.COMPANY_BOX_BLOCK_ID,DdynamicEnum.PROJ_RECORD_BLOCK_ID,DdynamicEnum.BLUEPRINT_BOX_BLOCK_ID),map,false
Arrays.asList(DdynamicEnum.COMPANY_BOX_BLOCK_ID,DdynamicEnum.PROJ_RECORD_BY_ROLE_BLOCK_ID,DdynamicEnum.BLUEPRINT_BOX_BLOCK_ID),map,false
);
} catch (PlatException e) {
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
......@@ -43,12 +46,6 @@ public class ServiceHGSC004 extends ServiceBase {
public EiInfo query(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HGSC004.QUERY, new HGSC004());
Map map = new HashMap();
map.put(HGSC004.FIELD_account_code, UserSessionUtils.getAccountCode());
map.put(HGSC003.FIELD_blueprint_status, HGConstant.EnablingStatus.QY);
CommonMethod.initBlock(inInfo,
Arrays.asList(DdynamicEnum.COMPANY_BOX_BLOCK_ID,DdynamicEnum.PROJ_RECORD_BLOCK_ID,DdynamicEnum.BLUEPRINT_BOX_BLOCK_ID),map,false
);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
......@@ -96,9 +93,9 @@ public class ServiceHGSC004 extends ServiceBase {
Map resultMap = EiInfoUtils.getFirstRow(inInfo,EiConstant.resultBlock);
HGSC004 hgsc004 = new HGSC004();
hgsc004.fromMap(resultMap);
HGSC003 hgsc003 = (HGSC003) super.dao.get(HGSC003.QUERY,HGSC004.FIELD_blueprint_code,hgsc004.getBlueprintCode());
hgsc004.setBlueprintId(hgsc003.getId());
HGSC003 hgsc003 = HGSCTools.Hgsc003.getByBlueprintCode(hgsc004.getBlueprintCode());
this.checkSaveData(hgsc004,hgsc003);
hgsc004.setBlueprintId(hgsc003.getId());
if(Objects.nonNull(hgsc004.getId())&&hgsc004.getId()!=0){
DaoUtils.update(HGSC004.UPDATE, hgsc004);
//变更清单里面的公司、项目信息
......@@ -139,6 +136,7 @@ public class ServiceHGSC004 extends ServiceBase {
AssertUtils.isTrue(hgsc004.getMaterialStatus().compareTo(HGConstant.MaterialStatus.WTJ) > 0,"非未提交不可修改!");
AssertUtils.isTrue(hgsc003.getBlueprintStatus().compareTo(HGConstant.EnablingStatus.TY) == 0,"蓝图已停用不可修改!");
}
AssertUtils.isTrue(Objects.isNull(hgsc003),"未获取到蓝图信息!");
Map<String,Object> map = new HashMap<>();
map.put("projCode",hgsc004.getProjCode());
List<HGSC004> hgsc004List = this.dao.query(HGSC004.QUERY,map);
......
......@@ -169,6 +169,7 @@ public class ServiceHGSC004A extends ServiceBase {
try {
Map resultMap = EiInfoUtils.getFirstRow(inInfo,EiConstant.resultBlock);
HGSC004A hgsc004a = new HGSC004A();
//树结构选中的构建
hgsc004a.fromMap(resultMap);
//主表信息,用于取值
Long materialId = Long.valueOf(inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSC004A.FIELD_material_id));
......@@ -181,15 +182,6 @@ public class ServiceHGSC004A extends ServiceBase {
hgsc004a.setDepCode(hgsc004.getDepCode());
hgsc004a.setDepName(hgsc004.getDepName());
hgsc004a.setMaterialId(hgsc004.getId());
//不为4级都有叶子节点,父节点需要+1
if(hgsc004a.getLv().intValue() < 4){
hgsc004a.setLv(hgsc004a.getLv() + 1);
}
if(hgsc004a.getLv().intValue() == 3){
hgsc004a.setLeaf(2);
}else{
hgsc004a.setLeaf(1);
}
this.checkSaveData(hgsc004a,hgsc004);
if(Objects.nonNull(hgsc004a.getId())&&hgsc004a.getId()!=0){
//替换/修改
......@@ -208,6 +200,15 @@ public class ServiceHGSC004A extends ServiceBase {
}
private void addEntity(HGSC004A hgsc004a, HGSC004 hgsc004) {
//不为4级都有叶子节点,父节点需要+1
if(hgsc004a.getLv().intValue() < 4){
hgsc004a.setLv(hgsc004a.getLv() + 1);
}
if(hgsc004a.getLv().intValue() == 3){
hgsc004a.setLeaf(2);
}else{
hgsc004a.setLeaf(1);
}
hgsc004a.setProductStatus(HGConstant.ProductStatus.WTJ);
if(hgsc004a.getLv().intValue() == 3){
hgsc004a.setProductType(ProductTypeEnum.STRUCT.getCode().toString());
......@@ -220,15 +221,6 @@ public class ServiceHGSC004A extends ServiceBase {
Long maxId = (Long) super.dao.get(HGSC004A.MAX_ID,null,null);
hgsc004a.setId(maxId+1);
HGSCTools.THGSC004B.save(null,hgsc004a);
//新增生产计划
HGSC005A hgsc005a = new HGSC005A();
BeanUtil.copyProperties(hgsc004a,hgsc005a,"id","productType");
hgsc005a.setMatDetailId(hgsc004a.getId());
hgsc005a.setMatId(hgsc004.getId());
hgsc005a.setProductType(Integer.valueOf(hgsc004a.getProductType()));
Long techFlowId = (Long) DaoBase.getInstance().get(HGSC004A.QUERY_TECHFLOW_ID_BY_PRODUCTID, HGSC004A.FIELD_product_id, hgsc004a.getProductId());
hgsc005a.setTechFlowId(techFlowId);
HGSCTools.THGSC005A.save(hgsc005a);
}
DaoUtils.insert(HGSC004A.INSERT, hgsc004a);
......@@ -272,18 +264,89 @@ public class ServiceHGSC004A extends ServiceBase {
delHgsc005a.setTechFlowId(techFlowId);
HGSCTools.THGSC005A.delete(delHgsc005a);
//变更生产计划
}
DaoUtils.update(HGSC004A.UPDATE, hgsc004a);
}
/**
* 提交时生产计划操作
* 不包含删除,删除未批量的,单独逻辑处理
* @param hgsc004
* @param flag 是否生成计划主表
* @param hgsc004AList
*/
private void submitPlanEntity(HGSC004 hgsc004, Boolean flag, List<HGSC004A> hgsc004AList) {
List<String> inventCodes = hgsc004AList.stream().map(HGSC004A::getProductCode).collect(Collectors.toList());
List<HGPZ005> hgpz005List = HGPZTools.HgPz005.listByInventCodes(inventCodes);
//第一次全部提交
if(flag){
//主表
HGSC005 hgsc005 = new HGSC005();
BeanUtil.copyProperties(hgsc004,hgsc005,"id");
hgsc005.setMatId(hgsc004.getId());
HGSCTools.THGSC005.save(hgsc005);
// 全部提交后,发送计划
Map<String,Object> mapA = new HashMap<>();
mapA.put("materialId",hgsc004.getId());
hgsc004AList = dao.query(HGSC004A.QUERY_BY_MATERIAL_ID,mapA, 0, -999999);
List<HGSC005A> hgsc005AList = new LinkedList<>();
for(HGSC004A hgsc004A : hgsc004AList){
//全部提交后的增加、修改
HGSC005A hgsc005a = new HGSC005A();
BeanUtil.copyProperties(hgsc004a,hgsc005a,"id","productType");
hgsc005a.setMatDetailId(hgsc004a.getId());
BeanUtil.copyProperties(hgsc004A,hgsc005a,"id","productType");
hgsc005a.setMatDetailId(hgsc004A.getId());
hgsc005a.setMatId(hgsc004.getId());
hgsc005a.setProductType(Integer.valueOf(hgsc004a.getProductType()));
hgsc005a.setTechFlowId(techFlowId);
hgsc005a.setProductType(Integer.valueOf(hgsc004A.getProductType()));
HGPZ005 hgpz005 = hgpz005List.stream().filter(p -> p.getInventCode().equals(hgsc004A.getProductCode())).findAny().orElse(null);
if(Objects.nonNull(hgpz005)){
hgsc005a.setTechFlowId(hgpz005.getFlowId());
}
hgsc005AList.add(hgsc005a);
}
if(hgsc005AList != null && !hgsc005AList.isEmpty()){
HGSCTools.THGSC005A.saveList(hgsc005AList);
}
}else{
//校验计划父单据是否提交,提交了不让新增
HGSCTools.THGSC004A.checkFatherSubmitStatus(hgsc004.getId());
//全部提交后的增加、修改
List<HGSC005A> hgsc005AList = new LinkedList<>();
for(HGSC004A hgsc004A : hgsc004AList){
HGSC005A hgsc005a = new HGSC005A();
BeanUtil.copyProperties(hgsc004A,hgsc005a,"id","productType");
hgsc005a.setMatDetailId(hgsc004A.getId());
hgsc005a.setMatId(hgsc004.getId());
hgsc005a.setProductType(Integer.valueOf(hgsc004A.getProductType()));
HGPZ005 hgpz005 = hgpz005List.stream().filter(p -> p.getInventCode().equals(hgsc004A.getProductCode())).findAny().orElse(null);
if(Objects.nonNull(hgpz005)){
hgsc005a.setTechFlowId(hgpz005.getFlowId());
}
if(hgsc004A.getChangeType() == HGConstant.ChangeType.TH){
//删除或修改数量生产计划
HGSC005A delHgsc005a = new HGSC005A();
BeanUtil.copyProperties(hgsc004A,delHgsc005a,"id","productType");
delHgsc005a.setMatDetailId(hgsc004A.getId());
delHgsc005a.setMatId(hgsc004.getId());
delHgsc005a.setProductType(Integer.valueOf(hgsc004A.getProductType()));
HGPZ005 delHgpz005 = hgpz005List.stream().filter(p -> p.getInventCode().equals(hgsc004A.getProductCode())).findAny().orElse(null);
if(Objects.nonNull(delHgpz005)){
delHgsc005a.setTechFlowId(delHgpz005.getFlowId());
}
HGSCTools.THGSC005A.delete(delHgsc005a);
//变更生产计划
HGSCTools.THGSC005A.update(hgsc005a);
}else{
hgsc005AList.add(hgsc005a);
}
DaoUtils.update(HGSC004A.UPDATE, hgsc004a);
}
if(hgsc005AList != null && !hgsc005AList.isEmpty()){
HGSCTools.THGSC005A.saveList(hgsc005AList);
}
}
}
/**
* 校验保存的数据
*
......@@ -300,9 +363,10 @@ public class ServiceHGSC004A extends ServiceBase {
Map<String,Object> mapA = new HashMap<>();
mapA.put("materialId",hgsc004a.getMaterialId());
mapA.put("productId",hgsc004a.getProductId());
mapA.put("parentProdCode",hgsc004a.getParentProdCode());
mapA.put("notId",hgsc004a.getId());
List<HGSC004A> hgsc004AList = dao.query(HGSC004A.QUERY,mapA, 0, -999999);
AssertUtils.isTrue(!CollectionUtils.isEmpty(hgsc004AList), "已存在构建"+hgsc004a.getProductName());
AssertUtils.isTrue(!CollectionUtils.isEmpty(hgsc004AList), "已存在构建"+hgsc004a.getProductCode()+"-"+hgsc004a.getProductName());
}
AssertUtils.isEmpty(UserSessionUtils.getAccountCode(), "当前用户未绑定公司,无法操作数据,请联系管理员!");
AssertUtils.isEmpty(UserSessionUtils.getOrgId(), "当前用户未绑定部门,无法操作数据,请联系管理员!");
......@@ -374,48 +438,57 @@ public class ServiceHGSC004A extends ServiceBase {
Map<String,Object> queryEntityMap = new HashMap<>();
queryEntityMap.put("materialId",materialId);
List<HGSC004A> allHgsc004AList = dao.query(HGSC004A.QUERY,queryEntityMap, 0, -999999);
//需要提交的物料
List<HGSC004A> submitEntityList = new LinkedList<>();
for (i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
//前端传参不完
//前端传参不完全,但是肯定有id
hgsc004a.fromMap(map);
if(Objects.nonNull(hgsc004)){
//全部提交后的操作,如新增的提交、替换的提交
if(hgsc004.getMaterialStatus().intValue() == HGConstant.MaterialStatus.QBTJ){
hgsc004a = (HGSC004A) super.dao.get(HGSC004A.QUERY_BY_MATERIAL_ID,HGSC004A.FIELD_id,hgsc004a.getId());
//校验计划父单据是否提交,提交了不让新增
HGSCTools.THGSC004A.checkFatherSubmitStatus(hgsc004.getId());
//子表
HGSC005A hgsc005a = new HGSC005A();
BeanUtil.copyProperties(hgsc004a,hgsc005a,"id","productType");
hgsc005a.setMatDetailId(hgsc004a.getId());
hgsc005a.setMatId(hgsc004.getId());
if(hgsc004a.getLv().intValue() == 3){
hgsc005a.setProductType(ProductTypeEnum.STRUCT.getCode());
}else{
hgsc005a.setProductType(ProductTypeEnum.PART.getCode());
Long id = hgsc004a.getId();
hgsc004a = allHgsc004AList.stream().filter(o -> o.getId().intValue() == id).findAny().orElse(null);
submitEntityList.add(hgsc004a);
}
HGSCTools.THGSC005A.save(hgsc005a);
}else{
//构建全部提交
if(hgsc004a.getProductType().equals(ProductTypeEnum.STRUCT.getCode().toString())){
HGSC004A finalHgsc004a = hgsc004a;
if(!CollectionUtils.isEmpty(submitEntityList)){
if(Objects.nonNull(hgsc004)){
//选择构建的,需要把零件都提交
List<HGSC004A> hgsc004AList = new LinkedList<>();
for(HGSC004A entity : submitEntityList){
if(entity.getProductType().equals(ProductTypeEnum.STRUCT.getCode().toString())){
HGSC004A finalHgsc004a = entity;
//得到所有子级零件
List<HGSC004A> partList = allHgsc004AList.stream().filter(o -> o.getParentProdCode().equals(finalHgsc004a.getProductCode())
&& o.getProductStatus().intValue() == HGConstant.ProductStatus.WTJ).collect(Collectors.toList());
if(!CollectionUtils.isEmpty(partList)){
partList.forEach(o ->{
o.setProductStatus(HGConstant.ProductStatus.YTJ);
//将查询的全部信息都赋值
allHgsc004AList.forEach(all ->{
if(all.getId().compareTo(o.getId()) == 0){
all.setProductStatus(HGConstant.ProductStatus.YTJ);
}
});
hgsc004AList.add(o);
});
DaoUtils.updateBatch(HGSC004A.UPDATE_PRODUCT_STATUS, partList);
}
}
Map<String,Object> mapA = new HashMap<>();
mapA.put("materialId",hgsc004a.getMaterialId());
mapA.put("productStatus",HGConstant.ProductStatus.WTJ);
mapA.put("notId",hgsc004a.getId());
List<HGSC004A> hgsc004AList = dao.query(HGSC004A.QUERY,mapA, 0, -999999);
if(!CollectionUtils.isEmpty(hgsc004AList)){
hgsc004AList.add(entity);
DaoUtils.updateBatch(HGSC004A.UPDATE_PRODUCT_STATUS, hgsc004AList);
}
//全部提交后的操作,如新增的提交、替换的提交
if(hgsc004.getMaterialStatus().intValue() == HGConstant.MaterialStatus.QBTJ){
submitPlanEntity(hgsc004,false, hgsc004AList);
}else{
//未提交、部分提交,还未生成计划
//查看是否存在未提交的记录
List<HGSC004A> noSubmitAList = new LinkedList<>();
allHgsc004AList.forEach(o->{
//排除未提交,并且不是选中的
HGSC004A entity = submitEntityList.stream().filter(h->h.getId().compareTo(o.getId()) == 0).findAny().orElse(null);
if(Objects.isNull(entity) && o.getProductStatus().intValue() == HGConstant.ProductStatus.WTJ){
noSubmitAList.add(o);
}
});
if(!CollectionUtils.isEmpty(noSubmitAList)){
//如果存在就是部分提交
hgsc004.setMaterialStatus(HGConstant.MaterialStatus.BFTJ);
DaoUtils.update(HGSC004.UPDATE_MATERIAL_STATUS, hgsc004);
......@@ -423,14 +496,13 @@ public class ServiceHGSC004A extends ServiceBase {
hgsc004.setMaterialStatus(HGConstant.MaterialStatus.QBTJ);
DaoUtils.update(HGSC004.UPDATE_MATERIAL_STATUS, hgsc004);
//保存生产计划
saveTHGSC005(hgsc004,hgsc004a);
}
submitPlanEntity(hgsc004, true,hgsc004AList);
}
}
hgsc004a.setProductStatus(HGConstant.ProductStatus.YTJ);
DaoUtils.update(HGSC004A.UPDATE_PRODUCT_STATUS, hgsc004a);
DaoUtils.updateBatch(HGSC004A.UPDATE_PRODUCT_STATUS, hgsc004AList);
}
}
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsgByKey("ep.1000", new String[]{String.valueOf(i), I18nMessages.getText("label.update", "修改")});
} catch (PlatException e) {
......@@ -443,6 +515,7 @@ public class ServiceHGSC004A extends ServiceBase {
return inInfo;
}
private void saveTHGSC005(HGSC004 hgsc004,HGSC004A hgsc004a) {
//主表
HGSC005 hgsc005 = new HGSC005();
......
......@@ -390,4 +390,17 @@
FROM ${hggpSchema}.HGSC001 WHERE approval_status = 2 and proj_status = 0
<include refid="condition" />
</select>
<select id="queryProjectByRoleBox" parameterClass="java.util.HashMap"
resultClass="java.util.HashMap">
SELECT DISTINCT
PROJ_CODE as "projCode",
PROJ_NAME as "projName",
company_code as "companyCode", <!-- 公司编码 -->
company_name as "companyName" <!-- 公司名称 -->
FROM ${hggpSchema}.HGSC001
WHERE 1=1
<include refid="condition" />
ORDER BY PROJ_CODE desc
</select>
</sqlMap>
......@@ -179,6 +179,7 @@
BLUEPRINT_NAME as "blueprintName" <!-- 蓝图名称 -->
FROM ${hggpSchema}.HGSC003
WHERE 1=1
<include refid="HGXSDataAuth.authCondition"/>
<isNotEmpty prepend=" AND " property="accountCode">
ACCOUNT_CODE = #accountCode#
</isNotEmpty>
......
......@@ -160,6 +160,12 @@
</dynamic>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hggpSchema}.HGSC004A WHERE 1=1
AND lv NOT IN (1,2)
<include refid="condition" />
</select>
<select id="queryAll" parameterClass="java.util.HashMap"
resultClass="com.baosight.hggp.hg.sc.domain.HGSC004A">
SELECT
......@@ -257,12 +263,6 @@
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hggpSchema}.HGSC004A WHERE 1=1
<include refid="condition" />
</select>
<insert id="insert">
INSERT INTO ${hggpSchema}.HGSC004A (id, <!-- 主键 -->
company_code, <!-- 公司编码(预留) -->
......
......@@ -196,6 +196,14 @@ public class HGSCTools {
}
}
public static class Hgsc003 {
public static HGSC003 getByBlueprintCode(String blueprintCode){
AssertUtils.isTrue(StringUtils.isBlank(blueprintCode), "蓝图编号不能为空!");
HGSC003 results = (HGSC003)DaoBase.getInstance().get(HGSC003.QUERY, HGSC003.FIELD_blueprint_code, blueprintCode);
return results;
}
}
public static class THGSC001A{
/**
......
......@@ -20,7 +20,7 @@
<div class="row">
<EF:EFSelect cname="公司名称" blockId="inqu_status" ename="companyCode" row="0" colWidth="3"
filter="contains" optionLabel="全部" defultValue="">
<EF:EFOptions blockId="company_code_block_id" textField="textField" valueField="valueField"/>
<EF:EFOptions blockId="roleCompany" valueField="companyCode" textField="companyName"/>
</EF:EFSelect>
<EF:EFSelect cname="供应商名称" blockId="inqu_status" ename="supCode" row="0" colWidth="3"
filter="contains" optionLabel="全部" defultValue="">
......
......@@ -2,7 +2,7 @@ $(function (){
var companyCodes = __eiInfo.getBlock("roleCompany").getMappedRows();
var projCodes = __eiInfo.getBlock("proj_record_block_id").getMappedRows();
var projCodes = __eiInfo.getBlock("projRecordByRole_block_id").getMappedRows();
$(".row").children().attr("class", "col-md-3");
......@@ -76,7 +76,7 @@ $(function (){
let dataSource;
EiCommunicator.send("HGSC003", "projComboBox", inInfo, {
onSuccess: function (ei) {
dataSource = ei.getBlock("proj_record_block_id").getMappedRows();
dataSource = ei.getBlock("projRecordByRole_block_id").getMappedRows();
},
onFail: function (ei) {
}
......
$(function (){
var companyCodes = __eiInfo.getBlock("companyBox_block_id").getMappedRows();
var companyCodes = __eiInfo.getBlock("roleCompany").getMappedRows();
var projCodes = __eiInfo.getBlock("proj_record_block_id").getMappedRows();
var projCodes = __eiInfo.getBlock("projRecordByRole_block_id").getMappedRows();
var blueprintCodes = __eiInfo.getBlock("blueprint_box_block_id").getMappedRows();
......@@ -43,9 +43,9 @@ $(function (){
field: "companyCode",
template: function (dataItem) {
for (let i = 0; i < companyCodes.length; i++) {
if (companyCodes[i]['valueField'] === dataItem['companyCode']){
dataItem['companyName'] = companyCodes[i]['textField']
return companyCodes[i]['textField'];
if (companyCodes[i]['companyCode'] === dataItem['companyCode']){
dataItem['companyName'] = companyCodes[i]['companyName']
return companyCodes[i]['companyName'];
}
}
return dataItem["companyCode"];
......@@ -62,7 +62,7 @@ $(function (){
}
}
}
return template;
return item.projCode;
},
editor: function (container, options) {
let inInfo = new EiInfo();
......@@ -72,7 +72,7 @@ $(function (){
let dataSource;
EiCommunicator.send("HGSC003", "projComboBox", inInfo, {
onSuccess: function (ei) {
dataSource = ei.getBlock("proj_record_block_id").getMappedRows();
dataSource = ei.getBlock("projRecordByRole_block_id").getMappedRows();
},
onFail: function (ei) {
}
......@@ -104,7 +104,7 @@ $(function (){
}
}
}
return template;
return item.blueprintCode;
},
editor: function (container, options) {
let inInfo = new EiInfo();
......@@ -112,10 +112,9 @@ $(function (){
inInfo.set("inqu_status-0-blueprintStatus", 1);
inInfo.set("inqu_status-0-projCode", options.model["projCode"]);
inInfo.set("field", options.field);
let dataSource;
EiCommunicator.send("HGSC003", "blueprintComboBox", inInfo, {
onSuccess: function (ei) {
dataSource = ei.getBlock("blueprint_box_block_id").getMappedRows();
blueprintCodes = ei.getBlock("blueprint_box_block_id").getMappedRows();
},
onFail: function (ei) {
}
......@@ -125,7 +124,7 @@ $(function (){
input.attr("id", options.field);
input.appendTo(container);
input.kendoDropDownList({
dataSource: dataSource,
dataSource: blueprintCodes,
minLength: 0,
dataTextField: "textField",
dataValueField: "valueField",
......
......@@ -26,14 +26,14 @@
<EF:EFGrid blockId="result" autoDraw="no" isFloat="true" copyToAdd="false">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="120" align="center"/>
<EF:EFComboColumn ename="companyCode" cname="公司名称"
<EF:EFComboColumn ename="companyCode" cname="公司编码"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" width="120" required="true"
maxLength="16" readonly="false" width="100" required="true"
align="center" filter="contains" sort="true">
<EF:EFOptions blockId="companyBox_block_id" textField="textField" valueField="valueField"/>
<EF:EFOptions blockId="roleCompany" textField="companyName" valueField="companyCode"/>
</EF:EFComboColumn>
<EF:EFColumn ename="companyName" cname="公司名称" hidden="true"/>
<EF:EFColumn ename="companyName" cname="公司名称" width="120" align="center" enable="false" hidden="true" />
<EF:EFColumn ename="projCode" cname="项目编码" enable="true" width="120" align="center" required="true"/>
<EF:EFColumn ename="projName" cname="项目名称" width="120" align="center" enable="false"/>
<EF:EFColumn ename="blueprintCode" cname="蓝图编码" enable="true" width="120" align="center" required="true"/>
......
......@@ -612,6 +612,7 @@ let save = function (btnNode) {
ok: function () {
JSUtils.submitGridsData("result", "HGSC004A", "save", true);
btnNode.attr("disabled", false);
refreshTree();
}
});
}
......@@ -652,9 +653,13 @@ function updateProductStatus(id,status) {
inEiInfo.set("result-0-materialId", $("#inqu_status-0-materialId").val());
EiCommunicator.send('HGSC004A', 'updateProductStatus', inEiInfo, {
onSuccess(response) {
if (response.status == 1){
NotificationUtil(response.msg);
query();
refreshTree();
}else {
NotificationUtil(response.msg, "error");
}
},
onFail(errorMessage, status, e) {
NotificationUtil("执行失败!", "error");
......@@ -673,9 +678,13 @@ function saveDetail() {
inEiInfo.setByNode("result");
EiCommunicator.send('HGSC004A', 'save', inEiInfo, {
onSuccess(response) {
if (response.status == 1){
NotificationUtil(response.msg);
query();
refreshTree();
}else {
NotificationUtil(response.msg, "error");
}
},
onFail(errorMessage, status, e) {
NotificationUtil("执行失败!", "error");
......@@ -699,9 +708,13 @@ function deteleDetail(id) {
inEiInfo.set("result-0-materialId", $("#inqu_status-0-materialId").val());
EiCommunicator.send('HGSC004A', 'delete', inEiInfo, {
onSuccess(response) {
if (response.status == 1){
NotificationUtil(response.msg);
query();
refreshTree();
}else {
NotificationUtil(response.msg, "error");
}
},
onFail(errorMessage, status, e) {
NotificationUtil("执行失败!", "error");
......@@ -737,7 +750,12 @@ let batchSubmit = function () {
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做提交操作吗? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGSC004A", "updateProductStatus", true);
JSUtils.submitGridsData("result", "HGSC004A", "updateProductStatus", true, function (e) {
var status = e.getStatus();
if (status !== -1) {
query();
}
});
}
});
}
......
......@@ -58,7 +58,7 @@
<EF:EFColumn ename="width" cname="宽(MM)" width="100" align="right" format="{0:N2}" maxLength="10" enable="false"/>
<EF:EFColumn ename="thick" cname="厚(MM)" width="100" align="right" format="{0:N2}" maxLength="10" enable="false"/>
<EF:EFColumn ename="quantity" required="true" cname="数量"/>
<EF:EFColumn ename="singleWeight" cname="单重(kg)" width="100" enable="true" readonly="true" format="{0:N3}" editType="text"
<EF:EFColumn ename="singleWeight" cname="单重(kg)" width="100" enable="true" format="{0:N3}" editType="text"
displayType="0.000" sort="true" align="right" maxLength="17" required="true" defaultValue="0"
data-regex="/^-?[0-9]{1,17}([.][0-9]{1,3})?$/"
data-errorprompt="请输入数字,该值最大可设置17位整数和3位小数!"/>
......
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