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);
......
......@@ -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