Преглед изворни кода

发运明细跟订单接口调整

zengtx пре 3 година
родитељ
комит
f7bb62bff8
17 измењених фајлова са 991 додато и 206 уклоњено
  1. 64 3
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/shippingDetails/controller/SyShippingDetailsController.java
  2. 167 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/shippingDetails/controller/SyShippingDetailsItemController.java
  3. 12 6
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/shippingDetails/entity/SyShippingDetails.java
  4. 221 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/shippingDetails/entity/SyShippingDetailsItem.java
  5. 148 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/shippingDetails/entity/VO/OrderDataVo.java
  6. 17 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/shippingDetails/mapper/SyShippingDetailsItemMapper.java
  7. 6 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/shippingDetails/mapper/SyShippingDetailsMapper.java
  8. 5 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/shippingDetails/mapper/xml/SyShippingDetailsItemMapper.xml
  9. 18 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/shippingDetails/mapper/xml/SyShippingDetailsMapper.xml
  10. 14 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/shippingDetails/service/ISyShippingDetailsItemService.java
  11. 14 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/shippingDetails/service/ISyShippingDetailsService.java
  12. 19 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/shippingDetails/service/impl/SyShippingDetailsItemServiceImpl.java
  13. 75 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/shippingDetails/service/impl/SyShippingDetailsServiceImpl.java
  14. 92 82
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/openApi/controller/MOMainController.java
  15. 86 78
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/openApi/controller/POPomainController.java
  16. 4 8
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/openApi/controller/RdrecordController.java
  17. 29 29
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/util/JsonChangeUtils.java

+ 64 - 3
jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/shippingDetails/controller/SyShippingDetailsController.java

@@ -9,10 +9,13 @@ import java.net.URLDecoder;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.exception.JeecgBootException;
 import org.jeecg.common.system.query.QueryGenerator;
 import org.jeecg.common.aspect.annotation.AutoLog;
 import org.jeecg.common.util.oConvertUtils;
 import org.jeecg.modules.documents.shippingDetails.entity.SyShippingDetails;
+import org.jeecg.modules.documents.shippingDetails.entity.SyShippingDetailsItem;
+import org.jeecg.modules.documents.shippingDetails.entity.VO.OrderDataVo;
 import org.jeecg.modules.documents.shippingDetails.service.ISyShippingDetailsService;
 import java.util.Date;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@@ -80,9 +83,28 @@ public class SyShippingDetailsController extends JeecgController<SyShippingDetai
 	@AutoLog(value = "发运明细主表-添加")
 	@ApiOperation(value="发运明细主表-添加", notes="发运明细主表-添加")
 	@PostMapping(value = "/add")
-	public Result<?> add(@RequestBody SyShippingDetails syShippingDetails) {
-		syShippingDetailsService.save(syShippingDetails);
-		return Result.OK("添加成功!");
+	public Result<SyShippingDetails> add(@RequestBody SyShippingDetails syShippingDetails) {
+
+		Result<SyShippingDetails> result = new Result<SyShippingDetails>();
+		try {
+			if (oConvertUtils.isEmpty(syShippingDetails)) {
+				throw new JeecgBootException("请填写信息再保存!");
+			}
+			List<SyShippingDetailsItem> syShippingDetailsItemList = syShippingDetails.getSyShippingDetailsItemList();
+			if (syShippingDetailsItemList.size() == 0) {
+				throw new JeecgBootException("表体信息不能为空!");
+			}
+			syShippingDetailsService.syShippingDetailsAdd(syShippingDetails);
+			result.success("添加成功!");
+			result.setResult(syShippingDetails);
+		}catch (Exception ex){
+			ex.printStackTrace();
+			log.error("保存失败:" + ex.getMessage());
+			result.error500("保存失败:" + ex.getMessage());
+
+		}
+
+		return result;
 	}
 	
 	/**
@@ -164,4 +186,43 @@ public class SyShippingDetailsController extends JeecgController<SyShippingDetai
       return super.importExcel(request, response, SyShippingDetails.class);
   }
 
+
+	 /**
+	  * 发运明细查询订单
+	  * @param orderNumber
+	  * @param pkOrg
+	  * @param pageNo
+	  * @param pageSize
+	  * @param request
+	  * @param response
+	  * @return
+	  */
+  @GetMapping(value = "/queryOrderData")
+  public Result<IPage<OrderDataVo>> queryOrderData(String orderNumber,String pkOrg,
+												   @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
+												   @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
+												   HttpServletRequest request, HttpServletResponse response){
+
+  	Result<IPage<OrderDataVo>> result = new Result<IPage<OrderDataVo>>();
+
+  	QueryWrapper<OrderDataVo> queryWrapper = new QueryWrapper<>();
+
+  	Page<OrderDataVo> page = new Page<OrderDataVo>(pageNo, pageSize);
+  	  if(oConvertUtils.isNotEmpty(orderNumber)){
+			queryWrapper.eq("a.order_number",orderNumber);
+  	  }
+	  if(oConvertUtils.isNotEmpty(pkOrg)){
+		  queryWrapper.eq("a.pk_org",pkOrg);
+	  }
+	  queryWrapper.eq("a.del_flag",0);
+	  queryWrapper.orderByDesc("a.order_number");
+
+	  IPage<OrderDataVo> pageList = syShippingDetailsService.queryOrderData(page,queryWrapper);
+
+	  result.setSuccess(true);
+	  result.setResult(pageList);
+	  result.setMessage("查询成功!");
+
+	  return result;
+  }
 }

+ 167 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/shippingDetails/controller/SyShippingDetailsItemController.java

@@ -0,0 +1,167 @@
+package org.jeecg.modules.documents.shippingDetails.controller;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.system.query.QueryGenerator;
+import org.jeecg.common.aspect.annotation.AutoLog;
+import org.jeecg.common.util.oConvertUtils;
+import org.jeecg.modules.documents.shippingDetails.entity.SyShippingDetailsItem;
+import org.jeecg.modules.documents.shippingDetails.service.ISyShippingDetailsItemService;
+import java.util.Date;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import lombok.extern.slf4j.Slf4j;
+import org.jeecg.common.system.base.controller.JeecgController;
+import org.jeecgframework.poi.excel.ExcelImportUtil;
+import org.jeecgframework.poi.excel.def.NormalExcelConstants;
+import org.jeecgframework.poi.excel.entity.ExportParams;
+import org.jeecgframework.poi.excel.entity.ImportParams;
+import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+import org.springframework.web.multipart.MultipartHttpServletRequest;
+import org.springframework.web.servlet.ModelAndView;
+import com.alibaba.fastjson.JSON;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+
+ /**
+ * @Description: 发运明细子表
+ * @Author: jeecg-boot
+ * @Date:   2022-04-20
+ * @Version: V1.0
+ */
+@Slf4j
+@Api(tags="发运明细子表")
+@RestController
+@RequestMapping("/shippingDetails/syShippingDetailsItem")
+public class SyShippingDetailsItemController extends JeecgController<SyShippingDetailsItem, ISyShippingDetailsItemService> {
+	@Autowired
+	private ISyShippingDetailsItemService syShippingDetailsItemService;
+	
+	/**
+	 * 分页列表查询
+	 *
+	 * @param syShippingDetailsItem
+	 * @param pageNo
+	 * @param pageSize
+	 * @param req
+	 * @return
+	 */
+	@AutoLog(value = "发运明细子表-分页列表查询")
+	@ApiOperation(value="发运明细子表-分页列表查询", notes="发运明细子表-分页列表查询")
+	@GetMapping(value = "/list")
+	public Result<?> queryPageList(SyShippingDetailsItem syShippingDetailsItem,
+								   @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
+								   @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
+								   HttpServletRequest req) {
+		QueryWrapper<SyShippingDetailsItem> queryWrapper = QueryGenerator.initQueryWrapper(syShippingDetailsItem, req.getParameterMap());
+		Page<SyShippingDetailsItem> page = new Page<SyShippingDetailsItem>(pageNo, pageSize);
+		IPage<SyShippingDetailsItem> pageList = syShippingDetailsItemService.page(page, queryWrapper);
+		return Result.OK(pageList);
+	}
+	
+	/**
+	 * 添加
+	 *
+	 * @param syShippingDetailsItem
+	 * @return
+	 */
+	@AutoLog(value = "发运明细子表-添加")
+	@ApiOperation(value="发运明细子表-添加", notes="发运明细子表-添加")
+	@PostMapping(value = "/add")
+	public Result<?> add(@RequestBody SyShippingDetailsItem syShippingDetailsItem) {
+		syShippingDetailsItemService.save(syShippingDetailsItem);
+		return Result.OK("添加成功!");
+	}
+	
+	/**
+	 * 编辑
+	 *
+	 * @param syShippingDetailsItem
+	 * @return
+	 */
+	@AutoLog(value = "发运明细子表-编辑")
+	@ApiOperation(value="发运明细子表-编辑", notes="发运明细子表-编辑")
+	@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
+	public Result<?> edit(@RequestBody SyShippingDetailsItem syShippingDetailsItem) {
+		syShippingDetailsItemService.updateById(syShippingDetailsItem);
+		return Result.OK("编辑成功!");
+	}
+	
+	/**
+	 * 通过id删除
+	 *
+	 * @param id
+	 * @return
+	 */
+	@AutoLog(value = "发运明细子表-通过id删除")
+	@ApiOperation(value="发运明细子表-通过id删除", notes="发运明细子表-通过id删除")
+	@DeleteMapping(value = "/delete")
+	public Result<?> delete(@RequestParam(name="id",required=true) String id) {
+		syShippingDetailsItemService.removeById(id);
+		return Result.OK("删除成功!");
+	}
+	
+	/**
+	 * 批量删除
+	 *
+	 * @param ids
+	 * @return
+	 */
+	@AutoLog(value = "发运明细子表-批量删除")
+	@ApiOperation(value="发运明细子表-批量删除", notes="发运明细子表-批量删除")
+	@DeleteMapping(value = "/deleteBatch")
+	public Result<?> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
+		this.syShippingDetailsItemService.removeByIds(Arrays.asList(ids.split(",")));
+		return Result.OK("批量删除成功!");
+	}
+	
+	/**
+	 * 通过id查询
+	 *
+	 * @param id
+	 * @return
+	 */
+	@AutoLog(value = "发运明细子表-通过id查询")
+	@ApiOperation(value="发运明细子表-通过id查询", notes="发运明细子表-通过id查询")
+	@GetMapping(value = "/queryById")
+	public Result<?> queryById(@RequestParam(name="id",required=true) String id) {
+		SyShippingDetailsItem syShippingDetailsItem = syShippingDetailsItemService.getById(id);
+		return Result.OK(syShippingDetailsItem);
+	}
+
+  /**
+   * 导出excel
+   *
+   * @param request
+   * @param syShippingDetailsItem
+   */
+  @RequestMapping(value = "/exportXls")
+  public ModelAndView exportXls(HttpServletRequest request, SyShippingDetailsItem syShippingDetailsItem) {
+      return super.exportXls(request, syShippingDetailsItem, SyShippingDetailsItem.class, "发运明细子表");
+  }
+
+  /**
+   * 通过excel导入数据
+   *
+   * @param request
+   * @param response
+   * @return
+   */
+  @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
+  public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
+      return super.importExcel(request, response, SyShippingDetailsItem.class);
+  }
+
+}

+ 12 - 6
jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/shippingDetails/entity/SyShippingDetails.java

@@ -2,6 +2,8 @@ package org.jeecg.modules.documents.shippingDetails.entity;
 
 import java.io.Serializable;
 import java.util.Date;
+import java.util.List;
+
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
@@ -37,8 +39,8 @@ public class SyShippingDetails {
     @ApiModelProperty(value = "单据号")
 	private java.lang.String documentNo;
 	/**单据日期*/
-	@Excel(name = "单据日期", width = 20, format = "yyyy-MM-dd HH:mm:ss")
-	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
+	@Excel(name = "单据日期", width = 20, format = "yyyy-MM-dd")
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
     @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
     @ApiModelProperty(value = "单据日期")
 	private java.util.Date documentDate;
@@ -55,14 +57,14 @@ public class SyShippingDetails {
     @ApiModelProperty(value = "客户")
 	private java.lang.String customer;
 	/**预发货日期*/
-	@Excel(name = "预发货日期", width = 20, format = "yyyy-MM-dd HH:mm:ss")
-	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
+	@Excel(name = "预发货日期", width = 20, format = "yyyy-MM-dd")
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
     @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
     @ApiModelProperty(value = "预发货日期")
 	private java.util.Date preDeliveryDate;
 	/**预完工日期*/
-	@Excel(name = "预完工日期", width = 20, format = "yyyy-MM-dd HH:mm:ss")
-	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
+	@Excel(name = "预完工日期", width = 20, format = "yyyy-MM-dd")
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
     @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
     @ApiModelProperty(value = "预完工日期")
 	private java.util.Date preCompletionDate;
@@ -114,4 +116,8 @@ public class SyShippingDetails {
 	@Excel(name = "英文品名", width = 15)
     @ApiModelProperty(value = "英文品名")
 	private java.lang.String englishProductName;
+
+	//子表集合
+	@TableField(exist = false)
+	private List<SyShippingDetailsItem> syShippingDetailsItemList;
 }

+ 221 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/shippingDetails/entity/SyShippingDetailsItem.java

@@ -0,0 +1,221 @@
+package org.jeecg.modules.documents.shippingDetails.entity;
+
+import java.io.Serializable;
+import java.util.Date;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.TableField;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import org.springframework.format.annotation.DateTimeFormat;
+import org.jeecgframework.poi.excel.annotation.Excel;
+
+/**
+ * @Description: 发运明细子表
+ * @Author: jeecg-boot
+ * @Date:   2022-04-20
+ * @Version: V1.0
+ */
+@Data
+@TableName("sy_shipping_details_item")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value="sy_shipping_details_item对象", description="发运明细子表")
+public class SyShippingDetailsItem {
+    
+	/**主键id*/
+	@TableId(type = IdType.ASSIGN_ID)
+    @ApiModelProperty(value = "主键id")
+	private java.lang.String id;
+	/**订单数据主表id*/
+	@Excel(name = "订单数据主表id", width = 15)
+    @ApiModelProperty(value = "订单数据主表id")
+	private java.lang.String syOrderDataId;
+	/**订单数据子表id*/
+	@Excel(name = "订单数据子表id", width = 15)
+    @ApiModelProperty(value = "订单数据子表id")
+	private java.lang.String syOrderDataItemId;
+	/**账套*/
+	@Excel(name = "账套", width = 15)
+    @ApiModelProperty(value = "账套")
+	private java.lang.String acSetNo;
+	/**订单号*/
+	@Excel(name = "订单号", width = 15)
+    @ApiModelProperty(value = "订单号")
+	private java.lang.String orderNumber;
+	/**订单日期*/
+	@Excel(name = "订单日期", width = 20, format = "yyyy-MM-dd")
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "订单日期")
+	private java.util.Date orderDate;
+	/**业务类型*/
+	@Excel(name = "业务类型", width = 15)
+    @ApiModelProperty(value = "业务类型")
+	private java.lang.String businessTypeValue;
+	/**业务类型文本*/
+	@Excel(name = "业务类型文本", width = 15)
+    @ApiModelProperty(value = "业务类型文本")
+	private java.lang.String businessTypeText;
+	/**客户订单*/
+	@Excel(name = "客户订单", width = 15)
+    @ApiModelProperty(value = "客户订单")
+	private java.lang.String customerOrder;
+	/**小po*/
+	@Excel(name = "小po", width = 15)
+    @ApiModelProperty(value = "小po")
+	private java.lang.String smallPo;
+	/**packId*/
+	@Excel(name = "packId", width = 15)
+    @ApiModelProperty(value = "packId")
+	private java.lang.String packId;
+	/**订单数量*/
+	@Excel(name = "订单数量", width = 15)
+    @ApiModelProperty(value = "订单数量")
+	private java.math.BigDecimal orderQuantity;
+	/**订单剩余数量*/
+	@Excel(name = "订单剩余数量", width = 15)
+    @ApiModelProperty(value = "订单剩余数量")
+	private java.math.BigDecimal orderRemainingQuantity;
+	/**发货数量*/
+	@Excel(name = "发货数量", width = 15)
+    @ApiModelProperty(value = "发货数量")
+	private java.math.BigDecimal shipmentQuantity;
+	/**是否tc功能0否1是*/
+	@Excel(name = "是否tc功能0否1是", width = 15)
+    @ApiModelProperty(value = "是否tc功能0否1是")
+	private java.lang.String isTc;
+	/**物料成分*/
+	@Excel(name = "物料成分", width = 15)
+    @ApiModelProperty(value = "物料成分")
+	private java.lang.String materialComposition;
+	/**销售类型*/
+	@Excel(name = "销售类型", width = 15)
+    @ApiModelProperty(value = "销售类型")
+	private java.lang.String salesTypeValue;
+	/**销售类型文本*/
+	@Excel(name = "销售类型文本", width = 15)
+    @ApiModelProperty(value = "销售类型文本")
+	private java.lang.String salesTypeText;
+	/**客户简称*/
+	@Excel(name = "客户简称", width = 15)
+    @ApiModelProperty(value = "客户简称")
+	private java.lang.String customerAbbreviation;
+	/**客户名称*/
+	@Excel(name = "客户名称", width = 15)
+    @ApiModelProperty(value = "客户名称")
+	private java.lang.String customerName;
+	/**汇率*/
+	@Excel(name = "汇率", width = 15)
+    @ApiModelProperty(value = "汇率")
+	private java.math.BigDecimal exchangeRate;
+	/**整单合计*/
+	@Excel(name = "整单合计", width = 15)
+    @ApiModelProperty(value = "整单合计")
+	private java.math.BigDecimal wholeOrderTotal;
+	/**销售部门*/
+	@Excel(name = "销售部门", width = 15)
+    @ApiModelProperty(value = "销售部门")
+	private java.lang.String salesDepartment;
+	/**业务员*/
+	@Excel(name = "业务员", width = 15)
+    @ApiModelProperty(value = "业务员")
+	private java.lang.String salesman;
+	/**币种*/
+	@Excel(name = "币种", width = 15)
+    @ApiModelProperty(value = "币种")
+	private java.lang.String currencyValue;
+	/**币种文本*/
+	@Excel(name = "币种文本", width = 15)
+    @ApiModelProperty(value = "币种文本")
+	private java.lang.String currencyText;
+	/**品牌方*/
+	@Excel(name = "品牌方", width = 15)
+    @ApiModelProperty(value = "品牌方")
+	private java.lang.String brandSide;
+	/**第三方*/
+	@Excel(name = "第三方", width = 15)
+    @ApiModelProperty(value = "第三方")
+	private java.lang.String thirdParty;
+	/**定金比例*/
+	@Excel(name = "定金比例", width = 15)
+    @ApiModelProperty(value = "定金比例")
+	private java.lang.String depositRatio;
+	/**定金*/
+	@Excel(name = "定金", width = 15)
+    @ApiModelProperty(value = "定金")
+	private java.math.BigDecimal deposit;
+	/**协同路线*/
+	@Excel(name = "协同路线", width = 15)
+    @ApiModelProperty(value = "协同路线")
+	private java.lang.String collaborativeRoute;
+	/**付款条件*/
+	@Excel(name = "付款条件", width = 15)
+    @ApiModelProperty(value = "付款条件")
+	private java.lang.String termOfPayment;
+	/**最终客户*/
+	@Excel(name = "最终客户", width = 15)
+    @ApiModelProperty(value = "最终客户")
+	private java.lang.String endCustomer;
+	/**价格备注*/
+	@Excel(name = "价格备注", width = 15)
+    @ApiModelProperty(value = "价格备注")
+	private java.lang.Object priceRemarks;
+	/**订单备注*/
+	@Excel(name = "订单备注", width = 15)
+    @ApiModelProperty(value = "订单备注")
+	private java.lang.Object orderRemarks;
+	/**订单说明*/
+	@Excel(name = "订单说明", width = 15)
+    @ApiModelProperty(value = "订单说明")
+	private java.lang.Object orderChangeDescription;
+	/**报关单价*/
+	@Excel(name = "报关单价", width = 15)
+    @ApiModelProperty(value = "报关单价")
+	private java.math.BigDecimal customsDeclarationUnitPrice;
+	/**u8备注*/
+	@Excel(name = "u8备注", width = 15)
+    @ApiModelProperty(value = "u8备注")
+	private java.lang.Object u8Remarks;
+	/**创建人*/
+	@Excel(name = "创建人", width = 15)
+    @ApiModelProperty(value = "创建人")
+	private java.lang.String createBy;
+	/**创建日期*/
+	@Excel(name = "创建日期", width = 20, format = "yyyy-MM-dd HH:mm:ss")
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "创建日期")
+	private java.util.Date createTime;
+	/**更新人*/
+	@Excel(name = "更新人", width = 15)
+    @ApiModelProperty(value = "更新人")
+	private java.lang.String updateBy;
+	/**更新日期*/
+	@Excel(name = "更新日期", width = 20, format = "yyyy-MM-dd HH:mm:ss")
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "更新日期")
+	private java.util.Date updateTime;
+	/**组织*/
+	@Excel(name = "组织", width = 15)
+    @ApiModelProperty(value = "组织")
+	private java.lang.String pkOrg;
+	/**删除状态*/
+	@Excel(name = "删除状态", width = 15)
+    @ApiModelProperty(value = "删除状态")
+	private java.lang.String delFlag;
+	/**备注*/
+	@Excel(name = "备注", width = 15)
+    @ApiModelProperty(value = "备注")
+	private java.lang.Object memo;
+	/**排序*/
+	@Excel(name = "排序", width = 15)
+    @ApiModelProperty(value = "排序")
+	private java.lang.Integer sort;
+}

+ 148 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/shippingDetails/entity/VO/OrderDataVo.java

@@ -0,0 +1,148 @@
+package org.jeecg.modules.documents.shippingDetails.entity.VO;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import org.jeecgframework.poi.excel.annotation.Excel;
+import org.springframework.format.annotation.DateTimeFormat;
+
+@Data
+public class OrderDataVo {
+
+    /**订单号*/
+    @Excel(name = "订单号", width = 15)
+    @ApiModelProperty(value = "订单号")
+    private java.lang.String orderNumber;
+    /**订单日期*/
+    @Excel(name = "订单日期", width = 20, format = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "订单日期")
+    private java.util.Date orderDate;
+
+    /**业务类型文本*/
+    @Excel(name = "业务类型文本", width = 15)
+    @ApiModelProperty(value = "业务类型文本")
+    private java.lang.String businessTypeText;
+
+    /**销售类型文本*/
+    @Excel(name = "销售类型文本", width = 15)
+    @ApiModelProperty(value = "销售类型文本")
+    private java.lang.String salesTypeText;
+    /**客户简称*/
+    @Excel(name = "客户简称", width = 15)
+    @ApiModelProperty(value = "客户简称")
+    private java.lang.String customerAbbreviation;
+    /**客户名称*/
+    @Excel(name = "客户名称", width = 15)
+    @ApiModelProperty(value = "客户名称")
+    private java.lang.String customerName;
+    /**汇率*/
+    @Excel(name = "汇率", width = 15)
+    @ApiModelProperty(value = "汇率")
+    private java.math.BigDecimal exchangeRate;
+    /**销售部门*/
+    @Excel(name = "销售部门", width = 15)
+    @ApiModelProperty(value = "销售部门")
+    private java.lang.String salesDepartment;
+    /**业务员*/
+    @Excel(name = "业务员", width = 15)
+    @ApiModelProperty(value = "业务员")
+    private java.lang.String salesman;
+    /**币种文本*/
+    @Excel(name = "币种文本", width = 15)
+    @ApiModelProperty(value = "币种文本")
+    private java.lang.String currencyText;
+    /**品牌方*/
+    @Excel(name = "品牌方", width = 15)
+    @ApiModelProperty(value = "品牌方")
+    private java.lang.String brandSide;
+    /**第三方*/
+    @Excel(name = "第三方", width = 15)
+    @ApiModelProperty(value = "第三方")
+    private java.lang.String thirdParty;
+    /**定金比例*/
+    @Excel(name = "定金比例", width = 15)
+    @ApiModelProperty(value = "定金比例")
+    private java.lang.String depositRatio;
+    /**定金*/
+    @Excel(name = "定金", width = 15)
+    @ApiModelProperty(value = "定金")
+    private java.math.BigDecimal deposit;
+    /**协同路线*/
+    @Excel(name = "协同路线", width = 15)
+    @ApiModelProperty(value = "协同路线")
+    private java.lang.String collaborativeRoute;
+    /**订单备注*/
+    @Excel(name = "订单备注", width = 15)
+    @ApiModelProperty(value = "订单备注")
+    private java.lang.Object orderRemarks;
+    /**价格备注*/
+    @Excel(name = "价格备注", width = 15)
+    @ApiModelProperty(value = "价格备注")
+    private java.lang.Object priceRemarks;
+    /**客户订单号*/
+    @Excel(name = "客户订单号", width = 15)
+    @ApiModelProperty(value = "客户订单号")
+    private java.lang.String customerOrderNumber;
+    /**整单合计*/
+    @Excel(name = "整单合计", width = 15)
+    @ApiModelProperty(value = "整单合计")
+    private java.math.BigDecimal wholeOrderTotal;
+    /**最终客户*/
+    @Excel(name = "最终客户", width = 15)
+    @ApiModelProperty(value = "最终客户")
+    private java.lang.String endCustomer;
+    /**付款条件*/
+    @Excel(name = "付款条件", width = 15)
+    @ApiModelProperty(value = "付款条件")
+    private java.lang.String termOfPayment;
+    /**订单说明*/
+    @Excel(name = "订单说明", width = 15)
+    @ApiModelProperty(value = "订单说明")
+    private java.lang.Object orderChangeDescription;
+
+    /**款号*/
+    @Excel(name = "款号", width = 15)
+    @ApiModelProperty(value = "款号")
+    private java.lang.String itemNumber;
+
+    /**小po*/
+    @Excel(name = "小po", width = 15)
+    @ApiModelProperty(value = "小po")
+    private java.lang.String smallPo;
+
+    /**存货名称*/
+    @Excel(name = "存货名称", width = 15)
+    @ApiModelProperty(value = "存货名称")
+    private java.lang.String inventoryName;
+    /**规格型号*/
+    @Excel(name = "规格型号", width = 15)
+    @ApiModelProperty(value = "规格型号")
+    private java.lang.String specificationAndModel;
+    /**颜色*/
+    @Excel(name = "颜色", width = 15)
+    @ApiModelProperty(value = "颜色")
+    private java.lang.String colour;
+    /**尺码*/
+    @Excel(name = "尺码", width = 15)
+    @ApiModelProperty(value = "尺码")
+    private java.lang.String size;
+    /**配码规则*/
+    @Excel(name = "配码规则", width = 15)
+    @ApiModelProperty(value = "配码规则")
+    private java.lang.String codingRules;
+
+    /**数量*/
+    @Excel(name = "数量", width = 15)
+    @ApiModelProperty(value = "数量")
+    private java.math.BigDecimal quantity;
+
+    /**组织*/
+    @Excel(name = "组织", width = 15)
+    @ApiModelProperty(value = "组织")
+    private java.lang.String pkOrg;
+
+}

