Merge remote-tracking branch 'origin/main'
This commit is contained in:
commit
e3ce6d8831
|
|
@ -0,0 +1,73 @@
|
||||||
|
//
|
||||||
|
// Source code recreated from a .class file by IntelliJ IDEA
|
||||||
|
// (powered by FernFlower decompiler)
|
||||||
|
//
|
||||||
|
|
||||||
|
package nccloud.web.pu.arrival.action;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
import nc.pubitf.pu.m23.pubquery.IArrivePubQuery;
|
||||||
|
import nc.vo.ml.NCLangRes4VoTransl;
|
||||||
|
import nc.vo.pu.m23.entity.ArriveItemVO;
|
||||||
|
import nc.vo.pu.m23.entity.ArriveVO;
|
||||||
|
import nc.vo.pub.lang.UFDateTime;
|
||||||
|
import nccloud.dto.pu.arrival.entity.ExeInfo;
|
||||||
|
import nccloud.dto.pu.arrival.entity.PkTsParamsVO;
|
||||||
|
import nccloud.framework.core.exception.ExceptionUtils;
|
||||||
|
import nccloud.framework.core.json.IJson;
|
||||||
|
import nccloud.framework.service.ServiceLocator;
|
||||||
|
import nccloud.framework.web.action.itf.ICommonAction;
|
||||||
|
import nccloud.framework.web.container.IRequest;
|
||||||
|
import nccloud.framework.web.json.JsonFactory;
|
||||||
|
import nccloud.framework.web.ui.pattern.billcard.BillCard;
|
||||||
|
import nccloud.framework.web.ui.pattern.billcard.BillCardOperator;
|
||||||
|
import nccloud.pubitf.pu.arrival.service.IArrivalExeService;
|
||||||
|
import nccloud.web.pu.arrival.utis.ArrivalScalaSetter;
|
||||||
|
|
||||||
|
public class QCAction implements ICommonAction {
|
||||||
|
public QCAction() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public Object doAction(IRequest request) {
|
||||||
|
BillCard card = null;
|
||||||
|
|
||||||
|
try {
|
||||||
|
String read = request.read();
|
||||||
|
IJson json = JsonFactory.create();
|
||||||
|
ExeInfo info = (ExeInfo)json.fromJson(read, ExeInfo.class);
|
||||||
|
Map<String, UFDateTime> idTsMap = new HashMap();
|
||||||
|
if (info.getPkTsParams() != null && info.getPkTsParams().length > 0) {
|
||||||
|
for(PkTsParamsVO param : info.getPkTsParams()) {
|
||||||
|
idTsMap.put(param.getPk(), new UFDateTime(param.getTs()));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (idTsMap.size() > 0) {
|
||||||
|
IArrivePubQuery query = (IArrivePubQuery)ServiceLocator.find(IArrivePubQuery.class);
|
||||||
|
ArriveVO[] vos = query.queryAggVOByBids((String[])idTsMap.keySet().toArray(new String[idTsMap.keySet().size()]));
|
||||||
|
if (vos != null && vos.length > 0) {
|
||||||
|
for(ArriveItemVO item : vos[0].getBVO()) {
|
||||||
|
item.setTs((UFDateTime)idTsMap.get(item.getPk_arriveorder_b()));
|
||||||
|
}
|
||||||
|
|
||||||
|
IArrivalExeService service = (IArrivalExeService)ServiceLocator.find(IArrivalExeService.class);
|
||||||
|
ArriveVO[] retVOs = service.qualityCheck(vos);
|
||||||
|
BillCardOperator operator = new BillCardOperator(info.getPageid());
|
||||||
|
card = operator.toCard(retVOs[0]);
|
||||||
|
if (card != null) {
|
||||||
|
ArrivalScalaSetter.setArrivalScalaBillCard(card);
|
||||||
|
}
|
||||||
|
|
||||||
|
return card;
|
||||||
|
}
|
||||||
|
|
||||||
|
ExceptionUtils.wrapBusinessException(NCLangRes4VoTransl.getNCLangRes().getStrByID("4004100_0", "04004100-0003"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
ExceptionUtils.wrapException(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -80,6 +80,7 @@ public class MaterialToGyMesListener implements IBusinessListener {
|
||||||
* 构建同步数据
|
* 构建同步数据
|
||||||
*/
|
*/
|
||||||
private void buildSyncData(MaterialVO[] useVOs, String eventType) throws BusinessException {
|
private void buildSyncData(MaterialVO[] useVOs, String eventType) throws BusinessException {
|
||||||
|
BaseDAO baseDAO = new BaseDAO();
|
||||||
JSONArray dataArr = new JSONArray();
|
JSONArray dataArr = new JSONArray();
|
||||||
for (MaterialVO vo : useVOs) {
|
for (MaterialVO vo : useVOs) {
|
||||||
String pkMaterial = vo.getPk_material();
|
String pkMaterial = vo.getPk_material();
|
||||||
|
|
@ -137,6 +138,11 @@ public class MaterialToGyMesListener implements IBusinessListener {
|
||||||
singleObj.put("backflushMethod", prodMap.get("conversemethod")); // 倒冲方式
|
singleObj.put("backflushMethod", prodMap.get("conversemethod")); // 倒冲方式
|
||||||
singleObj.put("postCompletionProcessing", prodMap.get("wghxcl")); // 完工后续处理
|
singleObj.put("postCompletionProcessing", prodMap.get("wghxcl")); // 完工后续处理
|
||||||
}
|
}
|
||||||
|
// ¿â´æ¹©»õ×éÖ¯±àÂë»ñÈ¡
|
||||||
|
String mrlsql = "select code from org_stockorg where pk_stockorg = '" + stockMap.get("pk_suplystockorg") + "' ";
|
||||||
|
Map<String, Object> stockorg = (Map<String, Object>) baseDAO.executeQuery(mrlsql, new MapProcessor());
|
||||||
|
singleObj.put("supplyInventoryOrg", stockorg.get("code"));// ¿â´æ¹©»õ×éÖ¯
|
||||||
|
|
||||||
singleObj.put("bipCreateBy", creatorName); // 创建人
|
singleObj.put("bipCreateBy", creatorName); // 创建人
|
||||||
dataArr.add(singleObj);
|
dataArr.add(singleObj);
|
||||||
/**
|
/**
|
||||||
|
|
@ -215,7 +221,7 @@ public class MaterialToGyMesListener implements IBusinessListener {
|
||||||
}
|
}
|
||||||
|
|
||||||
private Map getStockInfo(String pkMaterial) throws BusinessException {
|
private Map getStockInfo(String pkMaterial) throws BusinessException {
|
||||||
String sql = " select martype, wholemanaflag, outpriority, remain,bd_stordoc.code as pk_stordoc" +
|
String sql = " select pk_suplystockorg, martype, wholemanaflag, outpriority, remain,bd_stordoc.code as pk_stordoc" +
|
||||||
" from bd_materialstock left join bd_stordoc on bd_stordoc.pk_stordoc = bd_materialstock.pk_stordoc " +
|
" from bd_materialstock left join bd_stordoc on bd_stordoc.pk_stordoc = bd_materialstock.pk_stordoc " +
|
||||||
" where pk_material = '" + pkMaterial + "' " + " and bd_materialstock.pk_org = '" + orgId + "' ";
|
" where pk_material = '" + pkMaterial + "' " + " and bd_materialstock.pk_org = '" + orgId + "' ";
|
||||||
Map map = (Map) new BaseDAO().executeQuery(sql, new MapProcessor());
|
Map map = (Map) new BaseDAO().executeQuery(sql, new MapProcessor());
|
||||||
|
|
|
||||||
|
|
@ -116,6 +116,7 @@ public class MaterialToGyMesListener implements IBusinessListener {
|
||||||
* 构建同步数据
|
* 构建同步数据
|
||||||
*/
|
*/
|
||||||
private void buildSyncData(MaterialVO[] useVOs, String eventType) throws BusinessException {
|
private void buildSyncData(MaterialVO[] useVOs, String eventType) throws BusinessException {
|
||||||
|
BaseDAO baseDAO = new BaseDAO();
|
||||||
JSONArray dataArr = new JSONArray();
|
JSONArray dataArr = new JSONArray();
|
||||||
for (MaterialVO vo : useVOs) {
|
for (MaterialVO vo : useVOs) {
|
||||||
String pkMaterial = vo.getPk_material();
|
String pkMaterial = vo.getPk_material();
|
||||||
|
|
@ -172,6 +173,11 @@ public class MaterialToGyMesListener implements IBusinessListener {
|
||||||
singleObj.put("backflushMethod", prodMap.get("conversemethod")); // 倒冲方式
|
singleObj.put("backflushMethod", prodMap.get("conversemethod")); // 倒冲方式
|
||||||
singleObj.put("postCompletionProcessing", prodMap.get("wghxcl")); // 完工后续处理
|
singleObj.put("postCompletionProcessing", prodMap.get("wghxcl")); // 完工后续处理
|
||||||
}
|
}
|
||||||
|
// ¿â´æ¹©»õ×éÖ¯±àÂë»ñÈ¡
|
||||||
|
String mrlsql = "select code from org_stockorg where pk_stockorg = '" + stockMap.get("pk_suplystockorg") + "' ";
|
||||||
|
Map<String, Object> stockorg = (Map<String, Object>) baseDAO.executeQuery(mrlsql, new MapProcessor());
|
||||||
|
singleObj.put("supplyInventoryOrg", stockorg.get("code"));// ¿â´æ¹©»õ×éÖ¯
|
||||||
|
|
||||||
singleObj.put("bipCreateBy", creatorName); // 创建人
|
singleObj.put("bipCreateBy", creatorName); // 创建人
|
||||||
dataArr.add(singleObj);
|
dataArr.add(singleObj);
|
||||||
/**
|
/**
|
||||||
|
|
@ -298,7 +304,7 @@ public class MaterialToGyMesListener implements IBusinessListener {
|
||||||
}
|
}
|
||||||
|
|
||||||
private Map getStockInfo(String pkMaterial) throws BusinessException {
|
private Map getStockInfo(String pkMaterial) throws BusinessException {
|
||||||
String sql = " select martype, wholemanaflag, outpriority, remain,bd_stordoc.code as pk_stordoc" +
|
String sql = " select pk_suplystockorg, martype, wholemanaflag, outpriority, remain,bd_stordoc.code as pk_stordoc" +
|
||||||
" from bd_materialstock left join bd_stordoc on bd_stordoc.pk_stordoc = bd_materialstock.pk_stordoc " +
|
" from bd_materialstock left join bd_stordoc on bd_stordoc.pk_stordoc = bd_materialstock.pk_stordoc " +
|
||||||
" where pk_material = '" + pkMaterial + "' " + " and bd_materialstock.pk_org = '" + orgId + "' ";
|
" where pk_material = '" + pkMaterial + "' " + " and bd_materialstock.pk_org = '" + orgId + "' ";
|
||||||
Map map = (Map) new BaseDAO().executeQuery(sql, new MapProcessor());
|
Map map = (Map) new BaseDAO().executeQuery(sql, new MapProcessor());
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue