Commit 8e2ab56f by yukang

生产下料

parent e116e06b
......@@ -8,6 +8,7 @@ import com.baosight.hpjx.hp.kc.domain.HPKC005;
import com.baosight.hpjx.hp.kc.tools.HPKCTools;
import com.baosight.hpjx.hp.sc.domain.HPSC002;
import com.baosight.hpjx.hp.sc.domain.HPSC002A;
import com.baosight.hpjx.hp.sc.domain.HPSC006;
import com.baosight.hpjx.util.BeanUtils;
import com.baosight.hpjx.util.CommonMethod;
import com.baosight.hpjx.util.EiInfoUtils;
......@@ -20,6 +21,7 @@ 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.HashMap;
import java.util.List;
import java.util.Map;
......@@ -40,13 +42,26 @@ public class ServiceHPSC002A extends ServiceEPBase {
try {
// 查询物料ID所对应的项目名称和部件名称
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
List<HPSC002> dbSc002s = dao.query("HPSC002.query", queryMap);
if (CollectionUtils.isNotEmpty(dbSc002s)) {
HPSC002 dbSc002 = dbSc002s.get(0);
String bizType = inInfo.getString("inqu_status-0-bizType");
List<HPSC002> dbSc002s = new ArrayList<HPSC002>();
List<HPSC006> HPSC006 = new ArrayList<HPSC006>();
if (bizType.equals("WL")) {
dbSc002s = dao.query("HPSC002.query", queryMap);
} else if (bizType.equals("XL")) {
HPSC006 = dao.query("HPSC006.query", queryMap);
}
if (CollectionUtils.isNotEmpty(dbSc002s) || CollectionUtils.isNotEmpty(HPSC006)) {
inInfo.set("inqu_status-0-bizType", queryMap.get("bizType"));
inInfo.set("inqu_status-0-matId", queryMap.get("id"));
if (bizType.equals("WL")) {
HPSC002 dbSc002 = dbSc002s.get(0);
inInfo.set("inqu_status-0-projName", dbSc002.getProjName());
inInfo.set("inqu_status-0-prdtName", dbSc002.getPrdtName());
} else if (bizType.equals("XL")) {
HPSC006 dbSc002 = HPSC006.get(0);
inInfo.set("inqu_status-0-projName", dbSc002.getProjName());
inInfo.set("inqu_status-0-prdtName", dbSc002.getInventName());
}
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HPSC002A().eiMetadata);
}
} catch (PlatException e) {
......
......@@ -6,6 +6,7 @@ import com.baosight.hpjx.common.HPConstants;
import com.baosight.hpjx.core.constant.CommonConstant;
import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.hp.constant.HPConstant;
import com.baosight.hpjx.hp.pz.domain.HPPZ011;
import com.baosight.hpjx.hp.pz.tools.HPPZTools;
import com.baosight.hpjx.hp.sc.domain.*;
import com.baosight.hpjx.util.CommonMethod;
......@@ -208,4 +209,41 @@ public class ServiceHPSC006 extends ServiceBase {
return eiInfo;
}
/**
* 分派
* @param eiInfo
* @return
*/
public EiInfo assign(EiInfo eiInfo) {
try {
String ids = eiInfo.get("ids").toString();
String orgId = eiInfo.get("id").toString();
//先找到分派的组织
HPPZ011 HPPZ011 =(HPPZ011) dao.get("HPPZ011.get","id", orgId);
String [] id = ids.split(",");
for (int i = 0; i < id.length; i++) {
// 更新HPSC005的数据
HPSC006 HPSC006 = new HPSC006();
HPSC006.setId(NumberUtils.toLong(id[i]));
HPSC006.setStatus(1);
HPSC006.setOrgNo(HPPZ011.getGroupCode());
HPSC006.setFactoryCode(HPPZ011.getFactoryCode());
HPSC006.setFactoryName(HPPZ011.getFactoryName());
DaoUtils.update("HPSC006.updateAssign", HPSC006.toMap());
}
eiInfo.setStatus(EiConstant.STATUS_SUCCESS);
eiInfo.setMsg("分派成功!");
} catch (PlatException e) {
eiInfo.setStatus(EiConstant.STATUS_FAILURE);
eiInfo.setMsg("分派失败!原因参见详细错误描述!");
eiInfo.setDetailMsg(e.getMessage());
logError("分派失败", e.getMessage());
return eiInfo;
}
return query(eiInfo);
}
}
......@@ -279,4 +279,16 @@
ID = #id#
</update>
<update id="updateAssign">
UPDATE ${hpjxSchema}.T_HPSC006
SET
STATUS = #status#, <!-- 状态 0-未派工,1-已派工 -->
ORG_NO = #orgNo#, <!-- 生产组编码 -->
FACTORY_CODE = #factoryCode#, <!-- 厂区编码 -->
FACTORY_NAME = #factoryName#, <!-- 厂区名称 -->
UPDATED_BY = #updatedBy#, <!-- 更新人 -->
UPDATED_TIME = #updatedTime# <!-- 更新时间 -->
WHERE
ID = #id#
</update>
</sqlMap>
......@@ -377,7 +377,7 @@ function openUploadFile(id) {
*/
function showUploadFile(id) {
JSColorbox.open({
href: "HPSC002A?methodName=initLoad&inqu_status-0-bizType='WL'?inqu_status-0-id=" + id,
href: "HPSC002A?methodName=initLoad&inqu_status-0-bizType=WL&inqu_status-0-id=" + id,
title: "<div style='text-align: center;'>附件清单</div>",
width: "80%",
height: "80%",
......
......@@ -180,7 +180,7 @@ $(function () {
function showUploadFile(id) {
JSColorbox.open({
href: "HPSC002B?methodName=initLoad&inqu_status-0-bizType='WL'?inqu_status-0-id=" + id,
href: "HPSC002B?methodName=initLoad&inqu_status-0-bizType=WL&inqu_status-0-id=" + id,
title: "<div style='text-align: center;'>附件清单</div>",
width: "80%",
height: "80%",
......
......@@ -92,7 +92,7 @@ function jump(productionOrderNo) {
}
function showUploadFile(id) {
JSColorbox.open({
href: "HPSC002B?methodName=initLoad&inqu_status-0-bizType='WL'?inqu_status-0-id=" + id,
href: "HPSC002B?methodName=initLoad&inqu_status-0-bizType=WL&inqu_status-0-id=" + id,
title: "<div style='text-align: center;'>附件清单</div>",
width: "80%",
height: "80%",
......
......@@ -94,7 +94,7 @@ $(function () {
{
field: "operator",
template: function (item) {
let filePath1 = item.filePath1;
let filePath1 = item.id;
let template = '';
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="showUploadFile(' + filePath1 + ')" >附件清单</a>';
......@@ -119,7 +119,7 @@ query = function () {
}
function showUploadFile(id) {
JSColorbox.open({
href: "HPSC002A?methodName=initLoad&inqu_status-0-bizType='XL'?inqu_status-0-id=" + id,
href: "HPSC002A?methodName=initLoad&inqu_status-0-bizType=XL&inqu_status-0-id=" + id,
title: "<div style='text-align: center;'>附件清单</div>",
width: "80%",
height: "80%",
......@@ -129,7 +129,7 @@ assignCallback = function (id) {
var info = new EiInfo()
info.set("ids",ids.join(','));
info.set("id",id);
EiCommunicator.send("HPSC005","assign",info,{
EiCommunicator.send("HPSC006","assign",info,{
onSuccess:function(ei){//返回结果集
if (ei["status"] == -1) {
NotificationUtil(ei, "error");
......
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