+ 17 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/shippingDetails/mapper/SyShippingDetailsItemMapper.java

@@ -0,0 +1,17 @@
+package org.jeecg.modules.documents.shippingDetails.mapper;
+
+import java.util.List;
+
+import org.apache.ibatis.annotations.Param;
+import org.jeecg.modules.documents.shippingDetails.entity.SyShippingDetailsItem;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * @Description: 发运明细子表
+ * @Author: jeecg-boot
+ * @Date:   2022-04-20
+ * @Version: V1.0
+ */
+public interface SyShippingDetailsItemMapper extends BaseMapper<SyShippingDetailsItem> {
+
+}

+ 6 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/shippingDetails/mapper/SyShippingDetailsMapper.java

@@ -2,9 +2,12 @@ package org.jeecg.modules.documents.shippingDetails.mapper;
 
 import java.util.List;
 
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
 import org.apache.ibatis.annotations.Param;
 import org.jeecg.modules.documents.shippingDetails.entity.SyShippingDetails;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.jeecg.modules.documents.shippingDetails.entity.VO.OrderDataVo;
 
 /**
  * @Description: 发运明细主表
@@ -14,4 +17,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  */
 public interface SyShippingDetailsMapper extends BaseMapper<SyShippingDetails> {
 
+    //发运明细查询订单数据
+    public IPage<OrderDataVo> queryOrderData(IPage<OrderDataVo> page, @Param("ew") QueryWrapper<OrderDataVo> queryWrapper);
+
 }

+ 5 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/shippingDetails/mapper/xml/SyShippingDetailsItemMapper.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.jeecg.modules.documents.shippingDetails.mapper.SyShippingDetailsItemMapper">
+
+</mapper>

+ 18 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/shippingDetails/mapper/xml/SyShippingDetailsMapper.xml

@@ -2,4 +2,22 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="org.jeecg.modules.documents.shippingDetails.mapper.SyShippingDetailsMapper">
 
+    <select id="queryOrderData" resultType="org.jeecg.modules.documents.shippingDetails.entity.VO.OrderDataVo">
+
+        select a.order_number as orderNumber,b.item_number as itemNumber,b.small_po as smallPo,b.pk_org as pkOrg,a.order_date as orderDate,b.inventory_name as inventoryName,
+         b.colour as colour,b.size as size,b.coding_rules as codingRules,b.quantity as quantity,a.business_type_text as businessTypeText,a.customer_order_number as customerOrderNumber,
+           a.sales_type_text as salesTypeText,a.customer_abbreviation as customerAbbreviation,a.customer_name as customerName,
+           a.brand_side as brandSide,a.exchange_rate as exchangeRate,b.specification_and_model as specificationAndModel,
+           a.whole_order_total as wholeOrderTotal,a.sales_department as salesDepartment,a.salesman as salesman,a.currency_text as currencyText,a.third_party as thirdParty,
+            a.deposit_ratio as depositRatio,a.deposit as deposit,a.collaborative_route as collaborativeRoute,a.term_of_payment as termOfPayment,a.end_customer as endCustomer,
+             a.order_remarks as orderRemarks,a.price_remarks as priceRemarks,a.order_change_description as orderChangeDescription from sy_order_data a
+        left join sy_order_data_item b
+        on a.id = b.sy_order_data_id and b.del_flag = 0
+        ${ew.customSqlSegment}
+
+
+    </select>
+
+
+
 </mapper>

+ 14 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/shippingDetails/service/ISyShippingDetailsItemService.java

@@ -0,0 +1,14 @@
+package org.jeecg.modules.documents.shippingDetails.service;
+
+import org.jeecg.modules.documents.shippingDetails.entity.SyShippingDetailsItem;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * @Description: 发运明细子表
+ * @Author: jeecg-boot
+ * @Date:   2022-04-20
+ * @Version: V1.0
+ */
+public interface ISyShippingDetailsItemService extends IService<SyShippingDetailsItem> {
+
+}

+ 14 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/shippingDetails/service/ISyShippingDetailsService.java

@@ -1,7 +1,14 @@
 package org.jeecg.modules.documents.shippingDetails.service;
 
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.apache.ibatis.annotations.Param;
+import org.jeecg.modules.documents.orderData.entity.SyOrderData;
 import org.jeecg.modules.documents.shippingDetails.entity.SyShippingDetails;
 import com.baomidou.mybatisplus.extension.service.IService;
+import org.jeecg.modules.documents.shippingDetails.entity.VO.OrderDataVo;
+
+import java.util.List;
 
 /**
  * @Description: 发运明细主表
@@ -11,4 +18,11 @@ import com.baomidou.mybatisplus.extension.service.IService;
  */
 public interface ISyShippingDetailsService extends IService<SyShippingDetails> {
 
+
+    //发运明细查询订单数据
+    public IPage<OrderDataVo> queryOrderData(IPage<OrderDataVo> page, QueryWrapper<OrderDataVo> queryWrapper);
+
+    //新增发运明细
+    public SyShippingDetails syShippingDetailsAdd(SyShippingDetails syShippingDetails);
+
 }

+ 19 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/shippingDetails/service/impl/SyShippingDetailsItemServiceImpl.java

@@ -0,0 +1,19 @@
+package org.jeecg.modules.documents.shippingDetails.service.impl;
+
+import org.jeecg.modules.documents.shippingDetails.entity.SyShippingDetailsItem;
+import org.jeecg.modules.documents.shippingDetails.mapper.SyShippingDetailsItemMapper;
+import org.jeecg.modules.documents.shippingDetails.service.ISyShippingDetailsItemService;
+import org.springframework.stereotype.Service;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+
+/**
+ * @Description: 发运明细子表
+ * @Author: jeecg-boot
+ * @Date:   2022-04-20
+ * @Version: V1.0
+ */
+@Service
+public class SyShippingDetailsItemServiceImpl extends ServiceImpl<SyShippingDetailsItemMapper, SyShippingDetailsItem> implements ISyShippingDetailsItemService {
+
+}

+ 75 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/shippingDetails/service/impl/SyShippingDetailsServiceImpl.java

@@ -1,12 +1,23 @@
 package org.jeecg.modules.documents.shippingDetails.service.impl;
 
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.jeecg.common.util.oConvertUtils;
 import org.jeecg.modules.documents.shippingDetails.entity.SyShippingDetails;
+import org.jeecg.modules.documents.shippingDetails.entity.SyShippingDetailsItem;
+import org.jeecg.modules.documents.shippingDetails.entity.VO.OrderDataVo;
 import org.jeecg.modules.documents.shippingDetails.mapper.SyShippingDetailsMapper;
 import org.jeecg.modules.documents.shippingDetails.service.ISyShippingDetailsService;
