parent
82dc5f4717
commit
53e6d53ace
|
|
@ -49,20 +49,23 @@ public class CasPaybillController {
|
|||
List<ApiResultExt.ResultBean> results = new ArrayList<>();
|
||||
ApiResultExt resultExt = new ApiResultExt();
|
||||
List<String> billnos = new ArrayList<>();
|
||||
HashMap<String, String> billStatusMap = new HashMap<>();
|
||||
HashMap<String, String> billIdMap = new HashMap<>();
|
||||
Set<String> validValues = new HashSet<>();
|
||||
validValues.add("4");
|
||||
validValues.add("5");
|
||||
validValues.add("6");
|
||||
validValues.add("7");
|
||||
validValues.add("8");
|
||||
HashMap<String, JSONObject> billStatusMap = new HashMap<>();
|
||||
// HashMap<String, String> billIdMap = new HashMap<>();
|
||||
// Set<String> validValues = new HashSet<>();
|
||||
// validValues.add("4");
|
||||
// validValues.add("5");
|
||||
// validValues.add("6");
|
||||
// validValues.add("7");
|
||||
// validValues.add("8");
|
||||
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd"); // 目标日期格式
|
||||
for (int i = 0; i < data.size(); i++) {
|
||||
HashMap<String, Object> dataMap = data.get(i);
|
||||
String billno = (String) dataMap.get("billno");
|
||||
billnos.add(billno);
|
||||
billStatusMap.put(billno, (String) dataMap.get("billstatus"));
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("billstatus",dataMap.get("billstatus"));
|
||||
jsonObject.put("tqq9_digital_receipt",dataMap.get("tqq9_digital_receipt"));
|
||||
billStatusMap.put(billno, jsonObject);
|
||||
}
|
||||
QFilter qFilter = new QFilter("billno", QCP.in, billnos);
|
||||
DynamicObject[] cas_paybills = BusinessDataServiceHelper.load(Constants.CAS_PAYBILL, LC_PAYBILL_PROPERTIES, qFilter.toArray());
|
||||
|
|
@ -98,16 +101,16 @@ public class CasPaybillController {
|
|||
resultBean.setId(cas_paybill.getString("id"));
|
||||
resultBean.setBillStatus(true);
|
||||
iserror = false;
|
||||
if(!validValues.contains((String)dataMap.get("billstatus"))){
|
||||
ArrayList<String> rowMsg = error.getRowMsg();
|
||||
rowMsg.add("传入编号:" + billno + "的交易状态有误");
|
||||
error.setRowMsg(rowMsg);
|
||||
error.setEntityKey(Constants.CAS_PAYBILL);
|
||||
error.setKeys(keys);
|
||||
resultBean.setId("");
|
||||
resultBean.setBillStatus(false);
|
||||
index++;
|
||||
}
|
||||
// if(!validValues.contains((String)dataMap.get("billstatus"))){
|
||||
// ArrayList<String> rowMsg = error.getRowMsg();
|
||||
// rowMsg.add("传入编号:" + billno + "的交易状态有误");
|
||||
// error.setRowMsg(rowMsg);
|
||||
// error.setEntityKey(Constants.CAS_PAYBILL);
|
||||
// error.setKeys(keys);
|
||||
// resultBean.setId("");
|
||||
// resultBean.setBillStatus(false);
|
||||
// index++;
|
||||
// }
|
||||
}
|
||||
}
|
||||
if (iserror) {
|
||||
|
|
@ -126,25 +129,30 @@ public class CasPaybillController {
|
|||
OperateOption option = OperateOption.create();
|
||||
|
||||
for (DynamicObject cas_paybill : cas_paybills) {
|
||||
String billstatus = billStatusMap.get(cas_paybill.getString("billno"));
|
||||
if (StringUtils.equals("5", billstatus)) {
|
||||
// cas_paybill.set("billstatus", "D");
|
||||
JSONObject json = billStatusMap.get(cas_paybill.getString("billno"));
|
||||
String billstatus = json.getString("billstatus");
|
||||
String tqq9_digital_receipt = json.getString("tqq9_digital_receipt");
|
||||
if (StringUtils.equals("D", billstatus)) {
|
||||
OperationResult payResult = OperationServiceHelper.executeOperate(Constants.TYPE_PAY, Constants.CAS_PAYBILL, new DynamicObject[]{cas_paybill}, option);
|
||||
List<IOperateInfo> allErrorOrValidateInfo = payResult.getAllErrorOrValidateInfo();
|
||||
if (!allErrorOrValidateInfo.isEmpty()) {
|
||||
if (!payResult.isSuccess()) {
|
||||
index++;
|
||||
for (IOperateInfo iOperateInfo : allErrorOrValidateInfo) {
|
||||
HashMap<String, Object> returnMap = resultExt.addErrorToResultBeanByNumber(results, iOperateInfo, Constants.CAS_PAYBILL);
|
||||
results = (List<ApiResultExt.ResultBean>) returnMap.get("ResultBeanList");
|
||||
}
|
||||
}else{
|
||||
cas_paybill.set("tqq9_digital_receipt", tqq9_digital_receipt);
|
||||
SaveServiceHelper.save(new DynamicObject[]{cas_paybill});
|
||||
|
||||
}
|
||||
for (IOperateInfo iOperateInfo : allErrorOrValidateInfo) {
|
||||
HashMap<String, Object> returnMap = resultExt.addErrorToResultBeanByNumber(results, iOperateInfo, Constants.CAS_PAYBILL);
|
||||
results = (List<ApiResultExt.ResultBean>) returnMap.get("ResultBeanList");
|
||||
}
|
||||
} else if (StringUtils.equals("4", billstatus) || StringUtils.equals("6", billstatus)) {
|
||||
} else if (StringUtils.equals("F", billstatus) ) {
|
||||
cas_paybill.set("billstatus", "F");
|
||||
SaveServiceHelper.save(new DynamicObject[]{cas_paybill});
|
||||
} else if (StringUtils.equals("7", billstatus)) {
|
||||
} else if (StringUtils.equals("E", billstatus)) {
|
||||
cas_paybill.set("billstatus", "E");
|
||||
SaveServiceHelper.save(new DynamicObject[]{cas_paybill});
|
||||
} else if (StringUtils.equals("8", billstatus)) {
|
||||
} else if (StringUtils.equals("G", billstatus)) {
|
||||
cas_paybill.set("billstatus", "G");
|
||||
SaveServiceHelper.save(new DynamicObject[]{cas_paybill});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -176,6 +176,7 @@ public class WMSPurInController {
|
|||
for (Object detail : details) {
|
||||
JSONObject detail1 = (JSONObject) detail;
|
||||
String entryId = detail1.getString("erpDetailId");//金蝶源头单据细单号
|
||||
String wmsDetailId = detail1.getString("wmsDetailId");//WMS入库单细单号
|
||||
BigDecimal quantity = detail1.getBigDecimal("quantity");//入库数量
|
||||
String uniqueCode = detail1.getString("uniqueCode");//商品编码
|
||||
Date manufactureDate = detail1.getDate("manufactureDate");//生产日期
|
||||
|
|
@ -185,6 +186,7 @@ public class WMSPurInController {
|
|||
String licenceCode = detail1.getString("licenceCode");//生产许可证
|
||||
String producer = detail1.getString("producer");//生产厂商
|
||||
detailObject.put("entryId", entryId);
|
||||
detailObject.put("wmsDetailId", wmsDetailId);
|
||||
detailObject.put("uniqueCode", uniqueCode);
|
||||
detailObject.put("quantity", quantity);
|
||||
detailObject.put("manufactureDate", manufactureDate);
|
||||
|
|
|
|||
|
|
@ -169,6 +169,7 @@ public class WMSSaleOutController {
|
|||
for (Object detail : details) {
|
||||
JSONObject detail1 = (JSONObject) detail;
|
||||
String entryId = detail1.getString("erpDetailId");//金蝶源头单据细单号
|
||||
String wmsDetailId = detail1.getString("wmsDetailId");//WMS入库单细单号
|
||||
BigDecimal quantity = detail1.getBigDecimal("quantity");//出库数量
|
||||
String uniqueCode = detail1.getString("uniqueCode");//商品编码
|
||||
Date manufactureDate = detail1.getDate("manufactureDate");//生产日期
|
||||
|
|
@ -178,6 +179,7 @@ public class WMSSaleOutController {
|
|||
String licenceCode = detail1.getString("licenceCode");//生产许可证
|
||||
String producer = detail1.getString("producer");//生产厂商
|
||||
detailObject.put("entryId", entryId);
|
||||
detailObject.put("wmsDetailId", wmsDetailId);
|
||||
detailObject.put("uniqueCode", uniqueCode);
|
||||
detailObject.put("quantity", quantity);
|
||||
detailObject.put("manufactureDate", manufactureDate);
|
||||
|
|
|
|||
|
|
@ -193,7 +193,7 @@ public class OtherOutApplyBillPlugin extends AbstractBillPlugIn implements Befor
|
|||
Date date = new Date();
|
||||
dataEntity.set("tqq9_bizdate", date);
|
||||
dataEntity.set("tqq9_dblx", "A");//调拨类型
|
||||
dataEntity.set("tqq9_dbckfl", "C");//调拨出库分类
|
||||
dataEntity.set("tqq9_dbckfl", "G");//调拨出库分类
|
||||
dataEntity.set("org", org);//组织
|
||||
dataEntity.set("tqq9_dczz1", org);//调出组织
|
||||
dataEntity.set("tqq9_drck2", org);//调入组织
|
||||
|
|
|
|||
|
|
@ -22,9 +22,14 @@ public class DownloadAttachmentPlugin extends AbstractBillPlugIn implements Plug
|
|||
super.itemClick(evt);
|
||||
String itemKey = evt.getItemKey();
|
||||
if (StringUtils.equals("tqq9_download", itemKey)) {
|
||||
String tqq9_zcztplj = this.getModel().getValue("tqq9_zcztplj").toString();
|
||||
if (StringUtils.isNotBlank(tqq9_zcztplj)) {
|
||||
this.getView().openUrl(tqq9_zcztplj);
|
||||
String url = "";
|
||||
url = this.getModel().getValue("tqq9_zcztplj_tag").toString();
|
||||
if (StringUtils.isBlank(url)) {
|
||||
url = this.getModel().getValue("tqq9_zcztplj").toString();
|
||||
}
|
||||
String[] split = url.split(",");
|
||||
for (String s : split) {
|
||||
this.getView().openUrl(s);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -74,6 +74,7 @@ public class PurInConvertPlugin extends AbstractConvertPlugIn implements Plugin
|
|||
quantity = new BigDecimal(jsonMap.get("quantity").toString()).negate();//入库数量
|
||||
}
|
||||
String batch = jsonMap.get("batch") != null ? jsonMap.get("batch").toString() : null; // 批次
|
||||
String wmsDetailId = jsonMap.get("wmsDetailId") != null ? jsonMap.get("wmsDetailId").toString() : null; // WMS分录id
|
||||
String uniqueCode = jsonMap.get("uniqueCode") != null ? jsonMap.get("uniqueCode").toString() : null; // 商品编码
|
||||
String registrationCode = jsonMap.get("registrationCode") != null ? jsonMap.get("registrationCode").toString() : null; // 注册证号
|
||||
String licenceCode = jsonMap.get("licenceCode") != null ? jsonMap.get("licenceCode").toString() : null; // 生产许可证号
|
||||
|
|
@ -87,6 +88,7 @@ public class PurInConvertPlugin extends AbstractConvertPlugIn implements Plugin
|
|||
entry.set("producedate", manufactureDate);
|
||||
entry.set("expirydate", expirationDate);
|
||||
entry.set("lotnumber", batch);
|
||||
entry.set("tqq9_wmsdetailid", wmsDetailId);
|
||||
entry.set("tqq9_licenseno", licenceCode);
|
||||
entry.set("tqq9_registration", tqq9_registration);
|
||||
entry.set("tqq9_proxyandfactory", tqq9_proxyandfactory);
|
||||
|
|
|
|||
|
|
@ -75,6 +75,7 @@ public class SaleOutBillConvertPlugin extends AbstractConvertPlugIn implements P
|
|||
expirationDate = new Date(expiration.longValue()); //失效期
|
||||
}
|
||||
String batch = jsonMap.get("batch") != null ? jsonMap.get("batch").toString() : null; // 批次
|
||||
String wmsDetailId = jsonMap.get("wmsDetailId") != null ? jsonMap.get("wmsDetailId").toString() : null; // WMS分录id
|
||||
String uniqueCode = jsonMap.get("uniqueCode") != null ? jsonMap.get("uniqueCode").toString() : null; // 商品编码
|
||||
String registrationCode = jsonMap.get("registrationCode") != null ? jsonMap.get("registrationCode").toString() : null; // 注册证号
|
||||
String licenceCode = jsonMap.get("licenceCode") != null ? jsonMap.get("licenceCode").toString() : null; // 生产许可证号
|
||||
|
|
@ -88,6 +89,7 @@ public class SaleOutBillConvertPlugin extends AbstractConvertPlugIn implements P
|
|||
entry.set("producedate", manufactureDate);
|
||||
entry.set("expirydate", expirationDate);
|
||||
entry.set("lotnumber", batch);
|
||||
entry.set("tqq9_wmsdetailid", wmsDetailId);
|
||||
entry.set("tqq9_licenseno", licenceCode);
|
||||
entry.set("tqq9_registration", tqq9_registration);
|
||||
entry.set("tqq9_sccs", tqq9_proxyandfactory);
|
||||
|
|
|
|||
Loading…
Reference in New Issue