|
|
@@ -10,10 +10,13 @@ import java.util.UUID;
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
|
|
|
+import org.apache.commons.logging.LogFactory;
|
|
|
+
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.min.util.DateUtil;
|
|
|
import com.minpay.common.service.IPublicService;
|
|
|
+import com.minpay.common.util.Base64;
|
|
|
import com.minpay.common.util.CommonUtil;
|
|
|
import com.minpay.common.util.HttpPostUtil;
|
|
|
import com.minpay.db.table.mapper.ApCompanyInfMapper;
|
|
|
@@ -29,6 +32,7 @@ import com.minpay.db.table.model.ApProductInf;
|
|
|
import com.minpay.db.table.model.ApTransferFlow;
|
|
|
import com.startup.minpay.frame.business.IMINAction;
|
|
|
import com.startup.minpay.frame.business.res.MINActionResult;
|
|
|
+import com.startup.minpay.frame.constant.IMINTransactionEnum;
|
|
|
import com.startup.minpay.frame.exception.MINBusinessException;
|
|
|
import com.startup.minpay.frame.service.base.IMINDataBaseService;
|
|
|
import com.startup.minpay.frame.service.base.Service;
|
|
|
@@ -40,6 +44,7 @@ import net.sf.json.JSONObject;
|
|
|
|
|
|
@MINComponent
|
|
|
public class TransManageAction implements IMINAction{
|
|
|
+ private static org.apache.commons.logging.Log logger = LogFactory.getLog(TransManageAction.class);
|
|
|
|
|
|
/**供应商传输 */
|
|
|
public final static String SUPPLIER_TRANSMISSION = "supplierTransmission";
|
|
|
@@ -64,17 +69,16 @@ public class TransManageAction implements IMINAction{
|
|
|
* @throws MINBusinessException
|
|
|
* @throws IOException
|
|
|
*/
|
|
|
- @MINAction(value = SUPPLIER_TRANSMISSION,session = false)
|
|
|
+ @MINAction(value = SUPPLIER_TRANSMISSION,session = false, transaction=IMINTransactionEnum.CMT)
|
|
|
public MINActionResult supplierTransmission(
|
|
|
HttpServletRequest request
|
|
|
) throws MINBusinessException, IOException{
|
|
|
MINActionResult res = new MINActionResult();
|
|
|
|
|
|
- int count = 0;
|
|
|
String GUID = request.getParameter("GUID");
|
|
|
String HEADER = request.getParameter("HEADER");
|
|
|
- System.out.println(HEADER);
|
|
|
-
|
|
|
+ logger.info("GUID:"+GUID);
|
|
|
+ logger.info("HEADER:"+HEADER);
|
|
|
//获取当前时间
|
|
|
String currentTime = DateUtil.getCurrentDateTimeString();
|
|
|
res.set("GUID", GUID);
|
|
|
@@ -100,10 +104,10 @@ public class TransManageAction implements IMINAction{
|
|
|
}
|
|
|
//统一社会信用代码---税号
|
|
|
String TAXNUMXL = CommonUtil.objToString(jsonHeader.get("TAXNUMXL"));
|
|
|
- if(CommonUtil.isEmpty(TAXNUMXL)){
|
|
|
+ /*if(CommonUtil.isEmpty(TAXNUMXL)){
|
|
|
throw new MINBusinessException("TAXNUMXL不可为空!");
|
|
|
- }
|
|
|
- if(TAXNUMXL.length() > 50){
|
|
|
+ }*/
|
|
|
+ if(TAXNUMXL != null && TAXNUMXL.length() > 50){
|
|
|
throw new MINBusinessException("TAXNUMXL长度太长!");
|
|
|
}
|
|
|
|
|
|
@@ -161,7 +165,7 @@ public class TransManageAction implements IMINAction{
|
|
|
companyInfo.setId(id);
|
|
|
//修改时间
|
|
|
companyInfo.setModifyTime(currentTime);
|
|
|
- count = Service.lookup(IMINDataBaseService.class).getMybatisMapper(ApCompanyInfMapper.class).updateByPrimaryKeySelective(companyInfo);
|
|
|
+ Service.lookup(IMINDataBaseService.class).getMybatisMapper(ApCompanyInfMapper.class).updateByPrimaryKeySelective(companyInfo);
|
|
|
|
|
|
}else{
|
|
|
//不存在--新增
|
|
|
@@ -172,7 +176,7 @@ public class TransManageAction implements IMINAction{
|
|
|
companyInfo.setProjectCode("00001");
|
|
|
//部门
|
|
|
companyInfo.setBranchId("100002|100005|100197");
|
|
|
- count = Service.lookup(IMINDataBaseService.class).getMybatisMapper(ApCompanyInfMapper.class).insertSelective(companyInfo);
|
|
|
+ Service.lookup(IMINDataBaseService.class).getMybatisMapper(ApCompanyInfMapper.class).insertSelective(companyInfo);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -180,15 +184,13 @@ public class TransManageAction implements IMINAction{
|
|
|
e.printStackTrace();
|
|
|
res.set("STATUS", "E");
|
|
|
res.set("MESSAGE", "失败");
|
|
|
+ logger.info("status:error message:"+e.getMessage());
|
|
|
+ return res;
|
|
|
}
|
|
|
|
|
|
- if(count == 1){
|
|
|
- res.set("STATUS", "S");
|
|
|
- res.set("MESSAGE", "成功");
|
|
|
- }else{
|
|
|
- res.set("STATUS", "E");
|
|
|
- res.set("MESSAGE", "失败");
|
|
|
- }
|
|
|
+ res.set("STATUS", "S");
|
|
|
+ res.set("MESSAGE", "成功");
|
|
|
+ logger.info("status : success");
|
|
|
return res;
|
|
|
}
|
|
|
|
|
|
@@ -200,115 +202,125 @@ public class TransManageAction implements IMINAction{
|
|
|
* @return
|
|
|
* @throws MINBusinessException
|
|
|
*/
|
|
|
- @MINAction(value = CUSTOMER_TRANSMISSION,session = false)
|
|
|
+ @MINAction(value = CUSTOMER_TRANSMISSION,session = false, transaction = IMINTransactionEnum.CMT)
|
|
|
public MINActionResult customerTransmission(
|
|
|
HttpServletRequest request
|
|
|
) throws MINBusinessException{
|
|
|
MINActionResult res = new MINActionResult();
|
|
|
|
|
|
- int count = 0;
|
|
|
String GUID = request.getParameter("GUID");
|
|
|
String HEADER = request.getParameter("HEADER");
|
|
|
+ logger.info("action:customerTransmission");
|
|
|
+ logger.info("GUID:"+GUID);
|
|
|
+ logger.info("HEADER:"+HEADER);
|
|
|
res.set("GUID", GUID);
|
|
|
//获取当前日期
|
|
|
String currentTime = DateUtil.getCurrentDateTimeString();
|
|
|
try {
|
|
|
- JSONObject jsonHeader = JSONObject.fromObject(HEADER);
|
|
|
- //供应商编号----ERP客商编码
|
|
|
- String PARTNER = CommonUtil.objToString(jsonHeader.get("PARTNER"));
|
|
|
- if(CommonUtil.isEmpty(PARTNER)){
|
|
|
- throw new MINBusinessException("PARTNER不可为空!");
|
|
|
- }
|
|
|
- if(PARTNER.length() > 20){
|
|
|
- throw new MINBusinessException("PARTNER长度太长!");
|
|
|
- }
|
|
|
- //供应商描述---客户名称
|
|
|
- String NAME_ORG1 = CommonUtil.objToString(jsonHeader.get("NAME_ORG1"));
|
|
|
- if(CommonUtil.isEmpty(NAME_ORG1)){
|
|
|
- throw new MINBusinessException("NAME_ORG1不可为空!");
|
|
|
- }
|
|
|
- if(NAME_ORG1.length() > 30){
|
|
|
- throw new MINBusinessException("NAME_ORG1长度太长!");
|
|
|
- }
|
|
|
- //统一社会信用代码---税号
|
|
|
- String ZZ_TAXNUM = CommonUtil.objToString(jsonHeader.get("ZZ_TAXNUM"));
|
|
|
- if(CommonUtil.isEmpty(ZZ_TAXNUM)){
|
|
|
- throw new MINBusinessException("ZZ_TAXNUM不可为空!");
|
|
|
- }
|
|
|
- if(ZZ_TAXNUM.length() > 50){
|
|
|
- throw new MINBusinessException("ZZ_TAXNUM长度太长!");
|
|
|
- }
|
|
|
- //简称
|
|
|
- String ZYLZD1 = CommonUtil.objToString(jsonHeader.get("ZYLZD1"));
|
|
|
- if(!CommonUtil.isEmpty(ZYLZD1)){
|
|
|
- if(ZYLZD1.length() > 30){
|
|
|
- throw new MINBusinessException("ZYLZD1长度太长!");
|
|
|
+ JSONArray jsonHeaderArray = JSONArray.parseArray(HEADER);
|
|
|
+ for(Object object : jsonHeaderArray) {
|
|
|
+ Map jsonHeader = (Map)object;
|
|
|
+ //供应商编号----ERP客商编码
|
|
|
+ String PARTNER = CommonUtil.objToString(jsonHeader.get("PARTNER"));
|
|
|
+ if(CommonUtil.isEmpty(PARTNER)){
|
|
|
+ throw new MINBusinessException("PARTNER不可为空!");
|
|
|
}
|
|
|
- }
|
|
|
- //客户首字母
|
|
|
- String ZYLZD2 = CommonUtil.objToString(jsonHeader.get("ZYLZD2"));
|
|
|
- if(!CommonUtil.isEmpty(ZYLZD2)){
|
|
|
- if(ZYLZD2.length() > 20){
|
|
|
- throw new MINBusinessException("ZYLZD2长度太长!");
|
|
|
+ if(PARTNER.length() > 20){
|
|
|
+ throw new MINBusinessException("PARTNER长度太长!");
|
|
|
+ }
|
|
|
+ //供应商描述---客户名称
|
|
|
+ String NAME_ORG1 = CommonUtil.objToString(jsonHeader.get("NAME_ORG1"));
|
|
|
+ if(CommonUtil.isEmpty(NAME_ORG1)){
|
|
|
+ throw new MINBusinessException("NAME_ORG1不可为空!");
|
|
|
+ }
|
|
|
+ if(NAME_ORG1.length() > 30){
|
|
|
+ throw new MINBusinessException("NAME_ORG1长度太长!");
|
|
|
+ }
|
|
|
+ //统一社会信用代码---税号
|
|
|
+ String ZZ_TAXNUM = CommonUtil.objToString(jsonHeader.get("ZZ_TAXNUM"));
|
|
|
+ /*if(CommonUtil.isEmpty(ZZ_TAXNUM)){
|
|
|
+ throw new MINBusinessException("ZZ_TAXNUM不可为空!");
|
|
|
+ }*/
|
|
|
+ if(ZZ_TAXNUM != null && ZZ_TAXNUM.length() > 50){
|
|
|
+ throw new MINBusinessException("ZZ_TAXNUM长度太长!");
|
|
|
+ }
|
|
|
+ //简称
|
|
|
+ String ZYLZD1 = CommonUtil.objToString(jsonHeader.get("ZYLZD1"));
|
|
|
+ if(!CommonUtil.isEmpty(ZYLZD1)){
|
|
|
+ if(ZYLZD1.length() > 30){
|
|
|
+ throw new MINBusinessException("ZYLZD1长度太长!");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //客户首字母
|
|
|
+ String ZYLZD2 = CommonUtil.objToString(jsonHeader.get("ZYLZD2"));
|
|
|
+ if(!CommonUtil.isEmpty(ZYLZD2)){
|
|
|
+ if(ZYLZD2.length() > 20){
|
|
|
+ throw new MINBusinessException("ZYLZD2长度太长!");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //系统内外
|
|
|
+ String ZYLZD3 = CommonUtil.objToString(jsonHeader.get("ZYLZD3"));
|
|
|
+ //客户类型 MM-采购 SD--销售
|
|
|
+ //String ZYLZD4 = CommonUtil.objToString(jsonHeader.get("ZYLZD4"));
|
|
|
+ //查询客户是否存在
|
|
|
+ ApCompanyInfExample example = new ApCompanyInfExample();
|
|
|
+ example.createCriteria().andErpCodeEqualTo(PARTNER).andStateEqualTo("00");
|
|
|
+ List<ApCompanyInf> list = Service.lookup(IMINDataBaseService.class).getMybatisMapper(ApCompanyInfMapper.class).selectByExample(example);
|
|
|
+
|
|
|
+ ApCompanyInf companyInfo = new ApCompanyInf();
|
|
|
+ //ERP客商编码
|
|
|
+ companyInfo.setErpCode(PARTNER);
|
|
|
+ //客户名称
|
|
|
+ companyInfo.setName(NAME_ORG1);
|
|
|
+ //税号
|
|
|
+ companyInfo.setDutyParagraph(ZZ_TAXNUM);
|
|
|
+ //简称
|
|
|
+ companyInfo.setShortName(ZYLZD1);
|
|
|
+ //客户首字母
|
|
|
+ companyInfo.setInitial(ZYLZD2);
|
|
|
+ //系统内外 TODO 需做处理
|
|
|
+ //系统内外
|
|
|
+ if("内".equals(ZYLZD3)) {
|
|
|
+ companyInfo.setType("00");
|
|
|
+ } else {
|
|
|
+ companyInfo.setType("01");
|
|
|
+ }
|
|
|
+ /*if("MM".equals(ZYLZD4)){
|
|
|
+ companyInfo.setBuyType("00");
|
|
|
+ }else if("SD".equals(ZYLZD4)){
|
|
|
+ companyInfo.setBuyType("01");
|
|
|
+ }*/
|
|
|
+ companyInfo.setBuyType("02");
|
|
|
+ //存在---做修改
|
|
|
+ if(list.size() > 0){
|
|
|
+ String id = list.get(0).getId();
|
|
|
+ companyInfo.setId(id);
|
|
|
+ //修改时间
|
|
|
+ companyInfo.setModifyTime(currentTime);
|
|
|
+ Service.lookup(IMINDataBaseService.class).getMybatisMapper(ApCompanyInfMapper.class).updateByPrimaryKeySelective(companyInfo);
|
|
|
+ }else{
|
|
|
+ //不存在--新增
|
|
|
+ String id = Service.lookup(IPublicService.class).getSequence("AP_CUSTOMER_INF_ID");
|
|
|
+ companyInfo.setId(id);
|
|
|
+ //部门
|
|
|
+ companyInfo.setBranchId("100002|100005|100197");
|
|
|
+ companyInfo.setProjectCode("00001");
|
|
|
+ //创建时间
|
|
|
+ companyInfo.setCreateTime(currentTime);
|
|
|
+ Service.lookup(IMINDataBaseService.class).getMybatisMapper(ApCompanyInfMapper.class).insertSelective(companyInfo);
|
|
|
}
|
|
|
- }
|
|
|
- //系统内外
|
|
|
- String ZYLZD3 = CommonUtil.objToString(jsonHeader.get("ZYLZD3"));
|
|
|
- //客户类型 MM-采购 SD--销售
|
|
|
- String ZYLZD4 = CommonUtil.objToString(jsonHeader.get("ZYLZD4"));
|
|
|
- //查询客户是否存在
|
|
|
- ApCompanyInfExample example = new ApCompanyInfExample();
|
|
|
- example.createCriteria().andErpCodeEqualTo(PARTNER).andStateEqualTo("00");
|
|
|
- List<ApCompanyInf> list = Service.lookup(IMINDataBaseService.class).getMybatisMapper(ApCompanyInfMapper.class).selectByExample(example);
|
|
|
-
|
|
|
- ApCompanyInf companyInfo = new ApCompanyInf();
|
|
|
- //ERP客商编码
|
|
|
- companyInfo.setErpCode(PARTNER);
|
|
|
- //客户名称
|
|
|
- companyInfo.setName(NAME_ORG1);
|
|
|
- //税号
|
|
|
- companyInfo.setDutyParagraph(ZZ_TAXNUM);
|
|
|
- //简称
|
|
|
- companyInfo.setShortName(ZYLZD1);
|
|
|
- //客户首字母
|
|
|
- companyInfo.setInitial(ZYLZD2);
|
|
|
- //系统内外 TODO 需做处理
|
|
|
- companyInfo.setType(ZYLZD3);
|
|
|
- if("MM".equals(ZYLZD4)){
|
|
|
- companyInfo.setBuyType("00");
|
|
|
- }else if("SD".equals(ZYLZD4)){
|
|
|
- companyInfo.setBuyType("01");
|
|
|
- }
|
|
|
- //存在---做修改
|
|
|
- if(list.size() > 0){
|
|
|
- String id = list.get(0).getId();
|
|
|
- companyInfo.setId(id);
|
|
|
- //修改时间
|
|
|
- companyInfo.setModifyTime(currentTime);
|
|
|
- count = Service.lookup(IMINDataBaseService.class).getMybatisMapper(ApCompanyInfMapper.class).updateByPrimaryKeySelective(companyInfo);
|
|
|
- }else{
|
|
|
- //不存在--新增
|
|
|
- String id = Service.lookup(IPublicService.class).getSequence("AP_CUSTOMER_INF_ID");
|
|
|
- companyInfo.setId(id);
|
|
|
- //部门
|
|
|
- companyInfo.setBranchId("100002|100005|100197");
|
|
|
- companyInfo.setProjectCode("00001");
|
|
|
- //创建时间
|
|
|
- companyInfo.setCreateTime(currentTime);
|
|
|
- count = Service.lookup(IMINDataBaseService.class).getMybatisMapper(ApCompanyInfMapper.class).insertSelective(companyInfo);
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
res.set("STATUS", "E");
|
|
|
res.set("MESSAGE", "失败");
|
|
|
+ logger.info("status:error message:"+e.getMessage());
|
|
|
+ return res;
|
|
|
}
|
|
|
|
|
|
- if(count == 1){
|
|
|
- res.set("STATUS", "S");
|
|
|
- res.set("MESSAGE", "成功");
|
|
|
- }else{
|
|
|
- res.set("STATUS", "E");
|
|
|
- res.set("MESSAGE", "失败");
|
|
|
- }
|
|
|
+ res.set("STATUS", "S");
|
|
|
+ res.set("MESSAGE", "成功");
|
|
|
+ logger.info("status : success");
|
|
|
return res;
|
|
|
}
|
|
|
|
|
|
@@ -337,13 +349,7 @@ public class TransManageAction implements IMINAction{
|
|
|
public MINActionResult purchaseOrderTransmission(
|
|
|
@MINParam(key ="orderId") String orderId,
|
|
|
@MINParam(key ="erpPostingDate") String erpPostingDate,
|
|
|
- @MINParam(key ="transferNum") String transferNum,
|
|
|
- @MINParam(key ="preSettlement") String preSettlement,
|
|
|
- @MINParam(key ="realPrice") String realPrice,
|
|
|
- @MINParam(key ="actualTotal") String actualTotal,
|
|
|
- @MINParam(key ="preTotal") String preTotal,
|
|
|
- @MINParam(key ="aoiTransferredNum") String aoiTransferredNum,
|
|
|
- @MINParam(key ="aoiRemainingTransNum") String aoiRemainingTransNum
|
|
|
+ @MINParam(key ="tableListStr") String tableListStr
|
|
|
) throws MINBusinessException{
|
|
|
ApOrderInf order = Service.lookup(IMINDataBaseService.class).getMybatisMapper(ApOrderInfMapper.class).selectByPrimaryKey(orderId);
|
|
|
String contractId = order.getContractId();
|
|
|
@@ -354,21 +360,7 @@ public class TransManageAction implements IMINAction{
|
|
|
if(CommonUtil.isEmpty(erpPostingDate)){
|
|
|
throw new MINBusinessException("ERP过账日期不可为空!");
|
|
|
}
|
|
|
- //查询铝锭产品信息 --上海铝锭
|
|
|
- ApProductInf productInf = Service.lookup(IMINDataBaseService.class).getMybatisMapper(ApProductInfMapper.class).selectByPrimaryKey("O100000073");
|
|
|
- if(productInf == null){
|
|
|
- throw new MINBusinessException("获取产品信息失败!");
|
|
|
- }
|
|
|
- //获取ERP物料编码
|
|
|
- String MATNR = productInf.getErpCode();
|
|
|
- if(CommonUtil.isEmpty(MATNR)){
|
|
|
- throw new MINBusinessException("请先维护产品的ERP物料编码!");
|
|
|
- }
|
|
|
- //获取单位换算比例
|
|
|
- String Z_RATIO = productInf.getUnitRatio();
|
|
|
- if(CommonUtil.isEmpty(Z_RATIO)){
|
|
|
- throw new MINBusinessException("请先维护产品的单位换算比例!");
|
|
|
- }
|
|
|
+
|
|
|
MINActionResult res = new MINActionResult();
|
|
|
Map<Object, Object> requestBody = new HashMap<>();
|
|
|
String GUID = UUID.randomUUID().toString().replaceAll("-", "");
|
|
|
@@ -387,19 +379,36 @@ public class TransManageAction implements IMINAction{
|
|
|
//采购组织
|
|
|
hederMap.put("EKORG","2405");
|
|
|
//采购组
|
|
|
+ if(CommonUtil.isEmpty(contractInf.getPurchaseTeam())) {
|
|
|
+ throw new MINBusinessException("合同采购组未维护,请先在合同编辑中维护采购组!");
|
|
|
+ }
|
|
|
hederMap.put("EKGRP",contractInf.getPurchaseTeam());
|
|
|
//公司代码
|
|
|
hederMap.put("BUKRS","2405");
|
|
|
//凭证类型
|
|
|
hederMap.put("BSART", "C001");
|
|
|
//订单名称
|
|
|
+ if(CommonUtil.isEmpty(order.getName())) {
|
|
|
+ throw new MINBusinessException("订单名称不可为空!");
|
|
|
+ }
|
|
|
hederMap.put("Z_DSPT_NO", order.getName());
|
|
|
//法务合同号
|
|
|
+ if(CommonUtil.isEmpty(contractInf.getLegalContractNo())) {
|
|
|
+ throw new MINBusinessException("合同法务合同号未维护,请先在合同编辑中填写!");
|
|
|
+ }
|
|
|
hederMap.put("ZZCONTRACTCODE", contractInf.getLegalContractNo());
|
|
|
//ERP客户编码
|
|
|
+ if(CommonUtil.isEmpty(companyInf.getErpCode())) {
|
|
|
+ throw new MINBusinessException("客户暂无ERP编码!");
|
|
|
+ }
|
|
|
hederMap.put("KUNNR", companyInf.getErpCode());
|
|
|
//单据日期
|
|
|
+ if(CommonUtil.isEmpty(erpPostingDate)) {
|
|
|
+ throw new MINBusinessException("请选择单据日期!");
|
|
|
+ }
|
|
|
hederMap.put("AUDAT", erpPostingDate);
|
|
|
+ // 客户名称
|
|
|
+ hederMap.put("NAME1", companyInf.getName());
|
|
|
//合同类型长单---Y 其他--N
|
|
|
if("00".equals(contractInf.getContractType())){
|
|
|
hederMap.put("Z_FLAG","Y");
|
|
|
@@ -408,63 +417,83 @@ public class TransManageAction implements IMINAction{
|
|
|
}
|
|
|
List<Map<String,String>> list = new ArrayList<>();
|
|
|
hederMap.put("item", list);
|
|
|
- Map<String,String> itemMap = new HashMap<>();
|
|
|
- //行号
|
|
|
- itemMap.put("POSNR", "1");
|
|
|
- //物料编号
|
|
|
- itemMap.put("MATNR",MATNR);
|
|
|
- //物料描述
|
|
|
- itemMap.put("ARKTX", "");
|
|
|
- //本次传输数量
|
|
|
- itemMap.put("MENGE",transferNum);
|
|
|
- //单位换算比例
|
|
|
- itemMap.put("Z_RATIO",Z_RATIO);
|
|
|
- //单价有实际单价传实际单价,无实际单价,传预结算单价
|
|
|
- if(CommonUtil.compare(preSettlement, "0") == 1){
|
|
|
- itemMap.put("Z_PRICE", preSettlement);
|
|
|
- }else{
|
|
|
- itemMap.put("Z_PRICE",realPrice);
|
|
|
+ JSONArray tableList = JSONArray.parseArray(tableListStr);
|
|
|
+ for(int i = 0; i < tableList.size(); i ++) {
|
|
|
+ Map data = (Map)tableList.get(i);
|
|
|
+ Map<String,String> itemMap = new HashMap<>();
|
|
|
+ ApProductInf productInf = Service.lookup(IMINDataBaseService.class).getMybatisMapper(ApProductInfMapper.class).selectByPrimaryKey(data.get("product").toString());
|
|
|
+ //行号
|
|
|
+ itemMap.put("POSNR", i+1+"");
|
|
|
+ //物料编号
|
|
|
+ if(CommonUtil.isEmpty(productInf.getErpCode())) {
|
|
|
+ throw new MINBusinessException(productInf.getName()+"未维护ERP物料编号,请在牌价管理中编辑对应物料编号!");
|
|
|
+ }
|
|
|
+ itemMap.put("MATNR",productInf.getErpCode());
|
|
|
+ //物料描述
|
|
|
+ itemMap.put("ARKTX", "");
|
|
|
+ //本次传输数量
|
|
|
+ if(data.get("weight") == null || CommonUtil.isEmpty(data.get("weight").toString())) {
|
|
|
+ throw new MINBusinessException("第"+(i+1)+"行数据未填写传输重量!");
|
|
|
+ }
|
|
|
+ itemMap.put("MENGE",data.get("weight").toString());
|
|
|
+ //单位换算比例
|
|
|
+ if(CommonUtil.isEmpty(productInf.getUnitRatio())) {
|
|
|
+ throw new MINBusinessException(productInf.getName()+"未维护单位换算比例,请在牌价管理中编辑对应单位换算比例!");
|
|
|
+ }
|
|
|
+ itemMap.put("Z_RATIO",productInf.getUnitRatio());
|
|
|
+ // 单价
|
|
|
+ if(data.get("price") == null || CommonUtil.isEmpty(data.get("price").toString())) {
|
|
|
+ throw new MINBusinessException("第"+(i+1)+"行数据未填写价格!");
|
|
|
+ }
|
|
|
+ itemMap.put("Z_PRICE", data.get("price").toString());
|
|
|
+ //总金额
|
|
|
+ if(data.get("amount") == null || CommonUtil.isEmpty(data.get("amount").toString())) {
|
|
|
+ throw new MINBusinessException("第"+(i+1)+"行数据未填写总金额!");
|
|
|
+ }
|
|
|
+ itemMap.put("Z_VALUE", data.get("amount").toString());
|
|
|
+ //税码
|
|
|
+ itemMap.put("MWSKZ","J3");
|
|
|
+ //工厂
|
|
|
+ itemMap.put("WERKS","2405");
|
|
|
+ //库存地点
|
|
|
+ itemMap.put("LGORT","A001");
|
|
|
+ list.add(itemMap);
|
|
|
}
|
|
|
- //总金额 有实际结算总价传实际结算总价,无实际结算总价,传预结算总价
|
|
|
- if(CommonUtil.compare(preTotal, "0") == 1){
|
|
|
- itemMap.put("Z_VALUE", preTotal);
|
|
|
+
|
|
|
+ //调用
|
|
|
+ String url = Service.lookup(IPublicService.class).getSysParValue("TRANSFER_ORDER_URL");
|
|
|
+ String user = Service.lookup(IPublicService.class).getSysParValue("TRANSFER_ORDER_USER");
|
|
|
+ String pass = Service.lookup(IPublicService.class).getSysParValue("TRANSFER_ORDER_PASS");
|
|
|
+ System.out.println(com.alibaba.fastjson.JSONObject.toJSONString(requestBody));
|
|
|
+ String result = HttpPostUtil.sendPostRequest(url+"LDDZSW/MM858", requestBody, user, pass);
|
|
|
+ System.out.println(result);
|
|
|
+ //{"GUID":"17d342743c474a1ca22c7e56e5ed3337","RETURN":[{"STATUS":"S","MESSAGE":" [采购订单创建成功] [订单审批成功] [订单收货成功]","Z_DSPY_NO":"DC22-0607-WXGL01","EBELN":4500010225}]}
|
|
|
+ JSONObject resultJson = JSONObject.fromObject(result);
|
|
|
+ //SAP销售订单号
|
|
|
+ net.sf.json.JSONArray returnObject = resultJson.getJSONArray("RETURN");
|
|
|
+
|
|
|
+ //获取订单信息
|
|
|
+ ApOrderInf orderInfo = Service.lookup(IMINDataBaseService.class).getMybatisMapper(ApOrderInfMapper.class).selectByPrimaryKey(orderId);
|
|
|
+ //获取ERP单号
|
|
|
+ String erpNo = orderInfo.getErpNo();
|
|
|
+ //SAP销售订单号
|
|
|
+ Map EBELNMap = (Map)(returnObject.get(0));
|
|
|
+ String EBELN = EBELNMap.get("EBELN").toString();
|
|
|
+ //ERP单号为空
|
|
|
+ if(!CommonUtil.isEmpty(erpNo)){
|
|
|
+ //erp单号
|
|
|
+ orderInfo.setErpNo(erpNo+"/"+EBELN);
|
|
|
}else{
|
|
|
- itemMap.put("Z_VALUE",actualTotal);
|
|
|
+ //erp单号
|
|
|
+ orderInfo.setErpNo(EBELN);
|
|
|
}
|
|
|
- //税码
|
|
|
- itemMap.put("MWSKZ","J3");
|
|
|
- //工厂
|
|
|
- itemMap.put("WERKS","2405");
|
|
|
- //库存地点
|
|
|
- itemMap.put("LGORT","A001");
|
|
|
- list.add(itemMap);
|
|
|
- try {
|
|
|
- //调用
|
|
|
- String url = Service.lookup(IPublicService.class).getSysParValue("TRANSFER_ORDER_URL");
|
|
|
- String user = Service.lookup(IPublicService.class).getSysParValue("TRANSFER_ORDER_USER");
|
|
|
- String pass = Service.lookup(IPublicService.class).getSysParValue("TRANSFER_ORDER_PASS");
|
|
|
- System.out.println(com.alibaba.fastjson.JSONObject.toJSONString(requestBody));
|
|
|
- String result = HttpPostUtil.sendPostRequest(url+"CGFH/MM858", requestBody, user, pass);
|
|
|
- System.out.println(result);
|
|
|
- //SAP销售订单号
|
|
|
- String VBELN = "";
|
|
|
- //获取订单信息
|
|
|
- ApOrderInf orderInfo = Service.lookup(IMINDataBaseService.class).getMybatisMapper(ApOrderInfMapper.class).selectByPrimaryKey(orderId);
|
|
|
- //获取ERP单号
|
|
|
- String erpNo = orderInfo.getErpNo();
|
|
|
- //ERP单号为空
|
|
|
- if(!CommonUtil.isEmpty(erpNo)){
|
|
|
- //erp单号
|
|
|
- orderInfo.setErpNo(erpNo+"/"+VBELN);
|
|
|
- }else{
|
|
|
- //erp单号
|
|
|
- orderInfo.setErpNo(VBELN);
|
|
|
- }
|
|
|
-
|
|
|
- //修改时间
|
|
|
- orderInfo.setModifyTime(TIMESTAMP);
|
|
|
- //修改订单
|
|
|
- Service.lookup(IMINDataBaseService.class).getMybatisMapper(ApOrderInfMapper.class).updateByPrimaryKeySelective(orderInfo);
|
|
|
+
|
|
|
+ //修改时间
|
|
|
+ orderInfo.setModifyTime(TIMESTAMP);
|
|
|
+ //修改订单
|
|
|
+ Service.lookup(IMINDataBaseService.class).getMybatisMapper(ApOrderInfMapper.class).updateByPrimaryKeySelective(orderInfo);
|
|
|
+ for(int i = 0; i < tableList.size(); i ++) {
|
|
|
+ Map data = (Map)tableList.get(i);
|
|
|
//生成订单传输流水
|
|
|
String flowId = Service.lookup(IPublicService.class).getSequence("AP_TRANST_ORDER_FLOW_ID");
|
|
|
ApTransferFlow flow = new ApTransferFlow();
|
|
|
@@ -477,33 +506,26 @@ public class TransManageAction implements IMINAction{
|
|
|
//erp过账日期
|
|
|
flow.setErpDate(erpPostingDate);
|
|
|
//已传输数量
|
|
|
- flow.setTransferredNum(aoiTransferredNum);
|
|
|
+ flow.setTransferredNum("");
|
|
|
//本次传输数量
|
|
|
- flow.setTransferNum(aoiTransferredNum);
|
|
|
+ flow.setTransferNum(data.get("weight").toString());
|
|
|
//剩余传输数量
|
|
|
- flow.setRemainingTransNum(aoiRemainingTransNum);
|
|
|
+ flow.setRemainingTransNum("");
|
|
|
//预结算单价
|
|
|
- flow.setPrePrice(preSettlement);
|
|
|
+ flow.setPrePrice("");
|
|
|
//实际单价
|
|
|
- flow.setRealPrice(realPrice);
|
|
|
+ flow.setRealPrice(data.get("price").toString());
|
|
|
//预结算总价
|
|
|
- flow.setPreTotal(preTotal);
|
|
|
+ flow.setPreTotal("");
|
|
|
//实际结算总价
|
|
|
- flow.setRealTotal(actualTotal);
|
|
|
+ flow.setRealTotal(data.get("amount").toString());
|
|
|
//erp单号
|
|
|
- flow.setErpNo(VBELN);
|
|
|
+ flow.setErpNo(EBELN);
|
|
|
//创建时间
|
|
|
flow.setCreateTime(TIMESTAMP);
|
|
|
//创建人 TODO
|
|
|
Service.lookup(IMINDataBaseService.class).getMybatisMapper(ApTransferFlowMapper.class).insertSelective(flow);
|
|
|
- } catch (Exception e) {
|
|
|
- e.printStackTrace();
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
return res;
|
|
|
}
|
|
|
|
|
|
@@ -516,7 +538,6 @@ public class TransManageAction implements IMINAction{
|
|
|
* @param buyerNameAll
|
|
|
* @param erpPostingDate
|
|
|
* @param contractType
|
|
|
- * @param transferNum
|
|
|
* @param preSettlement
|
|
|
* @param realPrice
|
|
|
* @param actualTotal
|
|
|
@@ -528,15 +549,8 @@ public class TransManageAction implements IMINAction{
|
|
|
@MINAction(value = SALE_ORDER_TRANSMISSION,session = false)
|
|
|
public MINActionResult saleOrderTransmission(
|
|
|
@MINParam(key ="orderId") String orderId,
|
|
|
- @MINParam(key ="buyerNameAll") String buyerNameAll,
|
|
|
@MINParam(key ="erpPostingDate") String erpPostingDate,
|
|
|
- @MINParam(key ="transferNum") String transferNum,
|
|
|
- @MINParam(key ="preSettlement") String preSettlement,
|
|
|
- @MINParam(key ="realPrice") String realPrice,
|
|
|
- @MINParam(key ="actualTotal") String actualTotal,
|
|
|
- @MINParam(key ="preTotal") String preTotal,
|
|
|
- @MINParam(key ="aoiTransferredNum") String aoiTransferredNum,
|
|
|
- @MINParam(key ="aoiRemainingTransNum") String aoiRemainingTransNum
|
|
|
+ @MINParam(key ="tableListStr") String tableListStr
|
|
|
) throws MINBusinessException{
|
|
|
ApOrderInf order = Service.lookup(IMINDataBaseService.class).getMybatisMapper(ApOrderInfMapper.class).selectByPrimaryKey(orderId);
|
|
|
String contractId = order.getContractId();
|
|
|
@@ -551,27 +565,7 @@ public class TransManageAction implements IMINAction{
|
|
|
if(CommonUtil.isEmpty(erpPostingDate)){
|
|
|
throw new MINBusinessException("ERP过账日期不可为空!");
|
|
|
}
|
|
|
- //查询铝锭产品信息 --上海铝锭
|
|
|
- ApProductInf productInf = Service.lookup(IMINDataBaseService.class).getMybatisMapper(ApProductInfMapper.class).selectByPrimaryKey("O100000073");
|
|
|
- if(productInf == null){
|
|
|
- throw new MINBusinessException("获取产品信息失败!");
|
|
|
- }
|
|
|
- //获取ERP物料编码
|
|
|
- String MATNR = productInf.getErpCode();
|
|
|
- if(CommonUtil.isEmpty(MATNR)){
|
|
|
- throw new MINBusinessException("请先维护产品的ERP物料编码!");
|
|
|
- }
|
|
|
- //获取单位换算比例
|
|
|
- String Z_RATIO = productInf.getUnitRatio();
|
|
|
- if(CommonUtil.isEmpty(Z_RATIO)){
|
|
|
- throw new MINBusinessException("请先维护产品的单位换算比例!");
|
|
|
- }
|
|
|
- if(CommonUtil.isEmpty(aoiTransferredNum)){
|
|
|
- throw new MINBusinessException("已传输数量不可为空!");
|
|
|
- }
|
|
|
- if(CommonUtil.isEmpty(aoiRemainingTransNum)){
|
|
|
- throw new MINBusinessException("剩余传输数量不可为空!");
|
|
|
- }
|
|
|
+
|
|
|
MINActionResult res = new MINActionResult();
|
|
|
Map<Object, Object> requestBody = new HashMap<>();
|
|
|
String GUID = UUID.randomUUID().toString().replaceAll("-", "");
|
|
|
@@ -595,15 +589,28 @@ public class TransManageAction implements IMINAction{
|
|
|
hederMap.put("SPART","10");
|
|
|
//订单类型
|
|
|
hederMap.put("AUART","Z040");
|
|
|
+ if(CommonUtil.isEmpty(orderName)){
|
|
|
+ throw new MINBusinessException("订单名称不可为空!");
|
|
|
+ }
|
|
|
//电商系统单号
|
|
|
hederMap.put("Z_DSPT_NO", orderName);
|
|
|
//法务合同号
|
|
|
+ //法务合同号
|
|
|
+ if(CommonUtil.isEmpty(legalContractNo)) {
|
|
|
+ throw new MINBusinessException("合同法务合同号未维护,请先在合同编辑中填写!");
|
|
|
+ }
|
|
|
hederMap.put("BSTNK", legalContractNo);
|
|
|
//ERP客户编码
|
|
|
+ if(CommonUtil.isEmpty(buyerErpCode)) {
|
|
|
+ throw new MINBusinessException("客户暂无ERP编码!");
|
|
|
+ }
|
|
|
hederMap.put("KUNNR", buyerErpCode);
|
|
|
//客户名称
|
|
|
- hederMap.put("NAME1", buyerNameAll);
|
|
|
+ hederMap.put("NAME1", companyInf.getName());
|
|
|
//单据日期
|
|
|
+ if(CommonUtil.isEmpty(erpPostingDate)) {
|
|
|
+ throw new MINBusinessException("请选择单据日期!");
|
|
|
+ }
|
|
|
hederMap.put("AUDAT", erpPostingDate);
|
|
|
//合同类型长单---Y 其他--N
|
|
|
if("00".equals(contractType)){
|
|
|
@@ -613,61 +620,82 @@ public class TransManageAction implements IMINAction{
|
|
|
}
|
|
|
List<Map<String,String>> list = new ArrayList<>();
|
|
|
hederMap.put("item", list);
|
|
|
- Map<String,String> itemMap = new HashMap<>();
|
|
|
- //行号
|
|
|
- itemMap.put("POSNR", "1");
|
|
|
- //物料编号
|
|
|
- itemMap.put("MATNR",MATNR);
|
|
|
- //物料描述
|
|
|
- itemMap.put("ARKTX", "");
|
|
|
- //本次传输数量
|
|
|
- itemMap.put("KWMENG",transferNum);
|
|
|
- //单位换算比例
|
|
|
- itemMap.put("Z_RATIO",Z_RATIO);
|
|
|
- //单价有实际单价传实际单价,无实际单价,传预结算单价
|
|
|
- if(CommonUtil.compare(preSettlement, "0") == 1){
|
|
|
- itemMap.put("Z_PRICE", preSettlement);
|
|
|
- }else{
|
|
|
- itemMap.put("Z_PRICE",realPrice);
|
|
|
+ JSONArray tableList = JSONArray.parseArray(tableListStr);
|
|
|
+ for(int i = 0; i < tableList.size(); i ++) {
|
|
|
+ Map data = (Map)tableList.get(i);
|
|
|
+ Map<String,String> itemMap = new HashMap<>();
|
|
|
+ ApProductInf productInf = Service.lookup(IMINDataBaseService.class).getMybatisMapper(ApProductInfMapper.class).selectByPrimaryKey(data.get("product").toString());
|
|
|
+
|
|
|
+ //行号
|
|
|
+ itemMap.put("POSNR", i+1+"");
|
|
|
+ //物料编号
|
|
|
+ if(CommonUtil.isEmpty(productInf.getErpCode())) {
|
|
|
+ throw new MINBusinessException(productInf.getName()+"未维护ERP物料编号,请在牌价管理中编辑对应物料编号!");
|
|
|
+ }
|
|
|
+ itemMap.put("MATNR", productInf.getErpCode());
|
|
|
+ //物料描述
|
|
|
+ itemMap.put("ARKTX", "");
|
|
|
+ //本次传输数量
|
|
|
+ if(data.get("weight") == null || CommonUtil.isEmpty(data.get("weight").toString())) {
|
|
|
+ throw new MINBusinessException("第"+(i+1)+"行数据未填写传输重量!");
|
|
|
+ }
|
|
|
+ itemMap.put("KWMENG", data.get("weight").toString());
|
|
|
+ //单位换算比例
|
|
|
+ if(CommonUtil.isEmpty(productInf.getUnitRatio())) {
|
|
|
+ throw new MINBusinessException(productInf.getName()+"未维护单位换算比例,请在牌价管理中编辑对应单位换算比例!");
|
|
|
+ }
|
|
|
+ itemMap.put("Z_RATIO", productInf.getUnitRatio());
|
|
|
+ // 单价
|
|
|
+ if(data.get("price") == null || CommonUtil.isEmpty(data.get("price").toString())) {
|
|
|
+ throw new MINBusinessException("第"+(i+1)+"行数据未填写价格!");
|
|
|
+ }
|
|
|
+ itemMap.put("Z_PRICE", data.get("price").toString());
|
|
|
+ //总金额
|
|
|
+ if(data.get("amount") == null || CommonUtil.isEmpty(data.get("amount").toString())) {
|
|
|
+ throw new MINBusinessException("第"+(i+1)+"行数据未填写总金额!");
|
|
|
+ }
|
|
|
+ itemMap.put("Z_VALUE", data.get("amount").toString());
|
|
|
+ //工厂
|
|
|
+ itemMap.put("WERKS","2405");
|
|
|
+ //库存地点
|
|
|
+ itemMap.put("LGORT","A001");
|
|
|
+ list.add(itemMap);
|
|
|
}
|
|
|
- //总金额 有实际结算总价传实际结算总价,无实际结算总价,传预结算总价
|
|
|
- if(CommonUtil.compare(preTotal, "0") == 1){
|
|
|
- itemMap.put("Z_VALUE", preTotal);
|
|
|
+
|
|
|
+
|
|
|
+ String url = Service.lookup(IPublicService.class).getSysParValue("TRANSFER_ORDER_URL");
|
|
|
+ String user = Service.lookup(IPublicService.class).getSysParValue("TRANSFER_ORDER_USER");
|
|
|
+ String pass = Service.lookup(IPublicService.class).getSysParValue("TRANSFER_ORDER_PASS");
|
|
|
+ //调用
|
|
|
+ System.out.println(JSON.toJSONString(requestBody));
|
|
|
+ String result = HttpPostUtil.sendPostRequest(url+"LDDZSW/SD418", requestBody, user, pass);
|
|
|
+ System.out.println("result:======"+result);
|
|
|
+ //{"GUID":"142d8a14bd2c43cda8e037e0d492c14b","RETURN":[{"STATUS":"S","MESSAGE":" [销售订单创建成功]","Z_DSPY_NO":"DX22-1107-TK01","VBELN":"0020003034"}]}
|
|
|
+ JSONObject resultJson = JSONObject.fromObject(result);
|
|
|
+ //SAP销售订单号
|
|
|
+ net.sf.json.JSONArray returnObject = resultJson.getJSONArray("RETURN");
|
|
|
+ //获取订单信息
|
|
|
+ ApOrderInf orderInfo = Service.lookup(IMINDataBaseService.class).getMybatisMapper(ApOrderInfMapper.class).selectByPrimaryKey(orderId);
|
|
|
+ //获取ERP单号
|
|
|
+ String erpNo = orderInfo.getErpNo();
|
|
|
+ Map VBELNMap = (Map)(returnObject.get(0));
|
|
|
+ String VBELN = VBELNMap.get("VBELN").toString();
|
|
|
+ //ERP单号为空
|
|
|
+ if(!CommonUtil.isEmpty(erpNo)){
|
|
|
+ //erp单号
|
|
|
+ orderInfo.setErpNo(erpNo+"/"+VBELN);
|
|
|
}else{
|
|
|
- itemMap.put("Z_VALUE",actualTotal);
|
|
|
+ //erp单号
|
|
|
+ orderInfo.setErpNo(VBELN);
|
|
|
}
|
|
|
- //工厂
|
|
|
- itemMap.put("WERKS","2405");
|
|
|
- //库存地点
|
|
|
- itemMap.put("LGORT","A001");
|
|
|
- list.add(itemMap);
|
|
|
- try {
|
|
|
- String url = Service.lookup(IPublicService.class).getSysParValue("TRANSFER_ORDER_URL");
|
|
|
- String user = Service.lookup(IPublicService.class).getSysParValue("TRANSFER_ORDER_USER");
|
|
|
- String pass = Service.lookup(IPublicService.class).getSysParValue("TRANSFER_ORDER_PASS");
|
|
|
- //调用
|
|
|
- System.out.println(JSON.toJSONString(requestBody));
|
|
|
- String result = HttpPostUtil.sendPostRequest(url+"XSFH/SD418", requestBody, user, pass);
|
|
|
- System.out.println("result:======"+result);
|
|
|
- //SAP销售订单号
|
|
|
- String VBELN = "";
|
|
|
- //获取订单信息
|
|
|
- ApOrderInf orderInfo = Service.lookup(IMINDataBaseService.class).getMybatisMapper(ApOrderInfMapper.class).selectByPrimaryKey(orderId);
|
|
|
- //获取ERP单号
|
|
|
- String erpNo = orderInfo.getErpNo();
|
|
|
- //ERP单号为空
|
|
|
- if(!CommonUtil.isEmpty(erpNo)){
|
|
|
- //erp单号
|
|
|
- orderInfo.setErpNo(erpNo+"/"+VBELN);
|
|
|
- }else{
|
|
|
- //erp单号
|
|
|
- orderInfo.setErpNo(VBELN);
|
|
|
- }
|
|
|
-
|
|
|
- //修改时间
|
|
|
- orderInfo.setModifyTime(TIMESTAMP);
|
|
|
- //修改订单
|
|
|
- Service.lookup(IMINDataBaseService.class).getMybatisMapper(ApOrderInfMapper.class).updateByPrimaryKeySelective(orderInfo);
|
|
|
+
|
|
|
+ //修改时间
|
|
|
+ orderInfo.setModifyTime(TIMESTAMP);
|
|
|
+ //修改订单
|
|
|
+ Service.lookup(IMINDataBaseService.class).getMybatisMapper(ApOrderInfMapper.class).updateByPrimaryKeySelective(orderInfo);
|
|
|
+
|
|
|
+ for(int i = 0; i < tableList.size(); i ++) {
|
|
|
+ Map data = (Map)tableList.get(i);
|
|
|
//生成订单传输流水
|
|
|
String flowId = Service.lookup(IPublicService.class).getSequence("AP_TRANST_ORDER_FLOW_ID");
|
|
|
ApTransferFlow flow = new ApTransferFlow();
|
|
|
@@ -680,43 +708,30 @@ public class TransManageAction implements IMINAction{
|
|
|
//erp过账日期
|
|
|
flow.setErpDate(erpPostingDate);
|
|
|
//已传输数量
|
|
|
- flow.setTransferredNum(aoiTransferredNum);
|
|
|
+ flow.setTransferredNum("");
|
|
|
//本次传输数量
|
|
|
- flow.setTransferNum(aoiTransferredNum);
|
|
|
+ flow.setTransferNum(data.get("weight").toString());
|
|
|
//剩余传输数量
|
|
|
- flow.setRemainingTransNum(aoiRemainingTransNum);
|
|
|
+ flow.setRemainingTransNum("");
|
|
|
//预结算单价
|
|
|
- flow.setPrePrice(preSettlement);
|
|
|
+ flow.setPrePrice("");
|
|
|
//实际单价
|
|
|
- flow.setRealPrice(realPrice);
|
|
|
+ flow.setRealPrice(data.get("price").toString());
|
|
|
//预结算总价
|
|
|
- flow.setPreTotal(preTotal);
|
|
|
+ flow.setPreTotal("");
|
|
|
//实际结算总价
|
|
|
- flow.setRealTotal(actualTotal);
|
|
|
+ flow.setRealTotal(data.get("amount").toString());
|
|
|
//erp单号
|
|
|
flow.setErpNo(VBELN);
|
|
|
//创建时间
|
|
|
flow.setCreateTime(TIMESTAMP);
|
|
|
//创建人 TODO
|
|
|
Service.lookup(IMINDataBaseService.class).getMybatisMapper(ApTransferFlowMapper.class).insertSelective(flow);
|
|
|
-
|
|
|
- } catch (Exception e) {
|
|
|
- e.printStackTrace();
|
|
|
-
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
return res;
|
|
|
}
|
|
|
|
|
|
public static void main(String[] args) {
|
|
|
- String header = "[{'EKORG':'2405','LIFNR':'0010010867','NAME1':'DTceshi47','TAXNUMXL':'1234648646416341AV','LAND1':'CN','ORT01':'120100','ORT02':'','EXTRA1':'DTCESHI47','EXTRA2':'DT','EXTRA3':'鍐?','EXTRA4':'MM','EXTRA5':''},{'EKORG':'2405','LIFNR':'0010010908','NAME1':'娴嬭瘯渚涘簲鍟嗛摑鐢?0919','TAXNUMXL':'9876543234567','LAND1':'CN','ORT01':'','ORT02':'','EXTRA1':'閾濈數001','EXTRA2':'QWE','EXTRA3':'鍐?','EXTRA4':'MM','EXTRA5':''}]";
|
|
|
- JSONArray array = JSONArray.parseArray(header);
|
|
|
- for(Object object : array) {
|
|
|
- System.out.println(object.toString());
|
|
|
- }
|
|
|
+ System.out.println("Basic " + Base64.encode(("zzsoaplddzsw:SpicLdTtK9xEM3").getBytes()));
|
|
|
}
|
|
|
}
|