+import org.jeecg.modules.system.util.InterfaceConnUtils;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 
+import javax.annotation.Resource;
+import java.util.ArrayList;
+import java.util.List;
+
 /**
  * @Description: 发运明细主表
  * @Author: jeecg-boot
@@ -16,4 +27,68 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 @Service
 public class SyShippingDetailsServiceImpl extends ServiceImpl<SyShippingDetailsMapper, SyShippingDetails> implements ISyShippingDetailsService {
 
+    @Resource
+    private SyShippingDetailsMapper syShippingDetailsMapper;
+    @Autowired
+    private SyShippingDetailsItemServiceImpl syShippingDetailsItemService;
+
+
+    /**
+     * 发运明细查询订单数据
+     * @param page
+     * @param queryWrapper
+     * @return
+     */
+    @Override
+    public IPage<OrderDataVo> queryOrderData(IPage<OrderDataVo> page, QueryWrapper<OrderDataVo> queryWrapper) {
+        return syShippingDetailsMapper.queryOrderData(page, queryWrapper);
+    }
+
+
+    /**
+     * 新增发运明细
+     * @param syShippingDetails
+     * @return
+     */
+    @Override
+    public SyShippingDetails syShippingDetailsAdd(SyShippingDetails syShippingDetails) {
+
+        List<SyShippingDetailsItem> syShippingDetailsItemList = new ArrayList<>();
+
+         String id = oConvertUtils.id();
+         //设置ID
+         syShippingDetails.setId(id);
+         //获取最新编号
+         QueryWrapper<SyShippingDetails> queryWrapper = new QueryWrapper<>();
+         queryWrapper.eq("del_flag",0).orderByDesc("document_no").last("limit 0,1");
+         List<SyShippingDetails> documentNoList = list(queryWrapper);
+         if(documentNoList.size()==0){
+             syShippingDetails.setDocumentNo("1");
+         }else{    
+             int codeno = Integer.parseInt(documentNoList.get(0).getDocumentNo());
+             Integer documentNo = codeno+1;
+             syShippingDetails.setDocumentNo(documentNo.toString());
+         }
+
+         //新增子表
+        List<SyShippingDetailsItem> list = syShippingDetails.getSyShippingDetailsItemList();
+
+         if(list.size()!=0){
+             for (SyShippingDetailsItem li:list){
+                 //设置主表自建
+                 li.setSyOrderDataId(id);
+                 li.setId(oConvertUtils.id());
+                 syShippingDetailsItemList.add(li);
+             }
+             if(syShippingDetailsItemList.size()!=0){
+                 syShippingDetailsItemService.saveBatch(syShippingDetailsItemList);
+             }
+         }
+
+        boolean ok = save(syShippingDetails);
+        if(ok){
+            return syShippingDetails;
+        }
+           return null;
+    }
 }

+ 92 - 82
jeecg-boot-module-system/src/main/java/org/jeecg/modules/openApi/controller/MOMainController.java

@@ -76,15 +76,22 @@ public class MOMainController implements ApplicationContextAware {
                 String pkorgValue[] = pkorgStr.split(":");
                 String ac = pkorgValue[1];
                 if (pkorgValue[0].equals("one")) {
-                    String sql = "select top 1 mo.MOID as 'headerAttributeString6',mo.MOID as 'moId','903' as accId,mo.cState as 'poStatus',mo.cCode as 'poNum'," +
-                            "'SUBCONTRACTOR_PO' as 'poType','0085' as 'supplierNumber'" +
-                            ",'森鑫' as 'supplierName',ven.cVenPerson as 'supplierContacts',ven.cVenBranchPhone as 'supplierContactsPhone'" +
-                            ",mo.cMaker as 'buyerCode',mo.cVenPerson as 'customerContacts','' as 'customerContactsPhone','0.00' as 'totalAmount'," +
-                            "'0.00' as 'exTaxAmount', mo.cexch_name as 'currencyCode',mo.iTaxRate as 'headerTaxRate'," +
-                            "mo.dDate as 'customerDemandDate','' as 'supplierPromiseDate', mo.cMemo as 'remark','' as 'sourceDocNum'," +
-                            "'' as 'buyerCode',mo.cMaker as 'buyerName',mo.dCreateTime  as 'publishDate',0 as 'tenantId',0 as 'totalAmount','' as 'headerAttributeString1', '' as 'headerAttributeString2','' as 'headerAttributeString3','' as 'headerAttributeString4' " +
-                            " from OM_MOMain mo left join Vendor ven on mo.cVenCode = ven.cVenCode " +
-                            "where ( mo.iVerifyStateNew = 2 or mo.cState = 2) and mo.cCode = 'SYM713-森鑫'  order by mo.dCreateTime desc";
+                    String sql = "select mo.MOID as 'headerAttributeString6',mo.MOID as 'moId','903' as accId,mo.cState as 'poStatus'," +
+                            "mo.cCode as 'poNum','SUBCONTRACTOR_PO' as 'poType','0085' as 'supplierNumber','森鑫' as 'supplierName'," +
+                            "ven.cVenPerson as 'supplierContacts',ven.cVenBranchPhone as 'supplierContactsPhone',mo.cPersonCode as 'salerId'," +
+                            "hr1.cPsn_Name as 'salerCode',mo.cVenPerson as 'customerContacts','采购业务实体名称' as poBusinessUnitCode," +
+                            "'' as 'customerContactsPhone','0.00' as 'totalAmount','0.00' as 'exTaxAmount', curr.cexch_code as 'currencyCode'," +
+                            "mo.iTaxRate as 'headerTaxRate',mo.dDate as 'customerDemandDate','' as 'supplierPromiseDate', mo.cMemo as 'remark'," +
+                            "'' as 'sourceDocNum',mo.cMaker as 'buyerCode',hr.cPsn_Num as 'buyerId',mo.dCreateTime  as 'publishDate',0 as 'tenantId'," +
+                            "0 as 'totalAmount','' as 'headerAttributeString1', mo.cCode as 'headerAttributeString2','' as 'headerAttributeString3'," +
+                            "'' as 'headerAttributeString4'  from OM_MOMain mo left join Vendor ven on mo.cVenCode = ven.cVenCode " +
+                            "left join (select cPsn_Num, cPsn_Name from hr_hi_person) hr " +
+                            "on mo.cMaker = hr.cPsn_Name " +
+                            "left join (select cPsn_Num, cPsn_Name from hr_hi_person) hr1 " +
+                            "on mo.cPersonCode = hr1.cPsn_Num " +
+                            "left join foreigncurrency curr " +
+                            "on mo.cexch_name = curr.cexch_name " +
+                            "where ( mo.iVerifyStateNew = 2 or mo.cState = 2) and cAuditTime>'"+lasttimeSf+"'  order by mo.dCreateTime desc";
 
 //            String sql1 = "select top 2 '903' as accId,MOID as MOID,cPersonCode as buyerCode,cexch_name as currencyCode,cVenPerson as customerContacts,'联系人电话' as customerContactsPhone,'123' as customerNumber,cVenAccount as headerAttributeString1," +
 //                    "'合同号' as headerAttributeString2,'0097' as headerAttributeString3,'' as headerAttributeString4,'3' as headerTaxRate,cCode as poNum,'01' as poType,'0085' as supplierNumber " +
@@ -98,83 +105,86 @@ public class MOMainController implements ApplicationContextAware {
 
                 }
             }
-            //循环集合,一条一条传
-            for(Map<String, Object> map:sumlist) {
-                //转JSON且赋值
-                Gson userGson = new GsonBuilder().create();
-                result.put("payload", userGson.toJson(JsonChangeUtils.toMoMainJson(map)));
-                log.info("查询到的数据:" + result);
-
-                //获取当前接口同步信息,对方接口地址
-                //拼接url
-                String url = resultList.get(0).getItemIp() + resultList.get(0).getItemUrl();
-                //调用doPost
-                InterfaceConnUtils interfaceConnUtils = new InterfaceConnUtils();
-                //处理返回信息
-                JSONObject informationJson = interfaceConnUtils.doPostToBearer(result, url, "委外订单接口-");
-
-            JSONArray jsonArray = informationJson.getJSONArray("head");
-            if (jsonArray.size() != 0) {
-                //获取4个账套值
-                String yi = "";
-                String er = "";
-                String san = "";
-                String si = "";
-                for (String str : pkorgSplit) {
-                    String pkorgStr = str;
-                    String pkorgValue[] = pkorgStr.split(":");
-                    if (pkorgValue[0].equals("one")) {
-                        yi = pkorgValue[1];
-                    }
-                    if (pkorgValue[0].equals("two")) {
-                        er = pkorgValue[1];
-                    }
-                    if (pkorgValue[0].equals("three")) {
-                        san = pkorgValue[1];
-                    }
-                    if (pkorgValue[0].equals("four")) {
-                        si = pkorgValue[1];
-                    }
-                }
-                //回写U8物料信息表是否同步成功字段
-                Iterator<Object> it = jsonArray.iterator();
-                while (it.hasNext()) {
-                    JSONObject jo = (JSONObject) it.next();
-                    //获取是否成功
-                    String code = jo.getString("code");
-                    //获取返回消息
-                    String message = jo.getString("message");
-                    //获取businessCode
-                    String businessCode = jo.getString("businessCode");
-                    String busSplit[] = businessCode.split("#");
-                    //账套666
-                    if (busSplit[1].equals(yi)) {
-                        if (code.equals("S")) {
-                            //普通采购回写
-                            String sql = "update PO_Pomain set cDefine12 = ? where cPOID = ?";
-                            senYuDataSourceOne.updateMOMain(sql, "true," + message, busSplit[0]);
-                            //订单委外
-                            String sql1 = "update HY_MOMain set cDefine10 = ? where cCode = ?";
-                            senYuDataSourceOne.updateMOMain(sql1, "true," + message, busSplit[0]);
-                        } else {
-                            //普通采购回写
-                            String sql = "update PO_Pomain set cDefine12 = ? where cPOID = ?";
-                            senYuDataSourceOne.updateMOMain(sql, "false," + message, busSplit[0]);
-                            //订单委外
-                            String sql1 = "update HY_MOMain set cDefine10 = ? where cCode = ?";
-                            senYuDataSourceOne.updateMOMain(sql1, "false," + message, busSplit[0]);
+            if(sumlist.size()==0){
+                log.info("未查询到的数据!");
+            }else {
+                //循环集合,一条一条传
+                for (Map<String, Object> map : sumlist) {
+                    //转JSON且赋值
+                    Gson userGson = new GsonBuilder().create();
+                    result.put("payload", userGson.toJson(JsonChangeUtils.toMoMainJson(map)));
+                    log.info("查询到的数据:" + result);
+
+                    //获取当前接口同步信息,对方接口地址
+                    //拼接url
+                    String url = resultList.get(0).getItemIp() + resultList.get(0).getItemUrl();
+                    //调用doPost
+                    InterfaceConnUtils interfaceConnUtils = new InterfaceConnUtils();
+                    //处理返回信息
+                    JSONObject informationJson = interfaceConnUtils.doPostToBearer(result, url, "委外订单接口-");
+
+                    JSONArray jsonArray = informationJson.getJSONArray("head");
+                    if (jsonArray.size() != 0) {
+                        //获取4个账套值
+                        String yi = "";
+                        String er = "";
+                        String san = "";
+                        String si = "";
+                        for (String str : pkorgSplit) {
+                            String pkorgStr = str;
+                            String pkorgValue[] = pkorgStr.split(":");
+                            if (pkorgValue[0].equals("one")) {
+                                yi = pkorgValue[1];
+                            }
+                            if (pkorgValue[0].equals("two")) {
+                                er = pkorgValue[1];
+                            }
+                            if (pkorgValue[0].equals("three")) {
+                                san = pkorgValue[1];
+                            }
+                            if (pkorgValue[0].equals("four")) {
+                                si = pkorgValue[1];
+                            }
                         }
-                    }
-                    //账套012
+                        //回写U8物料信息表是否同步成功字段
+                        Iterator<Object> it = jsonArray.iterator();
+                        while (it.hasNext()) {
+                            JSONObject jo = (JSONObject) it.next();
+                            //获取是否成功
+                            String code = jo.getString("code");
+                            //获取返回消息
+                            String message = jo.getString("message");
+                            //获取businessCode
+                            String businessCode = jo.getString("businessCode");
+                            String busSplit[] = businessCode.split("#");
+                            //账套666
+                            if (busSplit[1].equals(yi)) {
+                                if (code.equals("S")) {
+                                    //普通采购回写
+                                    String sql = "update PO_Pomain set cDefine12 = ? where cPOID = ?";
+                                    senYuDataSourceOne.updateMOMain(sql, "true," + message, busSplit[0]);
+                                    //订单委外
+                                    String sql1 = "update HY_MOMain set cDefine10 = ? where cCode = ?";
+                                    senYuDataSourceOne.updateMOMain(sql1, "true," + message, busSplit[0]);
+                                } else {
+                                    //普通采购回写
+                                    String sql = "update PO_Pomain set cDefine12 = ? where cPOID = ?";
+                                    senYuDataSourceOne.updateMOMain(sql, "false," + message, busSplit[0]);
+                                    //订单委外
+                                    String sql1 = "update HY_MOMain set cDefine10 = ? where cCode = ?";
+                                    senYuDataSourceOne.updateMOMain(sql1, "false," + message, busSplit[0]);
+                                }
+                            }
+                            //账套012
 
+                        }
+                    }
                 }
-            }
-            }
-
-            //回写委外订单接口最后时间
-            Date datetome = sf.parse(beginTime);
-            dxpDataPlanService.updateLastTime(datetome,"senYu_moMain");
 
+                //回写委外订单接口最后时间
+                Date datetome = sf.parse(beginTime);
+                dxpDataPlanService.updateLastTime(datetome, "senYu_moMain");
+            }
         } catch (Exception e) {
             log.error(e.getMessage());
         }

+ 86 - 78
jeecg-boot-module-system/src/main/java/org/jeecg/modules/openApi/controller/POPomainController.java

@@ -69,16 +69,21 @@ public class POPomainController implements ApplicationContextAware {
                 if (pkorgValue[0].equals("one")) {
                     //ven.cVenName,mo.cVenCode
                     //cAuditTime>'"+lasttimeSf+"' and mo.iverifystateex = 2
-                    String sql = "select top 1 mo.POID as 'MOID','"+ac+"' as accId,mo.cState as 'poStatus',mo.cPOID as 'poNum'," +
-                            "'STANDARD_PO' as 'poType', '0085' as 'supplierNumber'," +
-                            "'森鑫' as 'supplierName',ven.cVenPerson as 'supplierContacts',ven.cVenBranchPhone as 'supplierContactsPhone'," +
-                            "mo.cMaker as 'buyerCode',mo.cVenPerson as 'customerContacts','' as 'customerContactsPhone','0.00' as 'totalAmount'," +
-                            "'0.00' as 'exTotalAmount', mo.cexch_name as 'currencyCode',mo.iTaxRate as 'headerTaxRate'," +
+                    String sql = "select mo.POID as 'headerAttributeString6','"+ac+"' as accId,mo.cState as 'poStatus',mo.cPOID as 'poNum','STANDARD_PO' as 'poType'," +
+                            "'0085' as 'supplierNumber','采购业务实体名称' as 'poBusinessUnitCode','森鑫' as 'supplierName'," +
+                            "ven.cVenPerson as 'supplierContacts',ven.cVenBranchPhone as 'supplierContactsPhone',mo.cVenPerson as 'customerContacts'," +
+                            "mo.cPOID as headerAttributeString2,'' as 'customerContactsPhone','0.00' as 'totalAmount','0.00' as 'exTotalAmount'," +
+                            "'0.00' as 'exTaxAmount', curr.cexch_code as 'currencyCode',mo.iTaxRate as 'headerTaxRate'," +
                             "mo.dPODate as 'customerDemandDate','' as 'supplierPromiseDate', mo.cMemo as 'remark','' as 'sourceDocNum'," +
-                            "'' as 'buyerCode',mo.cMaker as 'buyerName',mo.cmaketime  as 'publishDate','' as 'headerAttributeString1', '' as 'headerAttributeString2','' as 'headerAttributeString3','' as 'headerAttributeString4'  " +
-                            "from PO_Pomain mo " +
-                            "left join Vendor ven " +
-                            "on mo.cVenCode = ven.cVenCode where cPOID = 'SYE小周样1' order by mo.cAuditTime desc";
+                            "hr.cPsn_Num as 'buyerId',mo.cMaker as 'buyerCode',mo.cPersonCode as salerId,hr1.cPsn_Name as salerCode," +
+                            " mo.cmaketime  as 'publishDate'  from PO_Pomain mo left join Vendor ven on mo.cVenCode = ven.cVenCode " +
+                            "left join (select cPsn_Num, cPsn_Name from hr_hi_person) hr " +
+                            "on mo.cMaker = hr.cPsn_Name " +
+                            "left join (select cPsn_Num, cPsn_Name from hr_hi_person) hr1 " +
+                            "on mo.cPersonCode = hr1.cPsn_Num " +
+                            "left join foreigncurrency curr " +
+                            "on mo.cexch_name = curr.cexch_name " +
+                            "where cAuditTime>'"+lasttimeSf+"' and mo.iverifystateex = 2 order by mo.cAuditTime desc";
                     List<Map<String, Object>> list = senYuDataSourceOne.queryForList(sql);
                     for(Map<String, Object> map:list){
                         sumlist.add(map);
@@ -90,79 +95,82 @@ public class POPomainController implements ApplicationContextAware {
                 }
             }
 
-            //循环集合,一条一条传
-            for(Map<String, Object> map:sumlist){
-            //转JSON且赋值
-            //转JSON且赋值
-            Gson userGson=new GsonBuilder().create();
-            result.put("payload", userGson.toJson(JsonChangeUtils.toPoMainJson(map)));
-
-            log.info("查询到的数据:" + result);
-
-            //获取当前接口同步信息,对方接口地址
-            //拼接url
-            String url = resultList.get(0).getItemIp() + resultList.get(0).getItemUrl();
-            //调用doPost
-            InterfaceConnUtils interfaceConnUtils = new InterfaceConnUtils();
-            //处理返回信息
-            JSONObject informationJson = interfaceConnUtils.doPostToBearer(result, url, "采购订单接口-");
-
-            JSONArray jsonArray = informationJson.getJSONArray("headers");
-            if (jsonArray.size() != 0) {
-                //获取4个账套值
-                String yi = "";
-                String er = "";
-                String san = "";
-                String si = "";
-                for (String str : pkorgSplit) {
-                    String pkorgStr = str;
-                    String pkorgValue[] = pkorgStr.split(":");
-                    if (pkorgValue[0].equals("one")) {
-                        yi = pkorgValue[1];
-                    }
-                    if (pkorgValue[0].equals("two")) {
-                        er = pkorgValue[1];
-                    }
-                    if (pkorgValue[0].equals("three")) {
-                        san = pkorgValue[1];
-                    }
-                    if (pkorgValue[0].equals("four")) {
-                        si = pkorgValue[1];
-                    }
-                }
-                //回写U8物料信息表是否同步成功字段
-                Iterator<Object> it = jsonArray.iterator();
-                while (it.hasNext()) {
-                    JSONObject jo = (JSONObject) it.next();
-                    //获取是否成功
-                    String code = jo.getString("code");
-                    //获取返回消息
-                    String message = jo.getString("message");
-                    //获取moId
-                    String moId = jo.getString("moId");
-                    //账套号
-                    String accId = jo.getString("accId");
-                    //账套666
-                    if (accId.equals(yi)) {
-                        if (code.equals("S")) {
-                            //普通采购回写
-                            String sql = "update PO_Pomain set cDefine10 = ? where POID = ?";
-                            senYuDataSourceOne.updatePOMain(sql, "true," + message, moId);
-                        } else {
-                            //普通采购回写
-                            String sql = "update PO_Pomain set cDefine10 = ? where POID = ?";
-                            senYuDataSourceOne.updatePOMain(sql, "false," + message, moId);
+            if(sumlist.size()==0){
+                log.info("未查询到的数据!");
+            }else {
+                //循环集合,一条一条传
+                for (Map<String, Object> map : sumlist) {
+                    //转JSON且赋值
+                    //转JSON且赋值
+                    Gson userGson = new GsonBuilder().create();
+                    result.put("payload", userGson.toJson(JsonChangeUtils.toPoMainJson(map)));
+
+                    log.info("查询到的数据:" + result);
+
+                    //获取当前接口同步信息,对方接口地址
+                    //拼接url
+                    String url = resultList.get(0).getItemIp() + resultList.get(0).getItemUrl();
+                    //调用doPost
+                    InterfaceConnUtils interfaceConnUtils = new InterfaceConnUtils();
+                    //处理返回信息
+                    JSONObject informationJson = interfaceConnUtils.doPostToBearer(result, url, "采购订单接口-");
+
+                    JSONArray jsonArray = informationJson.getJSONArray("headers");
+                    if (jsonArray.size() != 0) {
+                        //获取4个账套值
+                        String yi = "";
+                        String er = "";
+                        String san = "";
+                        String si = "";
+                        for (String str : pkorgSplit) {
+                            String pkorgStr = str;
+                            String pkorgValue[] = pkorgStr.split(":");
+                            if (pkorgValue[0].equals("one")) {
+                                yi = pkorgValue[1];
+                            }
+                            if (pkorgValue[0].equals("two")) {
+                                er = pkorgValue[1];
+                            }
+                            if (pkorgValue[0].equals("three")) {
+                                san = pkorgValue[1];
+                            }
+                            if (pkorgValue[0].equals("four")) {
+                                si = pkorgValue[1];
+                            }
                         }
-                    }
-                    //账套012
+                        //回写U8物料信息表是否同步成功字段
+                        Iterator<Object> it = jsonArray.iterator();
+                        while (it.hasNext()) {
+                            JSONObject jo = (JSONObject) it.next();
+                            //获取是否成功
+                            String code = jo.getString("code");
+                            //获取返回消息
+                            String message = jo.getString("message");
+                            //获取moId
+                            String moId = jo.getString("moId");
+                            //账套号
+                            String accId = jo.getString("accId");
+                            //账套666
+                            if (accId.equals(yi)) {
+                                if (code.equals("S")) {
+                                    //普通采购回写
+                                    String sql = "update PO_Pomain set cDefine10 = ? where POID = ?";
+                                    senYuDataSourceOne.updatePOMain(sql, "true," + message, moId);
+                                } else {
+                                    //普通采购回写
+                                    String sql = "update PO_Pomain set cDefine10 = ? where POID = ?";
+                                    senYuDataSourceOne.updatePOMain(sql, "false," + message, moId);
+                                }
+                            }
+                            //账套012
 
+                        }
+                    }
                 }
+                //回写委外订单接口最后时间
+                Date datetome = sf.parse(beginTime);
+                dxpDataPlanService.updateLastTime(datetome, "senYu_poMain");
             }
-            }
-            //回写委外订单接口最后时间
-            Date datetome = sf.parse(beginTime);
-            dxpDataPlanService.updateLastTime(datetome,"senYu_poMain");
-
         } catch (Exception e) {
             log.error(e.getMessage());
         }

+ 4 - 8
jeecg-boot-module-system/src/main/java/org/jeecg/modules/openApi/controller/RdrecordController.java

@@ -130,18 +130,14 @@ public class RdrecordController implements ApplicationContextAware {
                     if (busSplit[1].equals(yi)) {
                         if (code.equals("S")) {
                             //普通采购回写
-                            String sql = "update PO_Pomain set cDefine12 = ? where cPOID = ?";
+                            String sql = "update rdrecord11 set cDefine10 = ? where cPOID = ?";
                             senYuDataSourceOne.updateRdrecord(sql, "true," + message, busSplit[0]);
-                            //订单委外
-                            String sql1 = "update HY_MOMain set cDefine10 = ? where cCode = ?";
-                            senYuDataSourceOne.updateRdrecord(sql1, "true," + message, busSplit[0]);
+
                         } else {
                             //普通采购回写
-                            String sql = "update PO_Pomain set cDefine12 = ? where cPOID = ?";
+                            String sql = "update rdrecord11 set cDefine10 = ? where cPOID = ?";
                             senYuDataSourceOne.updateRdrecord(sql, "false," + message, busSplit[0]);
-                            //订单委外
-                            String sql1 = "update HY_MOMain set cDefine10 = ? where cCode = ?";
-                            senYuDataSourceOne.updateRdrecord(sql1, "false," + message, busSplit[0]);
+
                         }
                     }
                     //账套012

+ 29 - 29
jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/util/JsonChangeUtils.java

@@ -64,19 +64,19 @@ public class JsonChangeUtils implements ApplicationContextAware{
 //                        "'56' as lineAttributeString3,'78' as lineAttributeString4,cbMemo as lineAttributeString5 " +
 //                        "from OM_MODetails where MOID = "+map.get("MOID");
                 //mo.cInvCode,inv.cInvName
-                String sql = "select mo.iVouchRowNo as 'poLineNum',mo.MODetailsID as MODetailsID,mo.MODetailsID as 'moDetailId','"+map.get("headerAttributeString6")+"' as MOID,'"+map.get("accId")+"' as 'accId'" +
-                        ",'"+map.get("poNum")+"' as poNum,'N0201002142' as 'customerItemCode','35%棉65%涤 平纹汗布' as 'itemName','' as 'poLineStatus', " +
-                        "mo.cFree1 as 'attributeValue1',mo.cFree2 as 'attributeValue2',mo.cFree3 as 'attributeValue3'," +
-                        "mo.cFree4 as 'attributeValue4','cfree1' as 'attributeCode1','cfree2'  as 'attributeCode2'," +
-                        "'cfree3'  as 'attributeCode3','cfree4'  as 'attributeCode4'," +
-                        "mo.iQuantity as 'customerDemandQty',mo.cUnitID as 'customerUomCode','"+map.get("customerDemandDate")+"' as 'customerDemandDate',mo.dArriveDate as 'customerPromiseDate'," +
+                String sql = "select mo.iVouchRowNo as 'poLineNum',mo.MODetailsID as MODetailsID,mo.MODetailsID as 'moDetailId'," +
+                        "'' as receivingInventoryOrgCode,'"+map.get("headerAttributeString6")+"' as MOID,'"+map.get("accId")+"' as 'accId'," +
+                        "'"+map.get("poNum")+"' as poNum,mo.cInvCode as 'customerItemCode',inv.cInvName as 'itemName'," +
+                        "'' as 'poLineStatus',mo.cFree1 as 'attributeValue1',mo.cFree2 as 'attributeValue2',mo.cFree3 as 'attributeValue3'," +
+                        "mo.cFree4 as 'attributeValue4','cfree1' as 'attributeCode1','cfree2'  as 'attributeCode2','cfree3'  as 'attributeCode3'," +
+                        "'cfree4'  as 'attributeCode4',mo.iQuantity as 'customerDemandQty',mo.cUnitID as 'customerUomCode'," +
+                        "'"+map.get("customerDemandDate")+"' as 'customerDemandDate',mo.dArriveDate as 'customerPromiseDate'," +
                         "mo.iUnitPrice as 'customerPrice',(mo.iPerTaxRate/100) as 'lineTaxRate',mo.iMoney as 'amount'," +
                         "mo.cDefine28 as 'lineAttributeString1',mo.cDefine32 as 'lineAttributeString2',mo.cDefine29 as 'lineAttributeString3'," +
-                        "mo.cDefine30 as 'lineAttributeString4',mo.cbMemo as 'lineAttributeString5',cFree1 as 'color','' as 'customerNumber','' as externalLineNum," +
-                        "'' as itemAttrId,'"+map.get("headerAttributeString6")+"' as poId " +
-                        " from OM_MODetails mo " +
-                        " left join Inventory inv " +
-                        " on mo.cInvCode = inv.cInvCode " +
+                        "mo.cDefine30 as 'lineAttributeString4',mo.cbMemo as 'lineAttributeString5',mo.cDefine22 as lineAttributeString6,'' as lineAttributeString7,'' as lineAttributeString8," +
+                        "cFree1 as 'color','' as 'customerNumber'," +
+                        "'' as externalLineNum,'' as itemAttrId,'"+map.get("headerAttributeString6")+"' as poId  from OM_MODetails mo  " +
+                        "left join Inventory inv  on mo.cInvCode = inv.cInvCode"+
                         " where mo.MOID = "+map.get("headerAttributeString6");
                 List<Map<String, Object>> list = senYuDataSourceOne.queryForList(sql);
                 //子表转JSON
@@ -123,18 +123,17 @@ public class JsonChangeUtils implements ApplicationContextAware{
 //                        "iSum as lineTotalPrice,'' as smallPo,'' as packId,'' as distributionPoint,'' as dyeFactoryCode,cbMemo as cbMemo " +
 //                        "from PO_Podetails  where POID = '"+map.get("POID")+"'";
 
-                String sql ="select '903' as 'accId',mo.iVouchRowNo as 'poLineNum',ID as 'moDetailId','"+map.get("poNum")+"' as poNum,mo.cInvCode as 'customerItemCode',inv.cInvName as 'itemName'," +
-                        "'' as 'poLineStatus',mo.cFree1 as 'attributeValue1',mo.cFree2 as 'attributeValue2'," +
-                        "mo.cFree3 as 'attributeValue3',mo.cFree4 as 'attributeValue4','cfree1' as 'attributeCode1'," +
-                        "'cfree2'  as 'attributeCode2','cfree3'  as 'attributeCode3','cfree4'  as 'attributeCode4'," +
-                        "mo.iQuantity as 'customerDemandQty',mo.cUnitID as 'customerUomCode','"+map.get("customerDemandDate")+"' as 'customerDemandDate',mo.dArriveDate as 'customerPromiseDate'," +
-                        "mo.iUnitPrice as 'customerPrice',(mo.iPerTaxRate/100) as 'lineTaxRate',mo.iMoney as 'amount'," +
-                        "'' as 'lineAttributeString1','' as 'lineAttributeString2','' as 'lineAttributeString3','' as 'attributeString1'," +
-                        "'' as 'lineAttributeString4','' as 'color','' as 'externalLineNum',0 as 'itemAttrId' " +
-                        "from PO_Podetails mo " +
-                        "left join Inventory inv " +
-                        "on mo.cInvCode = inv.cInvCode "+
-                        "where mo.POID = '"+map.get("MOID")+"'";
+                String sql ="select '"+map.get("accId")+"' as 'accId',mo.iVouchRowNo as 'poLineNum',ID as 'moDetailId','"+map.get("poNum")+"' as poNum," +
+                        "mo.cInvCode as 'customerItemCode',inv.cInvName as 'itemName','' as 'poLineStatus'," +
+                        "'' as receivingInventoryOrgCode,mo.cFree1 as 'attributeValue1',mo.cFree2 as 'attributeValue2'," +
+                        "mo.cFree3 as 'attributeValue3',mo.cFree4 as 'attributeValue4','cfree1' as 'attributeCode1','cfree2'  as 'attributeCode2'," +
+                        "'cfree3'  as 'attributeCode3','cfree4'  as 'attributeCode4',mo.iQuantity as 'customerDemandQty',mo.cUnitID as 'customerUomCode'," +
+                        "'"+map.get("customerDemandDate")+"' as 'customerDemandDate',mo.dArriveDate as 'customerPromiseDate'," +
+                        "mo.iUnitPrice as 'customerPrice',(mo.iPerTaxRate/100) as 'lineTaxRate',mo.iMoney as 'amount','' as 'lineAttributeString1'," +
+                        "'' as 'lineAttributeString2','' as 'lineAttributeString3','' as 'attributeString1','' as 'lineAttributeString4'," +
+                        "mo.cbMemo as 'lineAttributeString5',mo.cDefine22 as lineAttributeString6,'' as lineAttributeString7,'' as lineAttributeString8,'' as 'color'," +
+                        "'' as 'externalLineNum',0 as 'itemAttrId' from PO_Podetails mo left join Inventory inv on mo.cInvCode = inv.cInvCode"+
+                        "where mo.POID = '"+map.get("headerAttributeString6")+"'";
                 List<Map<String, Object>> list = senYuDataSourceOne.queryForList(sql);
                 //子表转JSON
                 List<JSONObject> json = toListJson(list);
@@ -245,12 +244,13 @@ public class JsonChangeUtils implements ApplicationContextAware{
 //                        "'' as outsourceAttributeString3,'' as iUnitQuantity " +
 //                        " from OM_MOMaterials where MOMaterialsID = "+map.get("MODetailsID");
 
-                String sql1 = "select '903' as accId,'"+map.get("MOID")+"' as poId,'"+map.get("poNum")+"' as poNum,'N0201002142' as 'customerItemCode','' as 'itemAttrId','cfree1' as attributeCode1," +
-                        "'cfree2' as attributeCode2,'cfree3' as attributeCode3,'cfree4' as attributeCode4,cFree1 as attributeValue1,cFree2 as attributeValue2," +
-                        "cFree3 as attributeValue3,cFree4 as attributeValue4,'' as 'customerUomId','' as customerUomCode,0 as customerPromiseQty," +
-                        " cDefine25 as outsourceAttributeString1,cDefine24 as 'outsourceAttributeString2'," +
-                        "cDefine27 as 'outsourceAttributeString3' from OM_MOMaterials " +
-                        "where MODetailsID = '"+map.get("MODetailsID")+"'";
+                String sql1 = "select '"+map.get("accId")+"' as accId,'"+map.get("MOID")+"' as poId,'"+map.get("poNum")+"' as poNum," +
+                        "'N0201002142' as 'customerItemCode','' as 'itemAttrId','cfree1' as attributeCode1,'' as customerItemId," +
+                        "'cfree2' as attributeCode2,'cfree3' as attributeCode3,'cfree4' as attributeCode4,'' as poOutsourceId," +
+                        "''as poOutsourceNum,cFree1 as attributeValue1,cFree2 as attributeValue2,cFree3 as attributeValue3," +
+                        "cFree4 as attributeValue4,'' as 'customerUomId','' as customerUomCode,0 as customerPromiseQty, " +
+                        "cDefine25 as outsourceAttributeString1,cDefine24 as 'outsourceAttributeString2',cDefine27 as 'outsourceAttributeString3'" +
+                        " from OM_MOMaterials where MODetailsID  = '"+map.get("MODetailsID")+"'";
                 List<Map<String, Object>> list = senYuDataSourceOne.queryForList(sql1);
                 //子表转JSON
                 List<JSONObject> json = toListJson(list);