Selaa lähdekoodia

供应商产能报表

huxy 4 vuotta sitten
vanhempi
commit
1ab3afe1c8
81 muutettua tiedostoa jossa 7084 lisäystä ja 33 poistoa
  1. 14 0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/oConvertUtils.java
  2. 53 0
      jeecg-boot-module-system/src/main/java/org/jeecg/config/transactional/ComboTransaction.java
  3. 28 0
      jeecg-boot-module-system/src/main/java/org/jeecg/config/transactional/Db1TxBroker.java
  4. 27 0
      jeecg-boot-module-system/src/main/java/org/jeecg/config/transactional/Db2TxBroker.java
  5. 13 0
      jeecg-boot-module-system/src/main/java/org/jeecg/config/transactional/DbTxConstants.java
  6. 44 0
      jeecg-boot-module-system/src/main/java/org/jeecg/config/transactional/MultiTransactionAop.java
  7. 16 0
      jeecg-boot-module-system/src/main/java/org/jeecg/config/transactional/MultiTransactional.java
  8. 167 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/failDocument/controller/SyFailDocumentController.java
  9. 55 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/failDocument/entity/SyFailDocument.java
  10. 17 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/failDocument/mapper/SyFailDocumentMapper.java
  11. 5 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/failDocument/mapper/xml/SyFailDocumentMapper.xml
  12. 14 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/failDocument/service/ISyFailDocumentService.java
  13. 19 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/failDocument/service/impl/SyFailDocumentServiceImpl.java
  14. 167 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/orderData/controller/SyOrderDataController.java
  15. 167 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/orderData/controller/SyOrderDataItemController.java
  16. 169 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/orderData/entity/SyOrderData.java
  17. 163 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/orderData/entity/SyOrderDataItem.java
  18. 17 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/orderData/mapper/SyOrderDataItemMapper.java
  19. 17 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/orderData/mapper/SyOrderDataMapper.java
  20. 5 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/orderData/mapper/xml/SyOrderDataItemMapper.xml
  21. 5 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/orderData/mapper/xml/SyOrderDataMapper.xml
  22. 14 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/orderData/service/ISyOrderDataItemService.java
  23. 14 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/orderData/service/ISyOrderDataService.java
  24. 19 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/orderData/service/impl/SyOrderDataItemServiceImpl.java
  25. 19 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/orderData/service/impl/SyOrderDataServiceImpl.java
  26. 254 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/shippingDetails/controller/SyShippingDetailsController.java
  27. 167 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/shippingDetails/controller/SyShippingDetailsItemController.java
  28. 124 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/shippingDetails/entity/SyShippingDetails.java
  29. 267 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/shippingDetails/entity/SyShippingDetailsItem.java
  30. 148 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/shippingDetails/entity/VO/OrderDataVo.java
  31. 125 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/shippingDetails/entity/VO/SyShippingDetailsVo.java
  32. 17 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/shippingDetails/mapper/SyShippingDetailsItemMapper.java
  33. 27 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/shippingDetails/mapper/SyShippingDetailsMapper.java
  34. 5 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/shippingDetails/mapper/xml/SyShippingDetailsItemMapper.xml
  35. 38 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/shippingDetails/mapper/xml/SyShippingDetailsMapper.xml
  36. 14 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/shippingDetails/service/ISyShippingDetailsItemService.java
  37. 32 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/shippingDetails/service/ISyShippingDetailsService.java
  38. 19 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/shippingDetails/service/impl/SyShippingDetailsItemServiceImpl.java
  39. 100 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/shippingDetails/service/impl/SyShippingDetailsServiceImpl.java
  40. 152 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/openApi/controller/DxpDataPlanController.java
  41. 298 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/openApi/controller/MOMainController.java
  42. 100 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/openApi/controller/PDARdrecord11Controller.java
  43. 295 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/openApi/controller/POPomainController.java
  44. 68 4
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/openApi/controller/PurchaseWarehousingController.java
  45. 179 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/openApi/controller/RdrecordController.java
  46. 207 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/openApi/controller/SubcontractingOrderController.java
  47. 7 3
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/openApi/controller/TestController.java
  48. 96 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/openApi/entity/DxpDataPlan.java
  49. 65 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/openApi/entity/ResHttpStatus.java
  50. 25 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/openApi/entity/SubcontractingOrder.java
  51. 20 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/openApi/mapper/DxpDataPlanMapper.java
  52. 174 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/openApi/mapper/PurchaseWarehousingMapper.java
  53. 88 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/openApi/mapper/SubcontractingOrderMapper.java
  54. 10 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/openApi/mapper/xml/DxpDataPlanMapper.xml
  55. 538 1
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/openApi/mapper/xml/PurchaseWarehousingMapper.xml
  56. 207 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/openApi/mapper/xml/SubcontractingOrderMapper.xml
  57. 19 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/openApi/service/IDxpDataPlanService.java
  58. 14 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/openApi/service/IPurchaseWarehousingService.java
  59. 14 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/openApi/service/IRdrecord11Service.java
  60. 18 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/openApi/service/ISenYuDataSourceThree.java
  61. 18 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/openApi/service/ISenYuDataSourceTwo.java
  62. 25 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/openApi/service/SubcontractingOrderService.java
  63. 35 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/openApi/service/impl/DxpDataPlanServiceImpl.java
  64. 481 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/openApi/service/impl/PurchaseWarehousingServiceImpl.java
  65. 79 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/openApi/service/impl/Rdrecord11ServiceImpl.java
  66. 5 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/openApi/service/impl/SenYuDataSourceOneServiceImpl.java
  67. 37 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/openApi/service/impl/SenYuDataSourceThreeServiceImpl.java
  68. 36 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/openApi/service/impl/SenYuDataSourceTwoServiceImpl.java
  69. 234 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/openApi/service/impl/SubcontractingOrderImpl.java
  70. 43 4
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/quartz/job/AsyncJob.java
  71. 41 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/report/entity/FabricLoss.java
  72. 42 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/report/mapper/FabricLossMapper.java
  73. 52 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/report/mapper/xml/FabricLossMapper.xml
  74. 36 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/report/service/IFabricLossService.java
  75. 76 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/report/service/impl/FabricLossServiceImpl.java
  76. 46 2
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/util/InterfaceConnUtils.java
  77. 525 6
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/util/JsonChangeUtils.java
  78. 45 1
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/util/oConvertUtils.java
  79. 35 9
      jeecg-boot-module-system/src/main/resources/application-prod.yml
  80. 3 3
      jeecg-boot-module-system/src/main/resources/jeecg/jeecg_database.properties
  81. 11 0
      pom.xml

+ 14 - 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/oConvertUtils.java

@@ -665,4 +665,18 @@ public class oConvertUtils {
 		}
 		return json;
 	}
+
+
+	//生成uuid
+	public static String id() {
+		String uuid = UUID.randomUUID().toString();
+		char[] ar = uuid.toCharArray();
+		StringBuilder sb = new StringBuilder();
+		for (int i = 0; i < ar.length; i++) {
+			if (ar[i] != '-') {
+				sb.append(ar[i]);
+			}
+		}
+		return sb.toString();
+	}
 }

+ 53 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/config/transactional/ComboTransaction.java

@@ -0,0 +1,53 @@
+package org.jeecg.config.transactional;
+
+import org.apache.commons.lang.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.concurrent.Callable;
+import java.util.stream.Stream;
+
+/**
+ * 功能描述:
+ *
+ * @Author: chenchuang
+ * @Date: 2022/3/31 16:56
+ */
+
+@Component
+public class ComboTransaction {
+    @Autowired
+    private Db1TxBroker db1TxBroker;
+
+    @Autowired
+    private Db2TxBroker db2TxBroker;
+
+    public <V> V inCombinedTx(Callable<V> callable, String[] transactions) {
+        if (callable == null) {
+            return null;
+        }
+
+        Callable<V> combined = Stream.of(transactions)
+                .filter(ele -> !StringUtils.isEmpty(ele))
+                .distinct()
+                .reduce(callable, (r, tx) -> {
+                    switch (tx) {
+                        case DbTxConstants.DB1_TX:
+                            return () -> db1TxBroker.inTransaction(r);
+                        case DbTxConstants.DB2_TX:
+                            return () -> db2TxBroker.inTransaction(r);
+                        default:
+                            return null;
+                    }
+                }, (r1, r2) -> r2);
+
+        try {
+            return combined.call();
+        } catch (RuntimeException e) {
+            throw e;
+        } catch (Exception e) {
+            throw new RuntimeException(e);
+        }
+    }
+
+}

+ 28 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/config/transactional/Db1TxBroker.java

@@ -0,0 +1,28 @@
+package org.jeecg.config.transactional;
+
+import org.springframework.stereotype.Component;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.concurrent.Callable;
+
+/**
+ * 功能描述:
+ *
+ * @Author: chenchuang
+ * @Date: 2022/3/31 16:57
+ */
+
+@Component
+public class Db1TxBroker {
+    @Transactional(DbTxConstants.DB1_TX)
+    public <V> V inTransaction(Callable<V> callable) {
+        try {
+            return callable.call();
+        } catch (RuntimeException e) {
+            throw e;
+        } catch (Exception e) {
+            throw new RuntimeException(e);
+        }
+    }
+
+}

+ 27 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/config/transactional/Db2TxBroker.java

@@ -0,0 +1,27 @@
+package org.jeecg.config.transactional;
+
+import org.springframework.stereotype.Component;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.concurrent.Callable;
+
+/**
+ * 功能描述:
+ *
+ * @Author: chenchuang
+ * @Date: 2022/3/31 16:58
+ */
+
+@Component
+public class Db2TxBroker {
+    @Transactional(value = DbTxConstants.DB2_TX)
+    public <V> V inTransaction(Callable<V> callable) {
+        try {
+            return callable.call();
+        } catch (RuntimeException e) {
+            throw e;
+        } catch (Exception e) {
+            throw new RuntimeException(e);
+        }
+    }
+}

+ 13 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/config/transactional/DbTxConstants.java

@@ -0,0 +1,13 @@
+package org.jeecg.config.transactional;
+
+/**
+ * 功能描述:
+ *
+ * @Author: chenchuang
+ * @Date: 2022/3/31 16:50
+ */
+public class DbTxConstants {
+    public static final String DB1_TX = "master";
+
+    public static final String DB2_TX = "multidatasource1";
+}

+ 44 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/config/transactional/MultiTransactionAop.java

@@ -0,0 +1,44 @@
+package org.jeecg.config.transactional;
+
+import org.aspectj.lang.ProceedingJoinPoint;
+import org.aspectj.lang.annotation.Around;
+import org.aspectj.lang.annotation.Aspect;
+import org.aspectj.lang.annotation.Pointcut;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+/**
+ * 功能描述:
+ *
+ * @Author: chenchuang
+ * @Date: 2022/3/31 16:50
+ */
+
+@Aspect
+@Component
+public class MultiTransactionAop {
+    private final ComboTransaction comboTransaction;
+
+    @Autowired
+    public MultiTransactionAop(ComboTransaction comboTransaction) {
+        this.comboTransaction = comboTransaction;
+    }
+
+    @Pointcut("@annotation(org.jeecg.config.transactional.MultiTransactional)")
+    public void pointCut() {
+    }
+
+    @Around("pointCut() && @annotation(multiTransactional)")
+    public Object inMultiTransactions(ProceedingJoinPoint pjp, MultiTransactional multiTransactional) {
+        return comboTransaction.inCombinedTx(() -> {
+            try {
+                return pjp.proceed();
+            } catch (Throwable throwable) {
+                if (throwable instanceof RuntimeException) {
+                    throw (RuntimeException) throwable;
+                }
+                throw new RuntimeException(throwable);
+            }
+        }, multiTransactional.value());
+    }
+}

+ 16 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/config/transactional/MultiTransactional.java

@@ -0,0 +1,16 @@
+package org.jeecg.config.transactional;
+
+import java.lang.annotation.*;
+
+/**
+ * 功能描述:
+ *
+ * @Author: chenchuang
+ * @Date: 2022/3/31 16:49
+ */
+@Target(ElementType.METHOD)
+@Retention(RetentionPolicy.RUNTIME)
+@Documented
+public @interface MultiTransactional {
+    String[] value() default {};
+}

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

@@ -0,0 +1,167 @@
+package org.jeecg.modules.documents.failDocument.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.failDocument.entity.SyFailDocument;
+import org.jeecg.modules.documents.failDocument.service.ISyFailDocumentService;
+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-28
+ * @Version: V1.0
+ */
+@Slf4j
+@Api(tags="失败单据汇总表")
+@RestController
+@RequestMapping("/failDocument/syFailDocument")
+public class SyFailDocumentController extends JeecgController<SyFailDocument, ISyFailDocumentService> {
+	@Autowired
+	private ISyFailDocumentService syFailDocumentService;
+	
+	/**
+	 * 分页列表查询
+	 *
+	 * @param syFailDocument
+	 * @param pageNo
+	 * @param pageSize
+	 * @param req
+	 * @return
+	 */
+	@AutoLog(value = "失败单据汇总表-分页列表查询")
+	@ApiOperation(value="失败单据汇总表-分页列表查询", notes="失败单据汇总表-分页列表查询")
+	@GetMapping(value = "/list")
+	public Result<?> queryPageList(SyFailDocument syFailDocument,
+								   @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
+								   @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
+								   HttpServletRequest req) {
+		QueryWrapper<SyFailDocument> queryWrapper = QueryGenerator.initQueryWrapper(syFailDocument, req.getParameterMap());
+		Page<SyFailDocument> page = new Page<SyFailDocument>(pageNo, pageSize);
+		IPage<SyFailDocument> pageList = syFailDocumentService.page(page, queryWrapper);
+		return Result.OK(pageList);
+	}
+	
+	/**
+	 * 添加
+	 *
+	 * @param syFailDocument
+	 * @return
+	 */
+	@AutoLog(value = "失败单据汇总表-添加")
+	@ApiOperation(value="失败单据汇总表-添加", notes="失败单据汇总表-添加")
+	@PostMapping(value = "/add")
+	public Result<?> add(@RequestBody SyFailDocument syFailDocument) {
+		syFailDocumentService.save(syFailDocument);
+		return Result.OK("添加成功!");
+	}
+	
+	/**
+	 * 编辑
+	 *
+	 * @param syFailDocument
+	 * @return
+	 */
+	@AutoLog(value = "失败单据汇总表-编辑")
+	@ApiOperation(value="失败单据汇总表-编辑", notes="失败单据汇总表-编辑")
+	@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
+	public Result<?> edit(@RequestBody SyFailDocument syFailDocument) {
+		syFailDocumentService.updateById(syFailDocument);
+		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) {
+		syFailDocumentService.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.syFailDocumentService.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) {
+		SyFailDocument syFailDocument = syFailDocumentService.getById(id);
+		return Result.OK(syFailDocument);
+	}
+
+  /**
+   * 导出excel
+   *
+   * @param request
+   * @param syFailDocument
+   */
+  @RequestMapping(value = "/exportXls")
+  public ModelAndView exportXls(HttpServletRequest request, SyFailDocument syFailDocument) {
+      return super.exportXls(request, syFailDocument, SyFailDocument.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, SyFailDocument.class);
+  }
+
+}

+ 55 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/failDocument/entity/SyFailDocument.java

@@ -0,0 +1,55 @@
+package org.jeecg.modules.documents.failDocument.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-28
+ * @Version: V1.0
+ */
+@Data
+@TableName("sy_fail_document")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value="sy_fail_document对象", description="失败单据汇总表")
+public class SyFailDocument {
+    
+	/**主键*/
+	@TableId(type = IdType.ASSIGN_ID)
+    @ApiModelProperty(value = "主键")
+	private java.lang.String id;
+	/**单据类型*/
+	@Excel(name = "单据类型", width = 15)
+    @ApiModelProperty(value = "单据类型")
+	private java.lang.String documentType;
+	/**单据号*/
+	@Excel(name = "单据号", width = 15)
+    @ApiModelProperty(value = "单据号")
+	private java.lang.String documentNo;
+	/**单据日期*/
+	@Excel(name = "单据日期", width = 15)
+    @ApiModelProperty(value = "单据日期")
+	private java.lang.String documentDate;
+	/**单据状态(0失败,1成功)*/
+	@Excel(name = "单据状态(0失败,1成功)", width = 15)
+    @ApiModelProperty(value = "单据状态(0失败,1成功)")
+	private java.lang.String documentStatus;
+	/**原因*/
+	@Excel(name = "原因", width = 15)
+    @ApiModelProperty(value = "原因")
+	private java.lang.Object reason;
+}

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

@@ -0,0 +1,17 @@
+package org.jeecg.modules.documents.failDocument.mapper;
+
+import java.util.List;
+
+import org.apache.ibatis.annotations.Param;
+import org.jeecg.modules.documents.failDocument.entity.SyFailDocument;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * @Description: 失败单据汇总表
+ * @Author: jeecg-boot
+ * @Date:   2022-04-28
+ * @Version: V1.0
+ */
+public interface SyFailDocumentMapper extends BaseMapper<SyFailDocument> {
+
+}

+ 5 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/failDocument/mapper/xml/SyFailDocumentMapper.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.failDocument.mapper.SyFailDocumentMapper">
+
+</mapper>

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

@@ -0,0 +1,14 @@
+package org.jeecg.modules.documents.failDocument.service;
+
+import org.jeecg.modules.documents.failDocument.entity.SyFailDocument;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * @Description: 失败单据汇总表
+ * @Author: jeecg-boot
+ * @Date:   2022-04-28
+ * @Version: V1.0
+ */
+public interface ISyFailDocumentService extends IService<SyFailDocument> {
+
+}

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

@@ -0,0 +1,19 @@
+package org.jeecg.modules.documents.failDocument.service.impl;
+
+import org.jeecg.modules.documents.failDocument.entity.SyFailDocument;
+import org.jeecg.modules.documents.failDocument.mapper.SyFailDocumentMapper;
+import org.jeecg.modules.documents.failDocument.service.ISyFailDocumentService;
+import org.springframework.stereotype.Service;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+
+/**
+ * @Description: 失败单据汇总表
+ * @Author: jeecg-boot
+ * @Date:   2022-04-28
+ * @Version: V1.0
+ */
+@Service
+public class SyFailDocumentServiceImpl extends ServiceImpl<SyFailDocumentMapper, SyFailDocument> implements ISyFailDocumentService {
+
+}

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

@@ -0,0 +1,167 @@
+package org.jeecg.modules.documents.orderData.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.orderData.entity.SyOrderData;
+import org.jeecg.modules.documents.orderData.service.ISyOrderDataService;
+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-21
+ * @Version: V1.0
+ */
+@Slf4j
+@Api(tags="订单数据主表")
+@RestController
+@RequestMapping("/orderData/syOrderData")
+public class SyOrderDataController extends JeecgController<SyOrderData, ISyOrderDataService> {
+	@Autowired
+	private ISyOrderDataService syOrderDataService;
+	
+	/**
+	 * 分页列表查询
+	 *
+	 * @param syOrderData
+	 * @param pageNo
+	 * @param pageSize
+	 * @param req
+	 * @return
+	 */
+	@AutoLog(value = "订单主表-分页列表查询")
+	@ApiOperation(value="订单主表-分页列表查询", notes="订单主表-分页列表查询")
+	@GetMapping(value = "/list")
+	public Result<?> queryPageList(SyOrderData syOrderData,
+								   @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
+								   @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
+								   HttpServletRequest req) {
+		QueryWrapper<SyOrderData> queryWrapper = QueryGenerator.initQueryWrapper(syOrderData, req.getParameterMap());
+		Page<SyOrderData> page = new Page<SyOrderData>(pageNo, pageSize);
+		IPage<SyOrderData> pageList = syOrderDataService.page(page, queryWrapper);
+		return Result.OK(pageList);
+	}
+	
+	/**
+	 * 添加
+	 *
+	 * @param syOrderData
+	 * @return
+	 */
+	@AutoLog(value = "订单主表-添加")
+	@ApiOperation(value="订单主表-添加", notes="订单主表-添加")
+	@PostMapping(value = "/add")
+	public Result<?> add(@RequestBody SyOrderData syOrderData) {
+		syOrderDataService.save(syOrderData);
+		return Result.OK("添加成功!");
+	}
+	
+	/**
+	 * 编辑
+	 *
+	 * @param syOrderData
+	 * @return
+	 */
+	@AutoLog(value = "订单主表-编辑")
+	@ApiOperation(value="订单主表-编辑", notes="订单主表-编辑")
+	@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
+	public Result<?> edit(@RequestBody SyOrderData syOrderData) {
+		syOrderDataService.updateById(syOrderData);
+		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) {
+		syOrderDataService.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.syOrderDataService.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) {
+		SyOrderData syOrderData = syOrderDataService.getById(id);
+		return Result.OK(syOrderData);
+	}
+
+  /**
+   * 导出excel
+   *
+   * @param request
+   * @param syOrderData
+   */
+  @RequestMapping(value = "/exportXls")
+  public ModelAndView exportXls(HttpServletRequest request, SyOrderData syOrderData) {
+      return super.exportXls(request, syOrderData, SyOrderData.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, SyOrderData.class);
+  }
+
+}

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

@@ -0,0 +1,167 @@
+package org.jeecg.modules.documents.orderData.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.orderData.entity.SyOrderDataItem;
+import org.jeecg.modules.documents.orderData.service.ISyOrderDataItemService;
+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-21
+ * @Version: V1.0
+ */
+@Slf4j
+@Api(tags="订单数据子表信息")
+@RestController
+@RequestMapping("/orderData/syOrderDataItem")
+public class SyOrderDataItemController extends JeecgController<SyOrderDataItem, ISyOrderDataItemService> {
+	@Autowired
+	private ISyOrderDataItemService syOrderDataItemService;
+	
+	/**
+	 * 分页列表查询
+	 *
+	 * @param syOrderDataItem
+	 * @param pageNo
+	 * @param pageSize
+	 * @param req
+	 * @return
+	 */
+	@AutoLog(value = "订单子表信息-分页列表查询")
+	@ApiOperation(value="订单子表信息-分页列表查询", notes="订单子表信息-分页列表查询")
+	@GetMapping(value = "/list")
+	public Result<?> queryPageList(SyOrderDataItem syOrderDataItem,
+								   @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
+								   @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
+								   HttpServletRequest req) {
+		QueryWrapper<SyOrderDataItem> queryWrapper = QueryGenerator.initQueryWrapper(syOrderDataItem, req.getParameterMap());
+		Page<SyOrderDataItem> page = new Page<SyOrderDataItem>(pageNo, pageSize);
+		IPage<SyOrderDataItem> pageList = syOrderDataItemService.page(page, queryWrapper);
+		return Result.OK(pageList);
+	}
+	
+	/**
+	 * 添加
+	 *
+	 * @param syOrderDataItem
+	 * @return
+	 */
+	@AutoLog(value = "订单子表信息-添加")
+	@ApiOperation(value="订单子表信息-添加", notes="订单子表信息-添加")
+	@PostMapping(value = "/add")
+	public Result<?> add(@RequestBody SyOrderDataItem syOrderDataItem) {
+		syOrderDataItemService.save(syOrderDataItem);
+		return Result.OK("添加成功!");
+	}
+	
+	/**
+	 * 编辑
+	 *
+	 * @param syOrderDataItem
+	 * @return
+	 */
+	@AutoLog(value = "订单子表信息-编辑")
+	@ApiOperation(value="订单子表信息-编辑", notes="订单子表信息-编辑")
+	@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
+	public Result<?> edit(@RequestBody SyOrderDataItem syOrderDataItem) {
+		syOrderDataItemService.updateById(syOrderDataItem);
+		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) {
+		syOrderDataItemService.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.syOrderDataItemService.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) {
+		SyOrderDataItem syOrderDataItem = syOrderDataItemService.getById(id);
+		return Result.OK(syOrderDataItem);
+	}
+
+  /**
+   * 导出excel
+   *
+   * @param request
+   * @param syOrderDataItem
+   */
+  @RequestMapping(value = "/exportXls")
+  public ModelAndView exportXls(HttpServletRequest request, SyOrderDataItem syOrderDataItem) {
+      return super.exportXls(request, syOrderDataItem, SyOrderDataItem.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, SyOrderDataItem.class);
+  }
+
+}

+ 169 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/orderData/entity/SyOrderData.java

@@ -0,0 +1,169 @@
+package org.jeecg.modules.documents.orderData.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-21
+ * @Version: V1.0
+ */
+@Data
+@TableName("sy_order_data")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value="sy_order_data对象", description="订单主表")
+public class SyOrderData {
+    
+	/**主键id*/
+	@TableId(type = IdType.ASSIGN_ID)
+    @ApiModelProperty(value = "主键id")
+	private java.lang.String id;
+	/**订单号*/
+	@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 businessTypeValue;
+	/**业务类型文本*/
+	@Excel(name = "业务类型文本", width = 15)
+    @ApiModelProperty(value = "业务类型文本")
+	private java.lang.String businessTypeText;
+	/**销售类型*/
+	@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.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.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 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;
+}

+ 163 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/orderData/entity/SyOrderDataItem.java

@@ -0,0 +1,163 @@
+package org.jeecg.modules.documents.orderData.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-21
+ * @Version: V1.0
+ */
+@Data
+@TableName("sy_order_data_item")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value="sy_order_data_item对象", description="订单子表信息")
+public class SyOrderDataItem {
+    
+	/**主键*/
+	@TableId(type = IdType.ASSIGN_ID)
+    @ApiModelProperty(value = "主键")
+	private java.lang.String id;
+	/**订单数据主表id*/
+	@Excel(name = "订单数据主表id", width = 15)
+    @ApiModelProperty(value = "订单数据主表id")
+	private java.lang.String syOrderDataId;
+	/**款号*/
+	@Excel(name = "款号", width = 15)
+    @ApiModelProperty(value = "款号")
+	private java.lang.String itemNumber;
+	/**预发货日期*/
+	@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 preDeliveryDate;
+	/**预完工日期*/
+	@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 preCompletionDate;
+	/**PackId*/
+	@Excel(name = "PackId", width = 15)
+    @ApiModelProperty(value = "PackId")
+	private java.lang.String packId;
+	/**小po*/
+	@Excel(name = "小po", width = 15)
+    @ApiModelProperty(value = "小po")
+	private java.lang.String smallPo;
+	/**分销点*/
+	@Excel(name = "分销点", width = 15)
+    @ApiModelProperty(value = "分销点")
+	private java.lang.String distributionPoint;
+	/**存货编码*/
+	@Excel(name = "存货编码", width = 15)
+    @ApiModelProperty(value = "存货编码")
+	private java.lang.String inventoryCode;
+	/**存货名称*/
+	@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;
+	/**光坯毛门幅CM*/
+	@Excel(name = "光坯毛门幅CM", width = 15)
+    @ApiModelProperty(value = "光坯毛门幅CM")
+	private java.math.BigDecimal guangpeiGateWidth;
+	/**箱数*/
+	@Excel(name = "箱数", width = 15)
+    @ApiModelProperty(value = "箱数")
+	private java.math.BigDecimal boxNumber;
+	/**数量*/
+	@Excel(name = "数量", width = 15)
+    @ApiModelProperty(value = "数量")
+	private java.math.BigDecimal quantity;
+	/**主计量*/
+	@Excel(name = "主计量", width = 15)
+    @ApiModelProperty(value = "主计量")
+	private java.lang.String masterMetering;
+	/**含税单价*/
+	@Excel(name = "含税单价", width = 15)
+    @ApiModelProperty(value = "含税单价")
+	private java.math.BigDecimal unitPriceIncludingTax;
+	/**价税合计*/
+	@Excel(name = "价税合计", width = 15)
+    @ApiModelProperty(value = "价税合计")
+	private java.math.BigDecimal totalPriceAndTax;
+	/**税率*/
+	@Excel(name = "税率", width = 15)
+    @ApiModelProperty(value = "税率")
+	private java.math.BigDecimal taxRate;
+	/**备注*/
+	@Excel(name = "备注", width = 15)
+    @ApiModelProperty(value = "备注")
+	private java.lang.Object remarks;
+	/**行关闭人*/
+	@Excel(name = "行关闭人", width = 15)
+    @ApiModelProperty(value = "行关闭人")
+	private java.lang.String bankClosedBy;
+	/**创建人*/
+	@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;
+}

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

@@ -0,0 +1,17 @@
+package org.jeecg.modules.documents.orderData.mapper;
+
+import java.util.List;
+
+import org.apache.ibatis.annotations.Param;
+import org.jeecg.modules.documents.orderData.entity.SyOrderDataItem;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * @Description: 订单子表信息
+ * @Author: jeecg-boot
+ * @Date:   2022-04-21
+ * @Version: V1.0
+ */
+public interface SyOrderDataItemMapper extends BaseMapper<SyOrderDataItem> {
+
+}

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

@@ -0,0 +1,17 @@
+package org.jeecg.modules.documents.orderData.mapper;
+
+import java.util.List;
+
+import org.apache.ibatis.annotations.Param;
+import org.jeecg.modules.documents.orderData.entity.SyOrderData;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * @Description: 订单主表
+ * @Author: jeecg-boot
+ * @Date:   2022-04-21
+ * @Version: V1.0
+ */
+public interface SyOrderDataMapper extends BaseMapper<SyOrderData> {
+
+}

+ 5 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/orderData/mapper/xml/SyOrderDataItemMapper.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.orderData.mapper.SyOrderDataItemMapper">
+
+</mapper>

+ 5 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/orderData/mapper/xml/SyOrderDataMapper.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.orderData.mapper.SyOrderDataMapper">
+
+</mapper>

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

@@ -0,0 +1,14 @@
+package org.jeecg.modules.documents.orderData.service;
+
+import org.jeecg.modules.documents.orderData.entity.SyOrderDataItem;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * @Description: 订单子表信息
+ * @Author: jeecg-boot
+ * @Date:   2022-04-21
+ * @Version: V1.0
+ */
+public interface ISyOrderDataItemService extends IService<SyOrderDataItem> {
+
+}

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

@@ -0,0 +1,14 @@
+package org.jeecg.modules.documents.orderData.service;
+
+import org.jeecg.modules.documents.orderData.entity.SyOrderData;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * @Description: 订单主表
+ * @Author: jeecg-boot
+ * @Date:   2022-04-21
+ * @Version: V1.0
+ */
+public interface ISyOrderDataService extends IService<SyOrderData> {
+
+}

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

@@ -0,0 +1,19 @@
+package org.jeecg.modules.documents.orderData.service.impl;
+
+import org.jeecg.modules.documents.orderData.entity.SyOrderDataItem;
+import org.jeecg.modules.documents.orderData.mapper.SyOrderDataItemMapper;
+import org.jeecg.modules.documents.orderData.service.ISyOrderDataItemService;
+import org.springframework.stereotype.Service;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+
+/**
+ * @Description: 订单子表信息
+ * @Author: jeecg-boot
+ * @Date:   2022-04-21
+ * @Version: V1.0
+ */
+@Service
+public class SyOrderDataItemServiceImpl extends ServiceImpl<SyOrderDataItemMapper, SyOrderDataItem> implements ISyOrderDataItemService {
+
+}

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

@@ -0,0 +1,19 @@
+package org.jeecg.modules.documents.orderData.service.impl;
+
+import org.jeecg.modules.documents.orderData.entity.SyOrderData;
+import org.jeecg.modules.documents.orderData.mapper.SyOrderDataMapper;
+import org.jeecg.modules.documents.orderData.service.ISyOrderDataService;
+import org.springframework.stereotype.Service;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+
+/**
+ * @Description: 订单主表
+ * @Author: jeecg-boot
+ * @Date:   2022-04-21
+ * @Version: V1.0
+ */
+@Service
+public class SyOrderDataServiceImpl extends ServiceImpl<SyOrderDataMapper, SyOrderData> implements ISyOrderDataService {
+
+}

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

@@ -0,0 +1,254 @@
+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.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.entity.VO.SyShippingDetailsVo;
+import org.jeecg.modules.documents.shippingDetails.service.ISyShippingDetailsItemService;
+import org.jeecg.modules.documents.shippingDetails.service.ISyShippingDetailsService;
+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/syShippingDetails")
+public class SyShippingDetailsController extends JeecgController<SyShippingDetails, ISyShippingDetailsService> {
+	@Autowired
+	private ISyShippingDetailsService syShippingDetailsService;
+	@Autowired
+	private ISyShippingDetailsItemService syShippingDetailsItemService;
+	
+	/**
+	 * 分页列表查询
+	 *
+	 * @param syShippingDetails
+	 * @param pageNo
+	 * @param pageSize
+	 * @param req
+	 * @return
+	 */
+	@AutoLog(value = "发运明细主表-分页列表查询")
+	@ApiOperation(value="发运明细主表-分页列表查询", notes="发运明细主表-分页列表查询")
+	@GetMapping(value = "/list")
+	public Result<IPage<SyShippingDetailsVo>> queryPageList(SyShippingDetailsVo syShippingDetails,
+								   @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
+								   @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
+								   HttpServletRequest req) {
+		Result<IPage<SyShippingDetailsVo>> result = new Result<IPage<SyShippingDetailsVo>>();
+		QueryWrapper<SyShippingDetailsVo> queryWrapper = QueryGenerator.initQueryWrapper(syShippingDetails, req.getParameterMap());
+		Page<SyShippingDetailsVo> page = new Page<SyShippingDetailsVo>(pageNo, pageSize);
+		IPage<SyShippingDetailsVo> pageList = syShippingDetailsService.queryShippingDetails(page, queryWrapper);
+		result.setSuccess(true);
+		result.setResult(pageList);
+		result.setMessage("查询成功");
+		return result;
+	}
+	
+	/**
+	 * 添加
+	 *
+	 * @param syShippingDetails
+	 * @return
+	 */
+	@AutoLog(value = "发运明细主表-添加")
+	@ApiOperation(value="发运明细主表-添加", notes="发运明细主表-添加")
+	@PostMapping(value = "/add")
+	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;
+	}
+	
+	/**
+	 * 编辑
+	 *
+	 * @param syShippingDetails
+	 * @return
+	 */
+	@AutoLog(value = "发运明细主表-编辑")
+	@ApiOperation(value="发运明细主表-编辑", notes="发运明细主表-编辑")
+	@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
+	public Result<?> edit(@RequestBody SyShippingDetails syShippingDetails) {
+		syShippingDetailsService.updateById(syShippingDetails);
+		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) {
+		syShippingDetailsService.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.syShippingDetailsService.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<SyShippingDetails> queryById(@RequestParam(name="id",required=true) String id) {
+
+		Result<SyShippingDetails> result = new Result<>();
+		if(oConvertUtils.isEmpty(id)){
+			throw new JeecgBootException("未拿到ID");
+		}
+		SyShippingDetails syShippingDetails = syShippingDetailsService.getById(id);
+		//查询子表
+		QueryWrapper<SyShippingDetailsItem> syShippingDetailsItemQueryWrapper = new QueryWrapper<SyShippingDetailsItem>();
+		syShippingDetailsItemQueryWrapper.eq("shipping_details_id",syShippingDetails.getId()).eq("del_flag",0);
+        List<SyShippingDetailsItem> syShippingDetailsItemList = syShippingDetailsItemService.list(syShippingDetailsItemQueryWrapper);
+        if(syShippingDetailsItemList.size()!=0){
+			syShippingDetails.setSyShippingDetailsItemList(syShippingDetailsItemList);
+		}
+
+        result.setSuccess(true);
+        result.setResult(syShippingDetails);
+        result.setMessage("查询成功!");
+		return result;
+	}
+
+  /**
+   * 导出excel
+   *
+   * @param request
+   * @param syShippingDetails
+   */
+  @RequestMapping(value = "/exportXls")
+  public ModelAndView exportXls(HttpServletRequest request, SyShippingDetails syShippingDetails) {
+      return super.exportXls(request, syShippingDetails, SyShippingDetails.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, SyShippingDetails.class);
+  }
+
+
+	 /**
+	  * 发运明细查询订单
+	  * @param orderNumber
+	  * @param pkOrg
+	  * @param pageNo
+	  * @param pageSize
+	  * @param request
+	  * @param response
+	  * @return
+	  */
+	 @AutoLog(value = "发运明细查询订单")
+	 @ApiOperation(value="发运明细查询订单", notes="发运明细查询订单")
+  @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);
+  }
+
+}

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

@@ -0,0 +1,124 @@
+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;
+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")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value="sy_shipping_details对象", description="发运明细主表")
+public class SyShippingDetails {
+    
+	/**主键*/
+	@TableId(type = IdType.ASSIGN_ID)
+    @ApiModelProperty(value = "主键")
+	private java.lang.String id;
+	/**单据号*/
+	@Excel(name = "单据号", width = 15)
+    @ApiModelProperty(value = "单据号")
+	private java.lang.String documentNo;
+	/**单据日期*/
+	@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;
+	/**订单数据主表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 customer;
+	/**预发货日期*/
+	@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")
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "预完工日期")
+	private java.util.Date preCompletionDate;
+	/**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.String declarationName;
+	/**HScode*/
+	@Excel(name = "HScode", width = 15)
+    @ApiModelProperty(value = "HScode")
+	private java.lang.String hsCode;
+	/**英文品名*/
+	@Excel(name = "英文品名", width = 15)
+    @ApiModelProperty(value = "英文品名")
+	private java.lang.String englishProductName;
+
+	//子表集合
+	@TableField(exist = false)
+	@ApiModelProperty(value = "子表集合")
+	private List<SyShippingDetailsItem> syShippingDetailsItemList;
+}

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

@@ -0,0 +1,267 @@
+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 String shippingDetailsId;
+	/**订单数据主表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;
+
+	@Excel(name = "分销点", width = 15)
+	@ApiModelProperty(value = "分销点")
+	private String distributionPoint;
+	@Excel(name = "款号", width = 15)
+	@ApiModelProperty(value = "款号")
+	private String itemNumber;
+	@Excel(name = "到货日期", width = 20, format = "yyyy-MM-dd")
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
+	@DateTimeFormat(pattern="yyyy-MM-dd")
+	@ApiModelProperty(value = "到货日期")
+	private String arrivalDate;
+	@Excel(name = "存货名称", width = 15)
+	@ApiModelProperty(value = "存货名称")
+	private String inventoryName;
+	@Excel(name = "单价(销售)", width = 15)
+	@ApiModelProperty(value = "单价(销售)")
+	private String salesUnitPrice;
+	@Excel(name = "采购/委外订单号", width = 15)
+	@ApiModelProperty(value = "采购/委外订单号")
+	private String purOrSubOrder;
+	@Excel(name = "订单类型", width = 15)
+	@ApiModelProperty(value = "订单类型")
+	private String orderType;
+	@Excel(name = "工厂单价", width = 15)
+	@ApiModelProperty(value = "工厂单价")
+	private String factoryUnitPrice;
+	@Excel(name = "申报要素", width = 15)
+	@ApiModelProperty(value = "申报要素")
+	private String declarationElements;
+	@Excel(name = "套装件数", width = 15)
+	@ApiModelProperty(value = "套装件数")
+	private String numberOfSets;
+	@Excel(name = "中文品名", width = 15)
+	@ApiModelProperty(value = "中文品名")
+	private String chineseName;
+	@Excel(name = "英文品名", width = 15)
+	@ApiModelProperty(value = "英文品名")
+	private String englishName;
+	@Excel(name = "成衣工厂", width = 15)
+	@ApiModelProperty(value = "成衣工厂")
+	private String garmentFactory;
+}

+ 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;
+
+}

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

@@ -0,0 +1,125 @@
+package org.jeecg.modules.documents.shippingDetails.entity.VO;
+
+
+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 SyShippingDetailsVo {
+
+    /**单据号*/
+    @Excel(name = "单据号", width = 15)
+    @ApiModelProperty(value = "单据号")
+    private java.lang.String documentNo;
+
+    /**单据日期*/
+    @Excel(name = "单据日期", width = 20, format = "yyyy-MM-dd")
+    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
+    @DateTimeFormat(pattern="yyyy-MM-dd")
+    @ApiModelProperty(value = "单据日期")
+    private java.util.Date documentDate;
+
+    /**订单号*/
+    @Excel(name = "订单号", width = 15)
+    @ApiModelProperty(value = "订单号")
+    private java.lang.String orderNumber;
+
+    /**客户简称*/
+    @Excel(name = "客户简称", width = 15)
+    @ApiModelProperty(value = "客户简称")
+    private java.lang.String customerAbbreviation;
+
+    /**销售部门*/
+    @Excel(name = "销售部门", width = 15)
+    @ApiModelProperty(value = "销售部门")
+    private java.lang.String salesDepartment;
+
+    /**业务员*/
+    @Excel(name = "业务员", width = 15)
+    @ApiModelProperty(value = "业务员")
+    private java.lang.String salesman;
+
+    /**小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 = 20, format = "yyyy-MM-dd")
+    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
+    @DateTimeFormat(pattern="yyyy-MM-dd")
+    @ApiModelProperty(value = "预发货日期")
+    private java.util.Date preDeliveryDate;
+
+    /**发货数量*/
+    @Excel(name = "发货数量", width = 15)
+    @ApiModelProperty(value = "发货数量")
+    private java.math.BigDecimal shipmentQuantity;
+
+    /**报关单价*/
+    @Excel(name = "报关单价", width = 15)
+    @ApiModelProperty(value = "报关单价")
+    private java.math.BigDecimal customsDeclarationUnitPrice;
+
+    /**是否tc功能0否1是*/
+    @Excel(name = "是否tc功能0否1是", width = 15)
+    @ApiModelProperty(value = "是否tc功能0否1是")
+    private java.lang.String isTc;
+
+    /**HScode*/
+    @Excel(name = "HScode", width = 15)
+    @ApiModelProperty(value = "HScode")
+    private java.lang.String hsCode;
+
+
+    @Excel(name = "分销点", width = 15)
+    @ApiModelProperty(value = "分销点")
+    private String distributionPoint;
+    @Excel(name = "款号", width = 15)
+    @ApiModelProperty(value = "款号")
+    private String itemNumber;
+    @Excel(name = "到货日期", width = 20, format = "yyyy-MM-dd")
+    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
+    @DateTimeFormat(pattern="yyyy-MM-dd")
+    @ApiModelProperty(value = "到货日期")
+    private String arrivalDate;
+    @Excel(name = "存货名称", width = 15)
+    @ApiModelProperty(value = "存货名称")
+    private String inventoryName;
+    @Excel(name = "单价(销售)", width = 15)
+    @ApiModelProperty(value = "单价(销售)")
+    private String salesUnitPrice;
+    @Excel(name = "采购/委外订单号", width = 15)
+    @ApiModelProperty(value = "采购/委外订单号")
+    private String purOrSubOrder;
+    @Excel(name = "订单类型", width = 15)
+    @ApiModelProperty(value = "订单类型")
+    private String orderType;
+    @Excel(name = "工厂单价", width = 15)
+    @ApiModelProperty(value = "工厂单价")
+    private String factoryUnitPrice;
+    @Excel(name = "申报要素", width = 15)
+    @ApiModelProperty(value = "申报要素")
+    private String declarationElements;
+    @Excel(name = "套装件数", width = 15)
+    @ApiModelProperty(value = "套装件数")
+    private String numberOfSets;
+    @Excel(name = "中文品名", width = 15)
+    @ApiModelProperty(value = "中文品名")
+    private String chineseName;
+    @Excel(name = "英文品名", width = 15)
+    @ApiModelProperty(value = "英文品名")
+    private String englishName;
+    @Excel(name = "成衣工厂", width = 15)
+    @ApiModelProperty(value = "成衣工厂")
+    private String garmentFactory;
+
+}

+ 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> {
+
+}

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

@@ -0,0 +1,27 @@
+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;
+import org.jeecg.modules.documents.shippingDetails.entity.VO.SyShippingDetailsVo;
+
+/**
+ * @Description: 发运明细主表
+ * @Author: jeecg-boot
+ * @Date:   2022-04-20
+ * @Version: V1.0
+ */
+public interface SyShippingDetailsMapper extends BaseMapper<SyShippingDetails> {
+
+    //发运明细查询订单数据
+    public IPage<OrderDataVo> queryOrderData(IPage<OrderDataVo> page, @Param("ew") QueryWrapper<OrderDataVo> queryWrapper);
+
+    //发运明细分页列表查询
+    public IPage<SyShippingDetailsVo> queryShippingDetails(IPage<SyShippingDetailsVo> page, @Param("ew") QueryWrapper<SyShippingDetailsVo> 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>

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

@@ -0,0 +1,38 @@
+<?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.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>
+
+<select id="queryShippingDetails" resultType="org.jeecg.modules.documents.shippingDetails.entity.VO.SyShippingDetailsVo">
+    select t.* from(select a.document_no as documentNo,a.document_date as documentDate,b.order_number as orderNumber,
+    b.customer_abbreviation as customerAbbreviation,b.sales_department as salesDepartment,b.salesman as salesman,
+    b.small_po as smallPo,b.pack_id as packId,a.pre_delivery_date as preDeliveryDate,
+    b.shipment_quantity as shipmentQuantity,b.customs_declaration_unit_price as customsDeclarationUnitPrice,
+    b.is_tc as isTc,a.hs_code as hsCode,b.distribution_point as distributionPoint,b.item_number as itemNumber,
+    b.arrival_date as arrivalDate,b.inventory_name as inventoryName,b.sales_unit_price as salesUnitPrice,
+    b.pur_or_sub_order as purOrSubOrder,b.order_type as orderType,b.factory_unit_price as factoryUnitPrice,
+    b.declaration_elements as declarationElements,b.number_of_sets as numberOfSets,b.chinese_name as chineseName,
+    b.english_name as englishName,b.garment_factory as garmentFactory from sy_shipping_details a
+left join sy_shipping_details_item b
+on a.id = b.shipping_details_id and b.del_flag = 0
+where a.del_flag = 0 order by a.document_no desc) as t
+${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> {
+
+}

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

@@ -0,0 +1,32 @@
+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 org.jeecg.modules.documents.shippingDetails.entity.VO.SyShippingDetailsVo;
+
+import java.util.List;
+
+/**
+ * @Description: 发运明细主表
+ * @Author: jeecg-boot
+ * @Date:   2022-04-20
+ * @Version: V1.0
+ */
+public interface ISyShippingDetailsService extends IService<SyShippingDetails> {
+
+
+    //发运明细查询订单数据
+    public IPage<OrderDataVo> queryOrderData(IPage<OrderDataVo> page, QueryWrapper<OrderDataVo> queryWrapper);
+
+    //新增发运明细
+    public SyShippingDetails syShippingDetailsAdd(SyShippingDetails syShippingDetails);
+
+    //发运明细分页列表查询
+    public IPage<SyShippingDetailsVo> queryShippingDetails(IPage<SyShippingDetailsVo> page, QueryWrapper<SyShippingDetailsVo> queryWrapper);
+
+}

+ 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 {
+
+}

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

@@ -0,0 +1,100 @@
+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.entity.VO.SyShippingDetailsVo;
+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
+ * @Date:   2022-04-20
+ * @Version: V1.0
+ */
+@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.setShippingDetailsId(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;
+    }
+
+    @Override
+    public IPage<SyShippingDetailsVo> queryShippingDetails(IPage<SyShippingDetailsVo> page, QueryWrapper<SyShippingDetailsVo> queryWrapper) {
+        return syShippingDetailsMapper.queryShippingDetails(page, queryWrapper);
+    }
+}

+ 152 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/openApi/controller/DxpDataPlanController.java

@@ -0,0 +1,152 @@
+package org.jeecg.modules.openApi.controller;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.aspect.annotation.AutoLog;
+import org.jeecg.common.system.base.controller.JeecgController;
+import org.jeecg.common.system.query.QueryGenerator;
+import org.jeecg.modules.openApi.entity.DxpDataPlan;
+import org.jeecg.modules.openApi.service.IDxpDataPlanService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.servlet.ModelAndView;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.util.Arrays;
+
+ /**
+ * @Description: 项目推单接口信息
+ * @Author: jeecg-boot
+ * @Date:   2022-04-01
+ * @Version: V1.0
+ */
+@Slf4j
+@Api(tags="项目推单接口信息")
+@RestController
+@RequestMapping("/openApi/dxpDataPlan")
+public class DxpDataPlanController extends JeecgController<DxpDataPlan, IDxpDataPlanService> {
+	@Autowired
+	private IDxpDataPlanService dxpDataPlanService;
+	
+	/**
+	 * 分页列表查询
+	 *
+	 * @param dxpDataPlan
+	 * @param pageNo
+	 * @param pageSize
+	 * @param req
+	 * @return
+	 */
+	@AutoLog(value = "项目推单接口信息-分页列表查询")
+	@ApiOperation(value="项目推单接口信息-分页列表查询", notes="项目推单接口信息-分页列表查询")
+	@GetMapping(value = "/list")
+	public Result<?> queryPageList(DxpDataPlan dxpDataPlan,
+								   @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
+								   @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
+								   HttpServletRequest req) {
+		QueryWrapper<DxpDataPlan> queryWrapper = QueryGenerator.initQueryWrapper(dxpDataPlan, req.getParameterMap());
+		Page<DxpDataPlan> page = new Page<DxpDataPlan>(pageNo, pageSize);
+		IPage<DxpDataPlan> pageList = dxpDataPlanService.page(page, queryWrapper);
+		return Result.OK(pageList);
+	}
+	
+	/**
+	 * 添加
+	 *
+	 * @param dxpDataPlan
+	 * @return
+	 */
+	@AutoLog(value = "项目推单接口信息-添加")
+	@ApiOperation(value="项目推单接口信息-添加", notes="项目推单接口信息-添加")
+	@PostMapping(value = "/add")
+	public Result<?> add(@RequestBody DxpDataPlan dxpDataPlan) {
+		dxpDataPlanService.save(dxpDataPlan);
+		return Result.OK("添加成功!");
+	}
+	
+	/**
+	 * 编辑
+	 *
+	 * @param dxpDataPlan
+	 * @return
+	 */
+	@AutoLog(value = "项目推单接口信息-编辑")
+	@ApiOperation(value="项目推单接口信息-编辑", notes="项目推单接口信息-编辑")
+	@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
+	public Result<?> edit(@RequestBody DxpDataPlan dxpDataPlan) {
+		dxpDataPlanService.updateById(dxpDataPlan);
+		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) {
+		dxpDataPlanService.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.dxpDataPlanService.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) {
+		DxpDataPlan dxpDataPlan = dxpDataPlanService.getById(id);
+		return Result.OK(dxpDataPlan);
+	}
+
+  /**
+   * 导出excel
+   *
+   * @param request
+   * @param dxpDataPlan
+   */
+  @RequestMapping(value = "/exportXls")
+  public ModelAndView exportXls(HttpServletRequest request, DxpDataPlan dxpDataPlan) {
+      return super.exportXls(request, dxpDataPlan, DxpDataPlan.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, DxpDataPlan.class);
+  }
+
+}

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

@@ -0,0 +1,298 @@
+package org.jeecg.modules.openApi.controller;
+
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.google.gson.Gson;
+import com.google.gson.GsonBuilder;
+import lombok.extern.log4j.Log4j2;
+
+import org.apache.commons.lang.StringEscapeUtils;
+import org.jeecg.common.util.oConvertUtils;
+import org.jeecg.modules.documents.failDocument.entity.SyFailDocument;
+import org.jeecg.modules.documents.failDocument.service.ISyFailDocumentService;
+import org.jeecg.modules.openApi.entity.DxpDataPlan;
+import org.jeecg.modules.openApi.service.IDxpDataPlanService;
+import org.jeecg.modules.openApi.service.ISenYuDataSourceOne;
+import org.jeecg.modules.openApi.service.ISenYuDataSourceThree;
+import org.jeecg.modules.openApi.service.ISenYuDataSourceTwo;
+import org.jeecg.modules.system.util.InterfaceConnUtils;
+import org.jeecg.modules.system.util.JsonChangeUtils;
+import org.springframework.beans.BeansException;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.ApplicationContext;
+import org.springframework.context.ApplicationContextAware;
+import org.springframework.stereotype.Component;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.text.SimpleDateFormat;
+import java.util.*;
+
+
+/**
+ * 委外订单查询
+ */
+@Log4j2
+@RestController
+@RequestMapping("/openApi/moMain")
+@Component
+public class MOMainController implements ApplicationContextAware {
+
+    private static IDxpDataPlanService dxpDataPlanService;
+    //数据源one
+    private static ISenYuDataSourceOne senYuDataSourceOne;
+    //数据源one
+    private static ISenYuDataSourceTwo senYuDataSourceTwo;
+    //数据源one
+    private static ISenYuDataSourceThree iSenYuDataSourceThree;
+    @Autowired
+    private ISyFailDocumentService iSyFailDocumentService;
+
+
+    @PostMapping(value = "/QueryMoMain")
+    public JSONObject QueryMoMain(String time) {
+        //传出JSON
+        JSONObject result = new JSONObject();
+        //定义集合
+        List<Map<String, Object>> sumlist = new ArrayList<>();
+        //记录定时任务开始时间
+        String beginTime = time;
+
+        try {
+            //获取路径
+            QueryWrapper<DxpDataPlan> queryWrappertoken = new QueryWrapper<>();
+            queryWrappertoken.eq("code", "senYu_token");
+            Page<DxpDataPlan> pagetoken = new Page<DxpDataPlan>(1, 100);
+            IPage<DxpDataPlan> tokenpage = dxpDataPlanService.page(pagetoken, queryWrappertoken);
+            List<DxpDataPlan> tokenList = tokenpage.getRecords();
+            String tokenUrl = tokenList.get(0).getItemIp()+tokenList.get(0).getItemUrl();
+
+            //查询IP及账套信息、时间戳
+            QueryWrapper<DxpDataPlan> queryWrapper = new QueryWrapper<>();
+            queryWrapper.eq("code", "senYu_moMain");
+            Page<DxpDataPlan> page = new Page<DxpDataPlan>(1, 100);
+            IPage<DxpDataPlan> pageList = dxpDataPlanService.page(page, queryWrapper);
+            List<DxpDataPlan> resultList = pageList.getRecords();
+
+            String pkorg = resultList.get(0).getPkOrg();
+            String pkorgSplit[] = pkorg.split(",");
+            Date lastTiem = resultList.get(0).getLastTime();
+            SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+            //委外订单调用时间
+            String lasttimeSf = sf.format(lastTiem);
+             //mo.cVenCode,ven.cVenName
+            for (String str : pkorgSplit) {
+                String pkorgStr = str;
+                String pkorgValue[] = pkorgStr.split(":");
+                String ac = pkorgValue[1];
+                if (pkorgValue[0].equals("one")) {//mo.cPersonCode as 'salerId',hr.cPsn_Num as 'buyerId',
+                    String sql = "select mo.MOID as 'moId',mo.MOID as 'moId','"+ac+"' as accId,'"+pkorgValue[0]+"' as pkorg,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 'salerCode',hr.cPsn_Num as 'headerAttributeString9'," +
+                            "hr1.cPsn_Name as 'headerAttributeString10',mo.cMaker 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', mo.cMemo as 'remark',mo.dVerifyDate as dVerifyDate," +
+                            "'' as 'sourceDocNum',mo.cMaker as 'customerContacts',mo.dCreateTime  as 'publishDate',0 as 'tenantId'," +
+                            "mo.cDefine5 as headerAttributeBigint2,mo.cDefine11 as headerAttributeString1,mo.cDefine12 as headerAttributeString3," +
+                            "mo.cDefine13 as headerAttributeString4,mo.cDefine14 as headerAttributeString5,mo.cVenBank as headerAttributeString7," +
+                            "mo.cVenAccount as headerAttributeString8," +
+                            "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 and (mo.dVerifyTime>'"+lasttimeSf+"' or mo.dChangeVerifyTime >'"+lasttimeSf+"')  order by mo.dCreateTime desc";
+
+                    List<Map<String, Object>> list = senYuDataSourceOne.queryForList(sql);
+                    for(Map<String, Object> map:list){
+                        sumlist.add(map);
+                    }//mo.cPersonCode as 'salerId',hr.cPsn_Num as 'buyerId',
+                }else if(pkorgValue[0].equals("two")){
+                    String sql = "select mo.MOID as 'moId',mo.MOID as 'moId','"+ac+"' as accId,'"+pkorgValue[0]+"' as pkorg,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 'salerCode',hr.cPsn_Num as 'headerAttributeString9'," +
+                            "hr1.cPsn_Name as 'headerAttributeString10',mo.cMaker 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', mo.cMemo as 'remark',mo.dVerifyDate as dVerifyDate," +
+                            "'' as 'sourceDocNum',mo.cMaker as 'customerContacts',mo.dCreateTime  as 'publishDate',0 as 'tenantId'," +
+                            "mo.cDefine5 as headerAttributeBigint2,mo.cDefine11 as headerAttributeString1,mo.cDefine12 as headerAttributeString3," +
+                            "mo.cDefine13 as headerAttributeString4,mo.cDefine14 as headerAttributeString5,mo.cVenBank as headerAttributeString7," +
+                            "mo.cVenAccount as headerAttributeString8," +
+                            "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 and (mo.dVerifyTime>'"+lasttimeSf+"' or mo.dChangeVerifyTime >'"+lasttimeSf+"')  order by mo.dCreateTime desc";
+
+                    List<Map<String, Object>> list = senYuDataSourceTwo.queryForList(sql);
+                    for(Map<String, Object> map:list){
+                        sumlist.add(map);
+                    }//mo.cPersonCode as 'salerId',hr.cPsn_Num as 'buyerId',
+                }else if(pkorgValue[0].equals("three")){
+                    String sql = "select mo.MOID as 'moId',mo.MOID as 'moId','"+ac+"' as accId,'"+pkorgValue[0]+"' as pkorg,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 'salerCode',hr.cPsn_Num as 'headerAttributeString9'," +
+                            "hr1.cPsn_Name as 'headerAttributeString10',mo.cMaker 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', mo.cMemo as 'remark',mo.dVerifyDate as dVerifyDate," +
+                            "'' as 'sourceDocNum',mo.cMaker as 'customerContacts',mo.dCreateTime  as 'publishDate',0 as 'tenantId'," +
+                            "mo.cDefine5 as headerAttributeBigint2,mo.cDefine11 as headerAttributeString1,mo.cDefine12 as headerAttributeString3," +
+                            "mo.cDefine13 as headerAttributeString4,mo.cDefine14 as headerAttributeString5,mo.cVenBank as headerAttributeString7," +
+                            "mo.cVenAccount as headerAttributeString8," +
+                            "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 and (mo.dVerifyTime>'"+lasttimeSf+"' or mo.dChangeVerifyTime >'"+lasttimeSf+"')  order by mo.dCreateTime desc";
+
+                    List<Map<String, Object>> list = iSenYuDataSourceThree.queryForList(sql);
+                    for(Map<String, Object> map:list){
+                        sumlist.add(map);
+                    }
+                }
+            }
+            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,tokenUrl, "采购订单接口-");
+                    JSONObject jsonArray = informationJson.getJSONObject("payload");
+
+                        //获取4个账套值
+                        String yi = "";
+                        String er = "";
+                        String san = "";
+
+                        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];
+                            }
+                        }
+                        //回写U8物料信息表是否同步成功字段
+
+                            JSONObject jo = jsonArray;
+                            //获取是否成功
+                            String code = jo.getString("code");
+                            //获取返回消息
+                            String message = jo.getString("message");
+                            //获取moId
+                            String moId = jo.getString("moId");
+                            //账套号
+                            String accId = jo.getString("accId");
+                            //订单类型
+                            String type = jo.getString("type");
+                            //单据号
+                            String poNum = jo.getString("poNum");
+                            if(oConvertUtils.isEmpty(poNum)){
+                                poNum ="测试001";
+                            }
+                            //单据日期
+                            String date = jo.getString("date");
+                            //账套666
+                            if (accId.equals(yi)) {
+                                if(type.equals("SUBCONTRACTOR_PO")) {
+                                    if (code.equals("E")) {
+                                        //失败  新增失败汇总表
+                                        SyFailDocument syFailDocument = new SyFailDocument();
+                                        syFailDocument.setId(oConvertUtils.id());
+                                        syFailDocument.setDocumentType("委外订单");
+                                        syFailDocument.setDocumentNo(poNum);
+                                        syFailDocument.setDocumentDate(date);
+                                        syFailDocument.setDocumentStatus("0");
+                                        syFailDocument.setReason(message);
+                                        iSyFailDocumentService.save(syFailDocument);
+                                    }
+                                }
+                            }else if (accId.equals(er)) {
+                                if(type.equals("SUBCONTRACTOR_PO")) {
+                                    if (code.equals("E")) {
+                                        //失败  新增失败汇总表
+                                        SyFailDocument syFailDocument = new SyFailDocument();
+                                        syFailDocument.setId(oConvertUtils.id());
+                                        syFailDocument.setDocumentType("委外订单");
+                                        syFailDocument.setDocumentNo(poNum);
+                                        syFailDocument.setDocumentDate(date);
+                                        syFailDocument.setDocumentStatus("0");
+                                        syFailDocument.setReason(message);
+                                        iSyFailDocumentService.save(syFailDocument);
+                                    }
+                                }
+                            }else if (accId.equals(san)) {
+                                if(type.equals("SUBCONTRACTOR_PO")) {
+                                    if (code.equals("E")) {
+                                        //失败  新增失败汇总表
+                                        SyFailDocument syFailDocument = new SyFailDocument();
+                                        syFailDocument.setId(oConvertUtils.id());
+                                        syFailDocument.setDocumentType("委外订单");
+                                        syFailDocument.setDocumentNo(poNum);
+                                        syFailDocument.setDocumentDate(date);
+                                        syFailDocument.setDocumentStatus("0");
+                                        syFailDocument.setReason(message);
+                                        iSyFailDocumentService.save(syFailDocument);
+                                    }
+                                }
+                            }
+
+
+                        }
+
+
+                //回写委外订单接口最后时间
+                Date datetome = sf.parse(beginTime);
+                dxpDataPlanService.updateLastTime(datetome, "senYu_moMain");
+            }
+        } catch (Exception e) {
+            log.error(e.getMessage());
+        }
+
+        return result;
+    }
+
+
+    @Override
+    public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
+        this.dxpDataPlanService = applicationContext.getBean(IDxpDataPlanService.class);
+        this.senYuDataSourceOne = applicationContext.getBean(ISenYuDataSourceOne.class);
+        this.senYuDataSourceTwo = applicationContext.getBean(ISenYuDataSourceTwo.class);
+        this.iSenYuDataSourceThree = applicationContext.getBean(ISenYuDataSourceThree.class);
+    }
+}

+ 100 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/openApi/controller/PDARdrecord11Controller.java

@@ -0,0 +1,100 @@
+package org.jeecg.modules.openApi.controller;
+
+import io.swagger.annotations.Api;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang.StringUtils;
+import org.jeecg.common.system.base.controller.JeecgController;
+import org.jeecg.common.util.oConvertUtils;
+import org.jeecg.modules.openApi.entity.ResHttpStatus;
+import org.jeecg.modules.openApi.entity.SubcontractingOrder;
+import org.jeecg.modules.openApi.service.*;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.servlet.http.HttpServletRequest;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @Description: PDA材料出库单
+ * @Author: jeecg-boot
+ * @Date:   2022-04-28
+ * @Version: V1.0
+ */
+@Slf4j
+@Api(tags="PDA材料出库单")
+@RestController
+@RequestMapping("/openApi/PDARdrecord11")
+public class PDARdrecord11Controller extends JeecgController<SubcontractingOrder, SubcontractingOrderService> {
+    @Autowired
+    private IRdrecord11Service rdrecord11Service;
+
+
+    /***
+     * 条件查询材料出库单
+     * @param org
+     * @param cCode
+     * @return
+     */
+    @RequestMapping(value = "/getRdrecord",method = RequestMethod.GET)
+    @ResponseBody
+    public ResponseEntity<ResHttpStatus> getRdrecord(String org,String cCode) {
+        ResHttpStatus res = new ResHttpStatus();
+        res.setCode("0");
+        res.setSuccess(false);
+        if(oConvertUtils.isEmpty(org)){
+            res.setMsg("账套号不能为空");
+            return new ResponseEntity<>(res, HttpStatus.OK);
+        }
+       if(oConvertUtils.isEmpty(cCode)){
+            res.setMsg("单据号不能为空");
+            return new ResponseEntity<>(res, HttpStatus.OK);
+        }
+        try {
+            res.setData(rdrecord11Service.getRdrecord(org,cCode));
+            res.setCode("200");
+            res.setMsg("成功");
+            res.setSuccess(true);
+        }catch (Exception e) {
+            res.setMsg("数据获取失败:" + e.getMessage());
+            e.printStackTrace();
+        }
+        return new ResponseEntity<>(res, HttpStatus.OK);
+    }
+    /***
+     * 条件查询材料出库单并打印生成二维码
+     * @param org
+     * @param cCode
+     * @return
+     */
+    @RequestMapping(value = "/getRdrecordToPrint",method = RequestMethod.GET)
+    @ResponseBody
+    public ResponseEntity<ResHttpStatus> getRdrecordToPrint(String org,String cCode) {
+        ResHttpStatus res = new ResHttpStatus();
+        res.setCode("0");
+        res.setSuccess(false);
+        if(oConvertUtils.isEmpty(org)){
+            res.setMsg("账套号不能为空");
+            return new ResponseEntity<>(res, HttpStatus.OK);
+        }
+        if(oConvertUtils.isEmpty(cCode)){
+            res.setMsg("单据号不能为空");
+            return new ResponseEntity<>(res, HttpStatus.OK);
+        }
+        try {
+            res.setData(rdrecord11Service.getRdrecordToPrint(org,cCode));
+            res.setCode("200");
+            res.setMsg("成功");
+            res.setSuccess(true);
+        }catch (Exception e) {
+            res.setMsg("数据获取失败:" + e.getMessage());
+            e.printStackTrace();
+        }
+        return new ResponseEntity<>(res, HttpStatus.OK);
+    }
+}

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

@@ -0,0 +1,295 @@
+package org.jeecg.modules.openApi.controller;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.google.gson.Gson;
+import com.google.gson.GsonBuilder;
+import lombok.extern.log4j.Log4j;
+import lombok.extern.log4j.Log4j2;
+import org.apache.commons.lang.StringEscapeUtils;
+import org.jeecg.common.util.oConvertUtils;
+import org.jeecg.modules.documents.failDocument.entity.SyFailDocument;
+import org.jeecg.modules.documents.failDocument.service.ISyFailDocumentService;
+import org.jeecg.modules.openApi.entity.DxpDataPlan;
+import org.jeecg.modules.openApi.service.IDxpDataPlanService;
+import org.jeecg.modules.openApi.service.ISenYuDataSourceOne;
+import org.jeecg.modules.openApi.service.ISenYuDataSourceThree;
+import org.jeecg.modules.openApi.service.ISenYuDataSourceTwo;
+import org.jeecg.modules.system.util.InterfaceConnUtils;
+import org.jeecg.modules.system.util.JsonChangeUtils;
+import org.springframework.beans.BeansException;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.ApplicationContext;
+import org.springframework.context.ApplicationContextAware;
+import org.springframework.stereotype.Component;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.text.SimpleDateFormat;
+import java.util.*;
+
+
+@RestController
+@Component
+@Log4j2
+@RequestMapping("/openApi/poMain")
+public class POPomainController implements ApplicationContextAware {
+
+    private static IDxpDataPlanService dxpDataPlanService;
+    //数据源one
+    private static ISenYuDataSourceOne senYuDataSourceOne;
+    //数据源one
+    private static ISenYuDataSourceTwo senYuDataSourceTwo;
+    //数据源one
+    private static ISenYuDataSourceThree iSenYuDataSourceThree;
+    @Autowired
+    private ISyFailDocumentService iSyFailDocumentService;
+
+
+    @PostMapping(value = "/QueryPoMain")
+    public JSONObject QueryPoMain(String time) {
+        //传出JSON
+        JSONObject result = new JSONObject();
+        //定义集合
+        List<Map<String, Object>> sumlist = new ArrayList<>();
+        //记录定时任务开始时间
+        String beginTime = time;
+
+        try {
+
+            //获取路径
+            QueryWrapper<DxpDataPlan> queryWrappertoken = new QueryWrapper<>();
+            queryWrappertoken.eq("code", "senYu_token");
+            Page<DxpDataPlan> pagetoken = new Page<DxpDataPlan>(1, 100);
+            IPage<DxpDataPlan> tokenpage = dxpDataPlanService.page(pagetoken, queryWrappertoken);
+            List<DxpDataPlan> tokenList = tokenpage.getRecords();
+            String tokenUrl = tokenList.get(0).getItemIp()+tokenList.get(0).getItemUrl();
+            //查询IP及账套信息、时间戳
+            QueryWrapper<DxpDataPlan> queryWrapper = new QueryWrapper<>();
+            queryWrapper.eq("code", "senYu_poMain");
+            Page<DxpDataPlan> page = new Page<DxpDataPlan>(1, 100);
+            IPage<DxpDataPlan> pageList = dxpDataPlanService.page(page, queryWrapper);
+            List<DxpDataPlan> resultList = pageList.getRecords();
+
+            String pkorg = resultList.get(0).getPkOrg();
+            String pkorgSplit[] = pkorg.split(",");
+            Date lastTiem = resultList.get(0).getLastTime();
+            SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+            //委外订单调用时间
+            String lasttimeSf = sf.format(lastTiem);
+            for (String str : pkorgSplit) {
+                String pkorgStr = str;
+                String pkorgValue[] = pkorgStr.split(":");
+                String ac = pkorgValue[1];
+                if (pkorgValue[0].equals("one")) {
+                    //ven.cVenName,mo.cVenCode mo.cPersonCode as salerId,hr.cPsn_Num as 'buyerId',
+                    //cAuditTime>'"+lasttimeSf+"' and mo.iverifystateex = 2
+                    String sql = "select mo.POID as 'moId','"+ac+"' as accId,'"+pkorgValue[0]+"' as pkorg,mo.cState as 'poStatus',mo.cPOID as 'poNum','STANDARD_PO' as 'poType'," +
+                            "'0085' as 'supplierNumber','采购业务实体名称' as 'poBusinessUnitCode','森鑫' as 'supplierName',mo.cPersonCode as salerCode,hr.cPsn_Num as 'headerAttributeString9'," +
+                            "ven.cVenPerson as 'supplierContacts',ven.cVenBranchPhone as 'supplierContactsPhone'," +
+                            "mo.cPOID as headerAttributeString2,'' as 'customerContactsPhone','0.00' as 'totalAmount'," +
+                            "'0.00' as 'exTaxAmount', curr.cexch_code as 'currencyCode',mo.iTaxRate as 'headerTaxRate'," +
+                            "mo.dPODate as 'customerDemandDate', mo.cMemo as 'remark','' as 'sourceDocNum'," +
+                            "mo.cDefine5 as headerAttributeBigint2,mo.cDefine11 as headerAttributeString1,mo.cDefine12 as headerAttributeString3," +
+                            "mo.cDefine13 as headerAttributeString4,mo.cDefine14 as headerAttributeString5,mo.cVenBank as headerAttributeString7," +
+                            "mo.cVenAccount as headerAttributeString8," +
+                            "mo.cMaker as 'customerContacts',hr1.cPsn_Name as headerAttributeString10,mo.cAuditDate as cAuditDate," +
+                            " 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+"' or cChangAuditTime >'"+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);
+                    }
+//mo.cPersonCode as salerId,hr.cPsn_Num as 'buyerId',
+                }
+                else if(pkorgValue[0].equals("two")){
+                    String sql = "select mo.POID as 'moId','"+ac+"' as accId,'"+pkorgValue[0]+"' as pkorg,mo.cState as 'poStatus',mo.cPOID as 'poNum','STANDARD_PO' as 'poType'," +
+                            "'0085' as 'supplierNumber','采购业务实体名称' as 'poBusinessUnitCode','森鑫' as 'supplierName',mo.cPersonCode as salerCode,hr.cPsn_Num as 'headerAttributeString9'," +
+                            "ven.cVenPerson as 'supplierContacts',ven.cVenBranchPhone as 'supplierContactsPhone'," +
+                            "mo.cPOID as headerAttributeString2,'' as 'customerContactsPhone','0.00' as 'totalAmount'," +
+                            "'0.00' as 'exTaxAmount', curr.cexch_code as 'currencyCode',mo.iTaxRate as 'headerTaxRate'," +
+                            "mo.dPODate as 'customerDemandDate', mo.cMemo as 'remark','' as 'sourceDocNum'," +
+                            "mo.cDefine5 as headerAttributeBigint2,mo.cDefine11 as headerAttributeString1,mo.cDefine12 as headerAttributeString3," +
+                            "mo.cDefine13 as headerAttributeString4,mo.cDefine14 as headerAttributeString5,mo.cVenBank as headerAttributeString7," +
+                            "mo.cVenAccount as headerAttributeString8," +
+                            "mo.cMaker as 'customerContacts',hr1.cPsn_Name as headerAttributeString10,mo.cAuditDate as cAuditDate," +
+                            " 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+"' or cChangAuditTime >'"+lasttimeSf+"') and mo.iverifystateex = 2 order by mo.cAuditTime desc";
+                    List<Map<String, Object>> list = senYuDataSourceTwo.queryForList(sql);
+                    for(Map<String, Object> map:list){
+                        sumlist.add(map);
+                    }
+//hr.cPsn_Num as 'buyerId',mo.cPersonCode as salerId,
+                }else if(pkorgValue[0].equals("three")){
+                    String sql = "select mo.POID as 'moId','"+ac+"' as accId,'"+pkorgValue[0]+"' as pkorg,mo.cState as 'poStatus',mo.cPOID as 'poNum','STANDARD_PO' as 'poType'," +
+                            "'0085' as 'supplierNumber','采购业务实体名称' as 'poBusinessUnitCode','森鑫' as 'supplierName',mo.cPersonCode as salerCode,hr.cPsn_Num as 'headerAttributeString9'," +
+                            "ven.cVenPerson as 'supplierContacts',ven.cVenBranchPhone as 'supplierContactsPhone'," +
+                            "mo.cPOID as headerAttributeString2,'' as 'customerContactsPhone','0.00' as 'totalAmount'," +
+                            "'0.00' as 'exTaxAmount', curr.cexch_code as 'currencyCode',mo.iTaxRate as 'headerTaxRate'," +
+                            "mo.dPODate as 'customerDemandDate', mo.cMemo as 'remark','' as 'sourceDocNum'," +
+                            "mo.cDefine5 as headerAttributeBigint2,mo.cDefine11 as headerAttributeString1,mo.cDefine12 as headerAttributeString3," +
+                            "mo.cDefine13 as headerAttributeString4,mo.cDefine14 as headerAttributeString5,mo.cVenBank as headerAttributeString7," +
+                            "mo.cVenAccount as headerAttributeString8," +
+                            "mo.cMaker as 'customerContacts',hr1.cPsn_Name as headerAttributeString10,mo.cAuditDate as cAuditDate," +
+                            " 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+"' or cChangAuditTime >'"+lasttimeSf+"') and mo.iverifystateex = 2 order by mo.cAuditTime desc";
+                    List<Map<String, Object>> list = iSenYuDataSourceThree.queryForList(sql);
+                    for(Map<String, Object> map:list){
+                        sumlist.add(map);
+                    }
+
+                }
+            }
+
+            if(sumlist.size()==0){
+                log.info("未查询到的数据!");
+            }else {
+                log.info("条数:"+sumlist.size());
+                //循环集合,一条一条传
+                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,tokenUrl, "采购订单接口-");
+                    JSONObject jsonArray = informationJson.getJSONObject("payload");
+//                    String jsonString = StringEscapeUtils.unescapeJava(jsonArray1.toJSONString());
+//                    JSONObject jsonArr = JSONObject.parseObject(jsonString);
+
+                        //获取4个账套值
+                        String yi = "";
+                        String er = "";
+                        String san = "";
+
+                        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];
+                            }
+                        }
+                        //回写U8物料信息表是否同步成功字段
+                            JSONObject jo = jsonArray;
+                            //获取是否成功
+                            String code = jo.getString("code");
+                            //获取返回消息
+                            String message = jo.getString("message");
+                            //获取moId
+                            String moId = jo.getString("moId");
+                            //账套号
+                            String accId = jo.getString("accId");
+                            //订单类型
+                            String type = jo.getString("type");
+                            //单据号
+                            String poNum = jo.getString("poNum");
+                            if(oConvertUtils.isEmpty(poNum)){
+                                poNum ="测试001";
+                            }
+                            //单据日期
+                            String date = jo.getString("date");
+                            //账套1
+                            if (accId.equals(yi)) {
+                                if(type.equals("STANDARD_PO")){
+                                    if (code.equals("E")) {
+                                       //失败  新增失败汇总表
+                                        SyFailDocument syFailDocument = new SyFailDocument();
+                                        syFailDocument.setId(oConvertUtils.id());
+                                        syFailDocument.setDocumentType("采购订单");
+                                        syFailDocument.setDocumentNo(poNum);
+                                        syFailDocument.setDocumentDate(date);
+                                        syFailDocument.setDocumentStatus("0");
+                                        syFailDocument.setReason(message);
+                                        iSyFailDocumentService.save(syFailDocument);
+                                    }
+                                }
+                            }else if(accId.equals(er)){
+                                if(type.equals("STANDARD_PO")) {
+                                    if (code.equals("E")) {
+                                        //失败  新增失败汇总表
+                                        SyFailDocument syFailDocument = new SyFailDocument();
+                                        syFailDocument.setId(oConvertUtils.id());
+                                        syFailDocument.setDocumentType("采购订单");
+                                        syFailDocument.setDocumentNo(poNum);
+                                        syFailDocument.setDocumentDate(date);
+                                        syFailDocument.setDocumentStatus("0");
+                                        syFailDocument.setReason(message);
+                                        iSyFailDocumentService.save(syFailDocument);
+                                    }
+                                }
+                            }else if(accId.equals(san)) {
+                                if(type.equals("STANDARD_PO")) {
+                                    if (code.equals("E")) {
+                                        //失败  新增失败汇总表
+                                        SyFailDocument syFailDocument = new SyFailDocument();
+                                        syFailDocument.setId(oConvertUtils.id());
+                                        syFailDocument.setDocumentType("采购订单");
+                                        syFailDocument.setDocumentNo(poNum);
+                                        syFailDocument.setDocumentDate(date);
+                                        syFailDocument.setDocumentStatus("0");
+                                        syFailDocument.setReason(message);
+                                        iSyFailDocumentService.save(syFailDocument);
+                                    }
+                                }
+                            }
+                        }
+
+
+                //回写委外订单接口最后时间
+                Date datetome = sf.parse(beginTime);
+                dxpDataPlanService.updateLastTime(datetome, "senYu_poMain");
+            }
+        } catch (Exception e) {
+            log.error(e.getMessage());
+        }
+
+        return result;
+    }
+
+
+    @Override
+    public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
+        this.dxpDataPlanService = applicationContext.getBean(IDxpDataPlanService.class);
+        this.senYuDataSourceOne = applicationContext.getBean(ISenYuDataSourceOne.class);
+        this.senYuDataSourceTwo = applicationContext.getBean(ISenYuDataSourceTwo.class);
+        this.iSenYuDataSourceThree = applicationContext.getBean(ISenYuDataSourceThree.class);
+    }
+
+}

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

@@ -1,20 +1,22 @@
 package org.jeecg.modules.openApi.controller;
 
-import java.util.Arrays;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 import java.io.IOException;
 import java.io.UnsupportedEncodingException;
 import java.net.URLDecoder;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
 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.config.transactional.DbTxConstants;
+import org.jeecg.config.transactional.MultiTransactional;
 import org.jeecg.modules.openApi.entity.PurchaseWarehousing;
 import org.jeecg.modules.openApi.service.IPurchaseWarehousingService;
-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;
@@ -164,4 +166,66 @@ public class PurchaseWarehousingController extends JeecgController<PurchaseWareh
       return super.importExcel(request, response, PurchaseWarehousing.class);
   }
 
+  @PostMapping(value = "/saveBath")
+//  @MultiTransactional(value = {DbTxConstants.DB1_TX, DbTxConstants.DB2_TX})
+  public Result saveBath(@RequestBody JSONArray json){
+  	Result result=new Result();
+
+	  try {
+		  if(json!=null&&json.size()>0){
+              //账套1
+              List<Map<String,Object>> mapListOne=new ArrayList<>();
+              //账套2
+              List<Map<String,Object>> mapListTwo=new ArrayList<>();
+              //账套3
+              List<Map<String,Object>> mapListThree=new ArrayList<>();
+              for(int i=0;i<json.size();i++){
+                  //获取对象
+                  JSONObject jsonObject=json.getJSONObject(i);
+                  //获取账套
+                  String cAccId=jsonObject.get("cAccId").toString();
+                  //转map
+                  Map<String,Object> map=updateMap(jsonObject);
+                  if(cAccId.equals("101")){
+                      mapListOne.add(map);
+                  }else if(cAccId.equals("102")){
+                      mapListTwo.add(map);
+                  }else if(cAccId.equals("103")){
+                      mapListThree.add(map);
+                  }
+              }
+              if(mapListOne.size()>0){
+                  purchaseWarehousingService.savaOne(mapListOne);
+              }
+              if(mapListTwo.size()>0){
+                  purchaseWarehousingService.savaTwo(mapListTwo);
+              }
+              if(mapListThree.size()>0){
+                  purchaseWarehousingService.savaThree(mapListThree);
+              }
+              result.success("操作成功");
+          }else{
+		  	result.error500("为获取到正确的json");
+		  }
+	  } catch (Exception e) {
+		  e.printStackTrace();
+		  result.error500("操作失败:"+e.getMessage());
+	  }
+
+	  return result;
+  }
+
+  public Map<String,Object> updateMap(JSONObject jsonObject){
+
+	//map对象
+	  Map<String, Object> data =new HashMap<>();
+	//循环转换
+	  Iterator it =jsonObject.entrySet().iterator();
+	  while (it.hasNext()) {
+		  Map.Entry<String, Object> entry = (Map.Entry<String, Object>) it.next();
+		  data.put(entry.getKey(), entry.getValue());
+	  }
+	  return data;
+  }
+
 }

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

@@ -0,0 +1,179 @@
+package org.jeecg.modules.openApi.controller;
+
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.google.gson.Gson;
+import com.google.gson.GsonBuilder;
+import lombok.extern.log4j.Log4j2;
+import org.apache.commons.lang.StringEscapeUtils;
+import org.jeecg.modules.openApi.entity.DxpDataPlan;
+import org.jeecg.modules.openApi.service.IDxpDataPlanService;
+import org.jeecg.modules.openApi.service.ISenYuDataSourceOne;
+import org.jeecg.modules.system.util.InterfaceConnUtils;
+import org.jeecg.modules.system.util.JsonChangeUtils;
+import org.springframework.beans.BeansException;
+import org.springframework.context.ApplicationContext;
+import org.springframework.context.ApplicationContextAware;
+import org.springframework.stereotype.Component;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.text.SimpleDateFormat;
+import java.util.*;
+
+@Log4j2
+@RestController
+@RequestMapping("/openApi/rdrecord")
+@Component
+public class RdrecordController implements ApplicationContextAware {
+
+    private static IDxpDataPlanService dxpDataPlanService;
+    //数据源one
+    private static ISenYuDataSourceOne senYuDataSourceOne;
+
+
+    @PostMapping(value = "/QueryRdrecord")
+    public JSONObject QueryRdrecord(String time) {
+        //传出JSON
+        JSONObject result = new JSONObject();
+        //定义集合
+        List<Map<String, Object>> sumlist = new ArrayList<>();
+        //记录定时任务开始时间
+        String beginTime = time;
+
+        try {
+
+            //获取路径
+            QueryWrapper<DxpDataPlan> queryWrappertoken = new QueryWrapper<>();
+            queryWrappertoken.eq("code", "senYu_token");
+            Page<DxpDataPlan> pagetoken = new Page<DxpDataPlan>(1, 100);
+            IPage<DxpDataPlan> tokenpage = dxpDataPlanService.page(pagetoken, queryWrappertoken);
+            List<DxpDataPlan> tokenList = tokenpage.getRecords();
+            String tokenUrl = tokenList.get(0).getItemIp()+tokenList.get(0).getItemUrl();
+
+            //查询IP及账套信息、时间戳
+            QueryWrapper<DxpDataPlan> queryWrapper = new QueryWrapper<>();
+            queryWrapper.eq("code", "senYu_rdrecord");
+            Page<DxpDataPlan> page = new Page<DxpDataPlan>(1, 100);
+            IPage<DxpDataPlan> pageList = dxpDataPlanService.page(page, queryWrapper);
+            List<DxpDataPlan> resultList = pageList.getRecords();
+
+            String pkorg = resultList.get(0).getPkOrg();
+            String pkorgSplit[] = pkorg.split(",");
+            Date lastTiem = resultList.get(0).getLastTime();
+            SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+            //委外订单调用时间
+            String lasttimeSf = sf.format(lastTiem);
+            for (String str : pkorgSplit) {
+                String pkorgStr = str;
+                String pkorgValue[] = pkorgStr.split(":");
+                String ac = pkorgValue[1];
+                if (pkorgValue[0].equals("one")) {
+                    String sql = "select top 1 ID as ID,'903' as cAccId,ID as ID,cCode as cCode,cBusType as cBusType,iverifystate as cState," +
+                            "cVenCode as cVenCode,'903' as cCusCode,dDate as dDate,cWhCode as cWhCode,cMemo as cMemo " +
+                            " from rdrecord11";
+                    //            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 " +
+                    //                    " from OM_MOMain where iVerifyStateNew = 2 or cState = 2 order by dCreateTime desc";
+
+                    List<Map<String, Object>> list = senYuDataSourceOne.queryForList(sql);
+                    sumlist.addAll(list);
+                } else if (pkorgValue[0].equals("two")) {
+
+
+                }
+                //转JSON且赋值
+                Gson userGson = new GsonBuilder().create();
+                result.put("payload", userGson.toJson(JsonChangeUtils.toRdrecordJson(sumlist)));
+                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,tokenUrl, "采购订单接口-");
+            JSONArray jsonArray1 = informationJson.getJSONArray("payload");
+            String jsonString = StringEscapeUtils.unescapeJava(jsonArray1.toJSONString());
+            JSONObject jsonArr = JSONObject.parseObject(jsonString);
+            JSONArray jsonArray = jsonArr.getJSONArray("payload");
+
+
+            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 rdrecord11 set cDefine10 = ? where cPOID = ?";
+//                            senYuDataSourceOne.updateRdrecord(sql, "true," + message, busSplit[0]);
+//
+//                        } else {
+//                            //普通采购回写
+//                            String sql = "update rdrecord11 set cDefine10 = ? where cPOID = ?";
+//                            senYuDataSourceOne.updateRdrecord(sql, "false," + message, busSplit[0]);
+//
+//                        }
+                    }
+                    //账套012
+
+                }
+            }
+
+            //回写委外订单接口最后时间
+            Date datetome = sf.parse(beginTime);
+            dxpDataPlanService.updateLastTime(datetome,"senYu_rdrecord");
+
+        } catch (Exception e) {
+            log.error(e.getMessage());
+        }
+
+        return result;
+    }
+
+
+    @Override
+    public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
+        this.dxpDataPlanService = applicationContext.getBean(IDxpDataPlanService.class);
+        this.senYuDataSourceOne = applicationContext.getBean(ISenYuDataSourceOne.class);
+    }
+
+}

+ 207 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/openApi/controller/SubcontractingOrderController.java

@@ -0,0 +1,207 @@
+package org.jeecg.modules.openApi.controller;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import io.swagger.annotations.Api;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang.StringUtils;
+import org.jeecg.common.system.base.controller.JeecgController;
+import org.jeecg.modules.openApi.entity.PurchaseWarehousing;
+import org.jeecg.modules.openApi.entity.ResHttpStatus;
+import org.jeecg.modules.openApi.entity.SubcontractingOrder;
+import org.jeecg.modules.openApi.service.IPurchaseWarehousingService;
+import org.jeecg.modules.openApi.service.SubcontractingOrderService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletRequest;
+import java.net.HttpURLConnection;
+import java.util.*;
+
+/**
+ * @Description: 委外订单
+ * @Author: jeecg-boot
+ * @Date:   2022-04-3
+ * @Version: V1.0
+ */
+@Slf4j
+@Api(tags="委外订单(染厂)- 验布机")
+@RestController
+@RequestMapping("/openApi/subcontractingOrder")
+public class SubcontractingOrderController extends JeecgController<SubcontractingOrder, SubcontractingOrderService> {
+    @Autowired
+    private HttpServletRequest request;
+    @Autowired
+    private SubcontractingOrderService subcontractingOrderService;
+
+    /**
+     * 根据订单号获取委外订单详情 0000000003
+     */
+    @RequestMapping(value = "/toExamine",method = RequestMethod.GET)
+    @ResponseBody
+    public ResponseEntity<ResHttpStatus> toExamine(String code,String cHandler) {
+
+        ResHttpStatus res = new ResHttpStatus();
+        res.setCode("0");
+        res.setSuccess(false);
+        if (!StringUtils.isNotBlank(code)) {
+            res.setMsg("订单号不能为空");
+            return new ResponseEntity<>(res, HttpStatus.OK);
+        }
+        if (!StringUtils.isNotBlank(cHandler)) {
+            res.setMsg("审核人姓名不能为空");
+            return new ResponseEntity<>(res, HttpStatus.OK);
+        }
+        int st = subcontractingOrderService.toExamine(code,cHandler);
+
+        res.setCode("200");
+        res.setMsg("成功");
+        res.setSuccess(true);
+        res.setData(st);
+
+        return new ResponseEntity<>(res, HttpStatus.OK);
+
+    }
+    /**
+     * 根据订单号获取委外订单详情 0000000003
+     */
+    @RequestMapping(value = "/selectRdRecord01ByCode",method = RequestMethod.GET)
+    @ResponseBody
+    public ResponseEntity<ResHttpStatus> selectRdRecord01ByCode(String code) {
+
+        ResHttpStatus res = new ResHttpStatus();
+        res.setCode("0");
+        res.setSuccess(false);
+        if (!StringUtils.isNotBlank(code)) {
+            res.setMsg("订单号不能为空");
+            return new ResponseEntity<>(res, HttpStatus.OK);
+        }
+        Map<String,Object> map = subcontractingOrderService.selectRdRecord01ByCode(code);
+
+        res.setCode("200");
+        res.setMsg("成功");
+        res.setSuccess(true);
+        res.setData(map);
+
+        return new ResponseEntity<>(res, HttpStatus.OK);
+
+    }
+    /**
+     * 根据订单号获取委外订单详情
+     */
+    @RequestMapping(value = "/getSubcontractingOrderByCode",method = RequestMethod.GET)
+    @ResponseBody
+    public ResponseEntity<ResHttpStatus> getSubcontractingOrderByCode(String code,String MoDetailsID, String key) {
+
+        ResHttpStatus res = new ResHttpStatus();
+        res.setCode("0");
+        res.setSuccess(false);
+        if(!StringUtils.isNotBlank(code)){
+            res.setMsg("订单号不能为空");
+            return new ResponseEntity<>(res, HttpStatus.OK);
+        }
+       if(!StringUtils.isNotBlank(MoDetailsID)){
+            res.setMsg("子表主键不能为空");
+            return new ResponseEntity<>(res, HttpStatus.OK);
+        }
+        List<SubcontractingOrder> order =subcontractingOrderService.selectOrderByCodeOne(code,MoDetailsID);//"SYW313-森宏"
+        if(order.size() <= 0){
+            order =subcontractingOrderService.selectOrderByCodeTwo(code,MoDetailsID);//"SYW313-森宏"
+            if(order.size() <= 0){
+                order =subcontractingOrderService.selectOrderByCodeThree(code,MoDetailsID);//"SYW313-森宏"
+            }
+            if(order.size() <= 0){
+                res.setMsg("未查到有效数据");
+                return new ResponseEntity<>(res, HttpStatus.OK);
+            }
+        }
+        res.setCode("200");
+        res.setMsg("成功");
+        res.setSuccess(true);
+        res.setData(order);
+
+        return new ResponseEntity<>(res, HttpStatus.OK);
+    }
+
+   /**
+     * 合格入库单-验布机
+     */
+    @RequestMapping(value = "/saveWarehousing",method = RequestMethod.POST)
+    @ResponseBody
+    public ResponseEntity<ResHttpStatus> saveWarehousing(@RequestBody JSONArray json) {
+        ResHttpStatus res = new ResHttpStatus();
+        res.setCode("0");
+        res.setSuccess(false);
+
+//        String key = request.getHeader("key");
+//        if(!StringUtils.isNotBlank(key)){
+//            res.setMsg("key不能为空");
+//            return new ResponseEntity<>(res, HttpStatus.OK);
+//        }
+
+        if(json == null || json.size() < 1){
+            res.setMsg("正文数据不能为空");
+            return new ResponseEntity<>(res, HttpStatus.OK);
+        }
+
+        try {
+//            //账套1
+//            List<Map<String,Object>> mapListOne=new ArrayList<>();
+//            //账套2
+//            List<Map<String,Object>> mapListTwo=new ArrayList<>();
+            //账套3
+            List<Map<String,Object>> mapListThree=new ArrayList<>();
+            for(int i=0; i<json.size(); i++){
+                //获取对象
+                JSONObject jsonObject = json.getJSONObject(i);
+
+//                if(jsonObject.get("bredvouch") == null){//红蓝标识  采购入库
+//                    res.setMsg("bredvouch不能为空,或不合法");
+//                    return new ResponseEntity<>(res, HttpStatus.OK);
+//                }
+                //获取账套
+//                if(jsonObject.get("cAccId") != null || !jsonObject.get("cAccId").toString().equals("103")){
+//                    String cAccId=jsonObject.get("cAccId").toString();//账套
+//                    //转map
+                    Map<String,Object> map = updateMap(jsonObject);
+//                    if(cAccId.equals("101")){
+//                        mapListOne.add(map);
+//                    }else if(cAccId.equals("102")){
+//                        mapListTwo.add(map);
+//                    }else if(cAccId.equals("103")){
+                    mapListThree.add(map);
+//                    }
+//                }else{
+//                    res.setMsg("cAccId不能为空,或不合法");
+//                    return new ResponseEntity<>(res, HttpStatus.OK);
+//                }
+
+            }
+            subcontractingOrderService.saveWarehousing(mapListThree);
+            res.setCode("200");
+            res.setSuccess(true);
+            res.setMsg("执行成功");
+        }catch (Exception e){
+            System.out.println(e.getMessage());
+            res.setMsg(e.getMessage());
+        }
+        return new ResponseEntity<>(res, HttpStatus.OK);
+    }
+
+
+    public Map<String,Object> updateMap(JSONObject jsonObject){
+
+        //map对象
+        Map<String, Object> data =new HashMap<>();
+        //循环转换
+        Iterator it =jsonObject.entrySet().iterator();
+        while (it.hasNext()) {
+            Map.Entry<String, Object> entry = (Map.Entry<String, Object>) it.next();
+            data.put(entry.getKey(), entry.getValue());
+        }
+        return data;
+    }
+
+}

+ 7 - 3
jeecg-boot-module-system/src/main/java/org/jeecg/modules/openApi/controller/TestController.java

@@ -2,6 +2,7 @@ package org.jeecg.modules.openApi.controller;
 
 import com.alibaba.fastjson.JSONObject;
 import org.jeecg.modules.openApi.service.ISenYuDataSourceOne;
+import org.jeecg.modules.system.util.InterfaceConnUtils;
 import org.jeecg.modules.system.util.JsonChangeUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -24,12 +25,15 @@ public class TestController {
     private ISenYuDataSourceOne senYuDataSourceOne;
 
     @GetMapping(value = "/Query")
-    public JSONObject save(HttpServletRequest request, HttpServletResponse response) {
+    public JSONObject save(HttpServletRequest request, HttpServletResponse response) throws Exception {
         JSONObject result = new JSONObject();
-        String sql="select  * from Inventory where cInvCode='0101000001'";
+        String sql="select  top 1 *  from Inventory";
         List<Map<String, Object>> list=senYuDataSourceOne.queryForList(sql);
         List<JSONObject> listJSONObject= JsonChangeUtils.toListJson(list);
-        return  listJSONObject.get(0);
+        result=listJSONObject.get(0);
+        //调用采购订单接口测试
+//        InterfaceConnUtils.doPostToBearer(result,"https://zoneda.onestep-cloud.com/hitf/v1/rest/invoke?namespace=MFY1001&serverCode=NBSY-ZCOM&interfaceCode=hzmc-communication.senyu-po-interface.createPoInterface");
+        return  result;
     }
 
     @GetMapping(value = "/select")

+ 96 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/openApi/entity/DxpDataPlan.java

@@ -0,0 +1,96 @@
+package org.jeecg.modules.openApi.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import org.jeecgframework.poi.excel.annotation.Excel;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.Date;
+
+/**
+ * @Description: 项目推单接口信息
+ * @Author: jeecg-boot
+ * @Date:   2022-04-01
+ * @Version: V1.0
+ */
+@Data
+@TableName("dxp_data_plan")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value="dxp_data_plan对象", description="项目推单接口信息")
+public class DxpDataPlan {
+    
+	/**主键*/
+	@TableId(type = IdType.ASSIGN_ID)
+    @ApiModelProperty(value = "主键")
+	private String id;
+	/**接口标识*/
+	@Excel(name = "接口标识", width = 15)
+    @ApiModelProperty(value = "接口标识")
+	private String code;
+	/**接口名称*/
+	@Excel(name = "接口名称", width = 15)
+    @ApiModelProperty(value = "接口名称")
+	private String name;
+	/**组织账套信息*/
+	@Excel(name = "组织账套信息", width = 15)
+    @ApiModelProperty(value = "组织账套信息")
+	private String pkOrg;
+	/**对应账套信息*/
+	@Excel(name = "对应账套信息", width = 15)
+    @ApiModelProperty(value = "对应账套信息")
+	private String pkOrgItem;
+	/**最后抓取时间*/
+	@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 Date lastTime;
+	/**删除标识0-正常,1-已删除*/
+	@Excel(name = "删除标识0-正常,1-已删除", width = 15)
+    @ApiModelProperty(value = "删除标识0-正常,1-已删除")
+	private Integer delFlag;
+	/**创建人*/
+	@Excel(name = "创建人", width = 15)
+    @ApiModelProperty(value = "创建人")
+	private 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 Date createTime;
+	/**修改人*/
+	@Excel(name = "修改人", width = 15)
+    @ApiModelProperty(value = "修改人")
+	private 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 Date updateTime;
+	/**调用接口ip地址*/
+	@Excel(name = "调用接口ip地址", width = 15)
+    @ApiModelProperty(value = "调用接口ip地址")
+	private String itemIp;
+	/**接口地址*/
+	@Excel(name = "接口地址", width = 15)
+    @ApiModelProperty(value = "接口地址")
+	private String itemUrl;
+	/**是否启用自动同步(0开启,1关闭)*/
+	@Excel(name = "是否启用自动同步(0开启,1关闭)", width = 15)
+    @ApiModelProperty(value = "是否启用自动同步(0开启,1关闭)")
+	private Integer isauto;
+	/**税率*/
+	@Excel(name = "税率", width = 15)
+    @ApiModelProperty(value = "税率")
+	private String taxrate;
+}

+ 65 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/openApi/entity/ResHttpStatus.java

@@ -0,0 +1,65 @@
+package org.jeecg.modules.openApi.entity;
+
+
+/**
+ * 返回json数据
+ * @author ysh
+ *
+ */
+public class ResHttpStatus {
+
+    // 返回http状态码
+    private String code;
+    // 返回状态消息
+    private String msg;
+    // 返回状态消息
+    private boolean success;
+
+    private long timestamp = System.currentTimeMillis();
+
+    private Object data;
+
+    public String getCode() {
+        return code;
+    }
+
+    public void setCode(String code) {
+        this.code = code;
+    }
+
+    public String getMsg() {
+        return msg;
+    }
+
+    public void setMsg(String msg) {
+        this.msg = msg;
+    }
+
+    public Object getData() {
+        return data;
+    }
+
+    public void setData(Object data) {
+        this.data = data;
+    }
+
+    public boolean getSuccess() {
+        return success;
+    }
+
+    public void setSuccess(boolean success) {
+        this.success = success;
+    }
+
+    public boolean isSuccess() {
+        return success;
+    }
+
+    public long getTimestamp() {
+        return timestamp;
+    }
+
+    public void setTimestamp(long timestamp) {
+        this.timestamp = timestamp;
+    }
+}

+ 25 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/openApi/entity/SubcontractingOrder.java

@@ -0,0 +1,25 @@
+package org.jeecg.modules.openApi.entity;
+
+import lombok.Data;
+
+/**
+ * 委外订单
+ */
+@Data
+public class SubcontractingOrder {
+
+    private String moId; //编号
+    private String cvcName; //染厂
+    private String cCode; //委外订单号
+    private String cInvCode; //存货编码
+    private String cInvName; //存货名称
+    private String cEnglishName; //存货名称(英文名称)
+    private String itemNumber; //款号
+    //缸号(条码取)
+    //织厂(条码取)
+    private String color;//颜色
+    private String colorNumber;//色号
+    private String gram;//要求克重
+    //总卷数(条码取)
+    private String doorWidth;//要求门幅
+}

+ 20 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/openApi/mapper/DxpDataPlanMapper.java

@@ -0,0 +1,20 @@
+package org.jeecg.modules.openApi.mapper;
+
+import java.util.Date;
+import java.util.List;
+
+import org.apache.ibatis.annotations.Param;
+import org.jeecg.modules.openApi.entity.DxpDataPlan;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * @Description: 项目推单接口信息
+ * @Author: jeecg-boot
+ * @Date:   2022-04-01
+ * @Version: V1.0
+ */
+public interface DxpDataPlanMapper extends BaseMapper<DxpDataPlan> {
+
+    //回写调用时间
+    public void updateLastTime(@Param("time") Date time, @Param("code") String code);
+}

+ 174 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/openApi/mapper/PurchaseWarehousingMapper.java

@@ -1,6 +1,8 @@
 package org.jeecg.modules.openApi.mapper;
 
+import java.math.BigDecimal;
 import java.util.List;
+import java.util.Map;
 
 import org.apache.ibatis.annotations.Param;
 import org.jeecg.modules.openApi.entity.PurchaseWarehousing;
@@ -14,4 +16,176 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  */
 public interface PurchaseWarehousingMapper extends BaseMapper<PurchaseWarehousing> {
 
+    /**
+    * @Author chenchuang
+    * @Description //TODO 获取最新id
+    * @Date 2022/4/1 14:34
+    * @Param [table]
+    * @return java.lang.String
+    */
+    String getMaxId(@Param("id")String id,@Param("tableName")String tableName);
+
+    String getMaxCode(@Param("code")String code,@Param("tableName")String tableName);
+
+    /**
+    * @Author chenchuang
+    * @Description //TODO 采购入库主表新增
+    * @Date 2022/4/1 16:30
+    * @Param [map]
+    * @return void
+    */
+    void saveRdRecord01One(@Param("RdRecord01")Map<String,Object> map);
+
+    /**
+    * @Author chenchuang
+    * @Description //TODO 采购入库子表新增
+    * @Date 2022/4/1 18:54
+    * @Param [list]
+    * @return void
+    */
+    void saveRdrecords01One(@Param("list")List<Map<String,Object>> list);
+
+    void saveRdrecords01(@Param("map")Map<String,Object> map);
+
+    /**
+    * @Author chenchuang
+    * @Description //TODO 根据人员编码查询部门编码
+    * @Date 2022/4/14 13:34
+    * @Param [cPersonCode]
+    * @return java.util.Map<java.lang.String,java.lang.Object>
+    */
+    Map<String,Object> getPerson(@Param("cPersonCode")String cPersonCode);
+
+    /**
+    * @Author chenchuang
+    * @Description //TODO 根据委外子表id获取委外子表相关信息
+    * @Date 2022/4/14 15:00
+    * @Param [moDetailsId]
+    * @return java.util.Map<java.lang.String,java.lang.Object>
+    */
+    Map<String,Object> getOMMoDetails(@Param("moDetailsId")String moDetailsId);
+
+    /**
+    * @Author chenchuang
+    * @Description //TODO 根据供应商编码查询成品仓和原材料仓库
+    * @Date 2022/4/14 16:35
+    * @Param [cVenCode]
+    * @return java.util.Map<java.lang.String,java.lang.Object>
+    */
+    Map<String,Object> getWhCodeByVenCode(@Param("cVenCode")String cVenCode);
+
+    /**
+    * @Author chenchuang
+    * @Description //TODO 新增调拨单主表
+    * @Date 2022/4/22 17:23
+    * @Param [map]
+    * @return void
+    */
+    void saveTransVouch(@Param("map")Map<String,Object> map);
+
+    /**
+     * 新增调拨单子表
+     * @param map
+     */
+    void saveTransVouchs(@Param("map")Map<String,Object> map);
+
+    /**
+     * 新增其他出库单
+     * @param map
+     */
+    void saveRdRecord09(@Param("map")Map<String,Object> map);
+
+    /**
+     * 新增其他出库单子表
+     * @param map
+     */
+    void saveRdRecords09(@Param("map")Map<String,Object> map);
+
+    /**
+     * 新增其他入库单主表
+     * @param map
+     */
+    void saveRdRecord08(@Param("map")Map<String,Object> map);
+
+    /**
+     * 新增其他入库单子表
+     * @param map
+     */
+    void saveRdRecords08(@Param("map")Map<String,Object> map);
+    /**
+    * @Author chenchuang
+    * @Description //TODO 根据红字获取对应采购订单行的蓝字根据入库数量与发票数量判断是否需要做结算单的数量
+    * @Date 2022/4/26 14:14
+    * @Param [rowmId]
+    * @return java.math.BigDecimal
+    */
+    BigDecimal getRdrecords01WriteQuantity(@Param("rowmId")String rowmId);
+
+    /**
+    * @Author chenchuang
+    * @Description //TODO 根据采购订单行id获取相关数据
+    * @Date 2022/4/26 15:12
+    * @Param [rowmId]
+    * @return java.math.BigDecimal
+    */
+    Map<String,Object> getPOPodetailsINatUnitPrice(@Param("rowmId")String rowmId);
+
+    /**
+    * @Author chenchuang
+    * @Description //TODO 新增结算单主表
+    * @Date 2022/4/26 17:40
+    * @Param [map]
+    * @return void
+    */
+    void savePurSettleVouch(@Param("map")Map<String,Object> map);
+
+    /**
+    * @Author chenchuang
+    * @Description //TODO 新增结算单子表
+    * @Date 2022/4/26 18:43
+    * @Param [map]
+    * @return void
+    */
+    void savePurSettleVouchs(@Param("map")Map<String,Object> map);
+
+    /**
+    * @Author chenchuang
+    * @Description //TODO 根据采购订单行id获取采购订单行数据
+    * @Date 2022/4/27 21:23
+    * @Param [rowmId]
+    * @return java.util.Map<java.lang.String,java.lang.Object>
+    */
+    Map<String,Object> getPOPodetails(@Param("rowmId")String rowmId);
+
+    /**
+    * @Author chenchuang
+    * @Description //TODO 根据委外订单行id获取委外订单行数据
+    * @Date 2022/4/27 21:38
+    * @Param [rowmId]
+    * @return java.util.Map<java.lang.String,java.lang.Object>
+    */
+    Map<String,Object> getOMMODetails(@Param("rowmId")String rowmId);
+
+    /**
+    * @Author chenchuang
+    * @Description //TODO 回写采购订单行入库数量
+    * @Date 2022/4/27 22:48
+    * @Param [map]
+    * @return void
+    */
+    void updatePodetailsfreceivedqty(@Param("map")Map<String,Object> map);
+
+    /**
+    * @Author chenchuang
+    * @Description //TODO 回写委外订单行入库数量
+    * @Date 2022/4/27 22:49
+    * @Param [map]
+    * @return void
+    */
+    void updateOMMODetailsfreceivedqty(@Param("map")Map<String,Object> map);
+
+    /**
+     * 修改流水号最大值
+     */
+    void updateVoucherHistoryCNumber(@Param("cNumber")String cNumber,@Param("cardNumber")String cardNumber);
 }

+ 88 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/openApi/mapper/SubcontractingOrderMapper.java

@@ -0,0 +1,88 @@
+package org.jeecg.modules.openApi.mapper;
+
+import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import io.lettuce.core.dynamic.annotation.Param;
+import org.jeecg.modules.openApi.entity.SubcontractingOrder;
+
+import java.util.List;
+import java.util.Map;
+
+
+/**
+ * @Description: 委外订单
+ * @Author: jeecg-boot
+ * @Version: V1.0
+ */
+public interface SubcontractingOrderMapper extends BaseMapper<SubcontractingOrder> {
+
+    /**
+     * 根据存货编码查询存货单位(辅计量单位)
+     * @param code
+     * @return
+     */
+    Map<String,String> selectUnitByCode(@Param("code") String code);
+
+    /**
+     * 根据委外订单号查询信息
+     * @param code
+     * @return
+     */
+    Map<String,String> selectInfoByCode(@Param("code") String code);
+
+    /**
+     * 根据供应商编码查询成品仓库
+     * @param code
+     * @return
+     */
+    Map<String,String> selectVendorByCode(@Param("code") String code);
+
+    /**
+     * 调用存储过程 获取下一个编码
+     * @param StuNo 单据类型 24:入库单
+     * @return
+     */
+    int callGetMaxCode(@Param("StuNo") String StuNo);
+
+    /**
+     * 调用存储过程 获取下一个主键(包含主子表)
+     * @param StuNo 单据类型  rd:入库单
+     * @return
+     */
+    Map<String,Integer> callGetUAMaxPK(@Param("StuNo") String StuNo,@Param("accId") String accId);
+
+    /**
+     * 根据委外订单编码获取订单详情
+     * @param code
+     * @return
+     */
+    List<SubcontractingOrder> selectOrderByCode(@Param("code")String code, @Param("MoDetailsID")String MoDetailsID);
+
+    /**
+     * @Description 采购入库主表新增(合格入库)
+     * @Param [map]
+     * @return void
+     */
+    void saveRdRecord01One(@Param("rdRecord01")Map<String,Object> rdRecord01);
+    /**
+     * @Description //TODO 采购入库子表新增(合格入库)
+     * @Param [map]
+     * @return void
+     */
+    void saveRdrecords01One(@Param("item")Map<String,Object> item);
+
+    /**
+     * 根据编码获取入库单数据
+     * @param code
+     * @return
+     */
+    Map<String,Object> selectRdRecord01ByCode(String code);
+    List<Map<String,Object>> selectRdChildById(String id);
+
+    /**
+     * 审核入库单
+     * @param code
+     * @return
+     */
+    int toExamine(@Param("code") String code,@Param("cHandler")String cHandler);
+}

+ 10 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/openApi/mapper/xml/DxpDataPlanMapper.xml

@@ -0,0 +1,10 @@
+<?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.openApi.mapper.DxpDataPlanMapper">
+
+
+    <update id="updateLastTime">
+        update dxp_data_plan set last_time = #{time} where code = #{code}
+    </update>
+
+</mapper>

+ 538 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/modules/openApi/mapper/xml/PurchaseWarehousingMapper.xml

@@ -1,5 +1,542 @@
 <?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.demo.openApi.mapper.PurchaseWarehousingMapper">
+<mapper namespace="org.jeecg.modules.openApi.mapper.PurchaseWarehousingMapper">
+
+    <select id="getMaxId" resultType="java.lang.String">
+        select max(${id}) from ${tableName}
+    </select>
+
+    <select id="getMaxCode" resultType="java.lang.String">
+        select top 1 ${code} from ${tableName} ORDER BY dDate desc
+    </select>
+
+    <insert id="saveRdRecord01One">
+        INSERT INTO RdRecord01
+        (
+          ID,
+          cVouchType,
+          cCode,
+          dDate,
+          cWhCode,
+          cOrderCode,
+          cARVCode,
+          cVenCode,
+          cDepCode,
+          cPersonCode,
+          dARVDate,
+          cBusType,
+          cPTCode,
+          cMemo,
+          cRdCode,
+          cDefine10,
+          bredvouch,<!--红蓝标识-->
+          bRdFlag,<!--收发标志-->
+          cSource,<!--单据来源-->
+          bTransFlag,<!--是否传递 -->
+          bIsSTQc,<!--是否传递 -->
+          cMaker,
+        dnmaketime,
+        cHandler,
+        dVeriDate,
+        dnverifytime,
+        cDefine13,
+        ipurorderid
+        )
+        VALUES
+            (
+                #{RdRecord01.ID},
+                '01',
+                #{RdRecord01.cCode},
+                #{RdRecord01.dDate},
+                #{RdRecord01.cWhCode},
+                #{RdRecord01.cOrderCode},
+                #{RdRecord01.cARVCode},
+                #{RdRecord01.cVenCode},
+                #{RdRecord01.cDepCode},
+                #{RdRecord01.cPersonCode},
+                #{RdRecord01.dARVDate},
+                #{RdRecord01.cBusType},
+                #{RdRecord01.cPTCode},
+                #{RdRecord01.cMemo},
+                #{RdRecord01.cRdCode},
+                #{RdRecord01.exportInvoiceNo},
+                #{RdRecord01.cVouchType},
+                1,
+                #{RdRecord01.cSource},
+                0,
+                0,
+                '陈创',
+        CONVERT(varchar,GETDATE(),20),
+                '陈创',
+        CONVERT(varchar,GETDATE(),23),
+        CONVERT(varchar,GETDATE(),20),
+        #{RdRecord01.cOrderCode},
+        #{RdRecord01.ipurorderid}
+        )
+    </insert>
+    
+    <insert id="saveRdrecords01One" parameterType="java.util.List">
+        <foreach collection="list" item="item" index="index" separator=";">
+          INSERT INTO rdrecords01
+            (
+              AutoID,
+              ID,
+              cDefine22,
+              cDefine28,
+              cInvCode,
+              iQuantity,
+              cBatch,
+              cFree1,
+              cDefine30,
+              cbMemo,
+            iordercode,
+              irowno,
+              iFlag,<!--是否传递 -->
+            iMatSettleState,<!--结算状态 -->
+            iBillSettleCount,<!--结算次数 -->
+            iPOsID,
+            iOMoDID,
+            cPOID
+            )
+            VALUES
+            (
+              #{item.AutoID},
+              #{item.ID},
+              #{item.cDefine22},
+              #{item.cDefine28},
+              #{item.cInvCode},
+              #{item.iQuantity},
+              #{item.cBatch},
+              #{item.colour},
+              #{item.cDefine30},
+              #{item.cbMemo},
+              #{item.iordercode},
+            #{item.irowno},
+            0,
+            0,
+            0,
+            #{item.iPOsID},
+            #{item.iOMoDID},
+            #{item.cPOID}
+            )
+        </foreach>
+    </insert>
+
+    <insert id="saveRdrecords01">
+            INSERT INTO rdrecords01
+            (
+            AutoID,
+            ID,
+            <!--cDefine22,
+            cDefine28,-->
+            cInvCode,
+            iQuantity,
+            cBatch,
+            <!--cFree1,-->
+            <!--cDefine30,-->
+            cbMemo,
+            iordercode,
+            irowno,
+            iFlag,<!--是否传递 -->
+            iMatSettleState,<!--结算状态 -->
+            iBillSettleCount,<!--结算次数 -->
+            iPOsID,
+            iOMoDID,
+            cPOID,
+            cDefine22,
+        cDefine23,
+        cDefine24,
+        cDefine25,
+        cDefine26,
+        cDefine27,
+        cDefine28,
+        cDefine29,
+        cDefine30,
+        cDefine31,
+        cDefine32,
+        cDefine33,
+        cDefine34,
+        cDefine35,
+        cDefine36,
+        cDefine37,
+        cFree1,
+        cFree2,
+        cFree3,
+        cFree4,
+        cFree5,
+        cFree6,
+        cFree7,
+        cFree8,
+        cFree9,
+        cFree10
+            )
+            VALUES
+            (
+            #{map.AutoID},
+            #{map.ID},
+            <!--#{map.cDefine22},
+            #{map.cDefine28},-->
+            #{map.cInvCode},
+            #{map.iQuantity},
+            #{map.cBatch},
+           <!-- #{map.colour},-->
+           <!-- #{map.cDefine30},-->
+            #{map.cbMemo},
+            #{map.iordercode},
+            #{map.irowno},
+            0,
+            0,
+            0,
+            #{map.iPOsID},
+            #{map.iOMoDID},
+            #{map.cPOID},
+        #{map.cDefine22},
+        #{map.cDefine23},
+        #{map.cDefine24},
+        #{map.cDefine25},
+        #{map.cDefine26},
+        #{map.cDefine27},
+        #{map.cDefine28},
+        #{map.cDefine29},
+        #{map.cDefine30},
+        #{map.cDefine31},
+        #{map.cDefine32},
+        #{map.cDefine33},
+        #{map.cDefine34},
+        #{map.cDefine35},
+        #{map.cDefine36},
+        #{map.cDefine37},
+        #{map.cFree1},
+        #{map.cFree2},
+        #{map.cFree3},
+        #{map.cFree4},
+        #{map.cFree5},
+        #{map.cFree6},
+        #{map.cFree7},
+        #{map.cFree8},
+        #{map.cFree9},
+        #{map.cFree10}
+            )
+    </insert>
+
+    <insert id="savePurSettleVouch">
+        INSERT INTO PurSettleVouch (
+        cSVCode,
+        dSVDate,
+        cBusType,
+        cVenCode,
+        cDepCode,
+        cPersonCode,
+        cPTCode,
+        iTaxRate,<!--税率-->
+        bFirst,
+        cMaker,
+        cSettleType,
+        iPrintCount,
+        bMerger,
+        PSVID<!--主键-->
+        )
+        VALUES (
+        #{map.cSVCode},
+        CONVERT(varchar,GETDATE(),20),
+        #{map.cBusType},
+        #{map.cVenCode},
+        #{map.cDepCode},
+        #{map.cPersonCode},
+        #{map.cPTCode},
+        #{map.iTaxRate},
+        0,
+        '陈创',
+        '01',
+        0,
+        0,
+        #{map.PSVID}
+        )
+    </insert>
+
+    <insert id="savePurSettleVouchs">
+        INSERT INTO PurSettleVouchs(
+        cPIVCode,
+        cInvCode,
+        iSVQuantity,<!--结算数量-->
+        iSVCost,<!--结算单价-->
+        iSVPrice,<!--结算金额-->
+        iSVACost,<!--暂估单价-->
+        iSVAPrice,<!--暂估金额-->
+        ID,
+        PSVID,
+        iRdsID,<!--蓝字入库单子表id-->
+        bAccount,
+        crdcvencode,<!--入库单供应商编码-->
+        cUpSoType,<!--入库单单据类型-->
+        )
+        VALUES(
+        #{map.cPIVCode},
+        #{map.cInvCode},
+        #{map.iSVQuantity},
+        #{map.iSVCost},
+        #{map.iSVPrice},
+        #{map.iSVACost},
+        #{map.iSVAPrice},
+        #{map.ID},
+        #{map.PSVID},
+        #{map.iRdsID},
+        0,
+        #{map.crdcvencode},
+        '01',
+        )
+    </insert>
+
+    <select id="getWhCodeByVenCode" parameterType="java.lang.String" resultType="java.util.HashMap">
+        select cVenCode,cVenDefine1,cVenDefine2,cVenAbbName from Vendor where cVenCode=#{cVenCode}
+    </select>
+
+    <select id="getRdrecords01WriteQuantity" resultType="java.util.HashMap" parameterType="java.lang.String">
+      SELECT SUM
+            ( rs.iQuantity ) - SUM ( rs.iSumBillQuantity )
+        FROM
+            rdrecords01 rs
+            LEFT JOIN RdRecord01 r ON rs.ID= r.ID
+        WHERE
+            r.bredvouch= 0
+            AND rs.iPOsID= #{rowmId}
+    </select>
+
+    <select id="getPOPodetailsINatUnitPrice" parameterType="java.lang.String" resultType="java.util.HashMap">
+        select iNatUnitPrice,iPerTaxRate from PO_Podetails where ID=#{rowmId}
+    </select>
+
+    <select id="getPOPodetails" parameterType="java.lang.String" resultType="java.util.HashMap">
+        select * from PO_Podetails where ID=#{rowmId}
+    </select>
+
+    <update id="updatePodetailsfreceivedqty" parameterType="java.util.HashMap">
+        update PO_Podetails set freceivedqty=#{map.freceivedqty} where ID=#{map.ID}
+    </update>
+
+    <select id="getOMMODetails" parameterType="java.lang.String" resultType="java.util.HashMap">
+        select * from OM_MODetails where MODetailsID=#{rowmId}
+    </select>
+    <update id="updateOMMODetailsfreceivedqty" parameterType="java.util.HashMap">
+        update OM_MODetails set iReceivedQTY=#{map.freceivedqty} where MODetailsID=#{map.ID}
+    </update>
+
+    <insert id="saveTransVouch">
+        INSERT INTO TransVouch(ID,cTVCode,dTVDate,cODepCode,cIDepCode,cOWhCode,cIWhCode,cORdCode,cIRdCode,cMPoCode,cDefine13,
+        cPersonCode,<!--业务员-->
+        cMaker,<!--制单人专用接口用户-->
+        iNetLock,
+        VT_ID,
+        cVerifyPerson,<!--审核人 专用接口用户-->
+        iverifystate,<!--审核状态 为null-->
+        dVerifyDate,<!--审核日期-->
+        cPSPCode,<!--父级产品编码?-->
+        cOrderType,
+        csource,
+        itransflag,
+        dnmaketime,<!--制单日期-->
+        dnverifytime,<!--审核时间-->
+        iswfcontrolled,
+        iPrintCount
+        ) VALUES
+        (
+        #{map.ID},
+        #{map.cTVCode},
+        #{map.dTVDate},
+        null,
+        #{map.cIDepCode},
+        #{map.cOWhCode},
+        #{map.cIWhCode},
+        23,
+        13,
+        #{map.cMPoCode},
+        #{map.cDefine13},
+        #{map.cPersonCode},
+        '陈创',
+        0,
+        89,
+        '陈创',
+        null,
+        CONVERT(varchar,GETDATE(),23),
+        #{map.cPSPCode},
+        '委外订单',
+        1,
+        '正向',
+        CONVERT(varchar,GETDATE(),20),
+        CONVERT(varchar,GETDATE(),20),
+        0,
+        0
+        )
+    </insert>
+
+    <insert id="saveTransVouchs">
+        INSERT into TransVouchs(comcode,cDefine22,cTVBatch,cInvCode,iTVQuantity,cFree1,cFree2,cFree4,cFree6,cFree5,cDefine30,cbMemo,
+        cTVCode,autoID,ID,iSSodid,iDSoType,bCosting,invcode,iomids,iExpiratDateCalcu,irowno)
+        VALUES (#{map.comcode},#{map.cDefine22},#{map.cTVBatch},#{map.cInvCode},#{map.iTVQuantity},#{map.cFree1},#{map.cFree2},#{map.cFree4},#{map.cFree6},#{map.comcode},#{map.cFree5},#{map.cbMemo}
+        ,#{map.cTVCode}<!--库存调拨单号 主表单号-->
+        ,#{map.autoID}<!--子表id-->
+        ,#{map.ID}<!--主表id-->
+        ,0
+        ,0
+        ,1<!--是否核算?-->
+        ,#{map.invcode}<!--产品编码? 还有个字段叫存货编码 但是跟产品编码的值也不一样-->
+        ,#{map.iomids}<!--委外订单子件id ?需要跟云工厂确认是否会传-->
+        ,0
+        ,#{map.irowno}<!--行号-->
+        )
+    </insert>
+    <!--新增其他出库单主表-->
+    <insert id="saveRdRecord09">
+        INSERT into RdRecord09 (cCode,dDate,cWhCode,cRdCode,cBusType,cBusCode,cPersonCode,cDepCode
+        ,ID,bRdFlag,cVouchType,cSource,cHandler,bTransFlag,cMaker,dVeriDate,bpufirst,biafirst,VT_ID,bisSTQc,bOMFirst,bFromPreYear,bIsComplement,iDiscountTaxType,iBG_OverFlag,ControlResult,ireturncount
+        ,iverifystate,iswfcontrolled,dnmaketime,dnverifytime,bredvouch,cSourceLs,iPrintCount
+        )
+        VALUES (
+        #{map.cCode},
+        CONVERT(varchar,GETDATE(),23),
+        #{map.cWhCode},<!--调拨单的转出仓库-->
+        '23',
+        '调拨出库',
+        #{map.cBusCode},<!--调拨单号-->
+        #{map.cPersonCode},<!--业务员 调拨单业务员-->
+        #{map.cDepCode},<!--部门 调拨单转出部门-->
+        #{map.ID},
+        0,
+        '09',
+        '调拨',
+        '陈创',
+        0,
+        '陈创',
+        CONVERT(varchar,GETDATE(),23),
+        0,
+        0,
+        85,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        -1,
+        0,
+        0,
+        0,
+        CONVERT(varchar,GETDATE(),20),
+        CONVERT(varchar,GETDATE(),20),
+        #{map.bredvouch},<!--红蓝标识-->
+        1,
+        0
+        )
+    </insert>
+
+<!--   新增其他出库单子表 -->
+    <insert id="saveRdRecords09">
+        INSERT into RdRecords09(cInvCode,cBatch,iQuantity,cbMemo,AutoID,ID,iTrIds,cDefine22,iNQuantity
+        ,cMassUnit,bLPUseFree,iRSRowNO,iOriTrackID,bCosting,bVMIUsed,iexpiratdatecalcu,iordertype,isotype,irowno)
+        VALUES(
+        #{map.cInvCode},
+        #{map.cBatch},
+        #{map.iQuantity},
+        #{map.cbMemo},
+        #{map.AutoID},
+        #{map.ID},
+        #{map.iTrIds},<!--调拨单子表标识-->
+        #{map.cDefine22},<!--款号-->
+        #{map.iNQuantity},<!--应收发数量-->
+        0,
+        0,
+        0,
+        0,
+        1,
+        0,
+        0,
+        0,
+        0,
+        #{map.irowno},<!--行号-->
+        )
+    </insert>
+
+<!--新增其他入库单主表-->
+    <insert id="saveRdRecord08">
+        INSERT into RdRecord08 (cCode,dDate,cWhCode,cRdCode,cBusType,cBusCode,cPersonCode,cDepCode
+        ,ID,bRdFlag,cVouchType,cSource,cHandler,bTransFlag,cMaker,dVeriDate,bpufirst,biafirst,VT_ID,bisSTQc,bOMFirst,bFromPreYear,bIsComplement,iDiscountTaxType,iBG_OverFlag,ControlResult,ireturncount
+        ,iverifystate,iswfcontrolled,dnmaketime,dnverifytime,bredvouch,cSourceLs,iPrintCount
+        )
+        VALUES (
+        #{map.cCode},
+        CONVERT(varchar,GETDATE(),23),
+        #{map.cWhCode},<!--调拨单的转出仓库-->
+        '13',
+        '调拨入库',
+        #{map.cBusCode},<!--调拨单号-->
+        #{map.cPersonCode},<!--业务员 调拨单业务员-->
+        #{map.cDepCode},<!--部门 调拨单转出部门-->
+        #{map.ID},
+        0,
+        '08',
+        '调拨',
+        '陈创',
+        0,
+        '陈创',
+        CONVERT(varchar,GETDATE(),23),
+        0,
+        0,
+        85,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        -1,
+        0,
+        0,
+        0,
+        CONVERT(varchar,GETDATE(),20),
+        CONVERT(varchar,GETDATE(),20),
+        #{map.bredvouch},<!--红蓝标识-->
+        1,
+        0
+        )
+    </insert>
+
+<!--  新增其他入库单子表  -->
+    <insert id="saveRdRecords08">
+        INSERT into RdRecords08(cInvCode,cBatch,iQuantity,cbMemo,AutoID,ID,iTrIds,cDefine22,iNQuantity
+        ,cMassUnit,bLPUseFree,iRSRowNO,iOriTrackID,bCosting,bVMIUsed,iexpiratdatecalcu,iordertype,isotype,irowno)
+        VALUES(
+        #{map.cInvCode},
+        #{map.cBatch},
+        #{map.iQuantity},
+        #{map.cbMemo},
+        #{map.AutoID},
+        #{map.ID},
+        #{map.iTrIds},<!--调拨单子表标识-->
+        #{map.cDefine22},<!--款号-->
+        #{map.iNQuantity},<!--应收发数量-->
+        0,
+        0,
+        0,
+        0,
+        1,
+        0,
+        0,
+        0,
+        0,
+        #{map.irowno},<!--行号-->
+        )
+    </insert>
+
+    <select id="getPerson" parameterType="java.lang.String" resultType="java.util.HashMap">
+        select * from Person where cPersonCode=#{cPersonCode}
+    </select>
+
+    <select id="getOMMoDetails" parameterType="java.lang.String" resultType="java.util.HashMap">
+      select * from OM_MODetails where moDetailsId=#{moDetailsId}
+    </select>
+
+    <update id="updateVoucherHistoryCNumber" >
+        update VoucherHistory set cNumber=#{cNumber} where CardNumber=#{cardNumber}
+    </update>
 
 </mapper>

+ 207 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/openApi/mapper/xml/SubcontractingOrderMapper.xml

@@ -0,0 +1,207 @@
+<?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.openApi.mapper.SubcontractingOrderMapper">
+
+    <select id="callGetMaxCode" resultType="int">
+        exec getMaxCode @StuNo = #{StuNo}
+    </select>
+
+    <select id="callGetUAMaxPK" resultType="map">
+        exec getUAMaxCode @StuNo = #{StuNo} ,@accId = #{accId}
+    </select>
+    
+    <select id="selectInfoByCode" resultType="map">
+        select cVenCode,-- 供货单位
+               cDepCode , -- 部门编码
+               cPersonCode -- 业务员编码
+        from OM_MOMain where ccode = #{code}
+    </select>
+
+    <select id="selectUnitByCode" resultType="map">
+        select cComUnitCode from Inventory where cInvCode = #{code}
+    </select>
+
+    <select id="selectVendorByCode" resultType="map">
+        select cVenDefine2 from Vendor where cVenCode = #{code}
+    </select>
+
+    <select id="selectOrderByCode" resultType="org.jeecg.modules.openApi.entity.SubcontractingOrder">
+
+        select a.moId ,-- 染厂
+               e.cvcName ,-- 染厂
+               a.cCode ,-- 委外订单号
+               b.cInvCode , -- 存货编码
+               c.cInvName , -- 存货名称
+               c.cEnglishName , -- 存货英文名称
+               b.cdefine22 itemNumber, -- 款号
+               b.cfree1 color,-- 颜色
+               b.cDefine30 colorNumber,-- 色号
+               b.cFree6 gram, -- 要求克重
+               b.cFree4 doorWidth-- 要求门幅
+        from OM_MOMain a
+                 left join OM_MODetails b on a.moid = b.moid
+                 left join Inventory c on b.cInvCode = c.cInvCode
+                 left join Vendor d on a.cVenCode = d.cVenCode
+                 left join VendorClass e on d.cVCCode = e.cVCCode
+        where a.ccode = #{code}
+        and b.MoDetailsID = #{MoDetailsID}
+    </select>
+
+    <insert id="saveRdRecord01One">
+
+        INSERT INTO RdRecord01
+        (
+         ID,
+         cVouchType,<!--1 单据类型编码  01-->
+         cCode,<!--2 收发单据号-->
+         dDate,<!--3 单据日期 当前日期-->
+         cWhCode,<!--4 仓库编码-->
+         cOrderCode,<!--5 委外订单号 验布机-->
+         cVenCode,<!--6 供应商编码-->
+         cDepCode,<!--7 部门编码-->
+         cPersonCode,<!--8 业务员编码-->
+         cBusType,<!--9 业务类型-根据订单号获取或者默认  普通采购-->
+         cPTCode,<!--10 采购类型编码   01-->
+         cRdCode,<!--11 委外入库 默认 12-->
+         bredvouch,<!--12红蓝标识-->
+         bRdFlag,<!--13收发标志1-->
+         cSource,<!--14单据来源-->
+         bTransFlag,<!--15是否传递 0-->
+         bIsSTQc,<!--16是否传递 0-->
+         cMaker,<!--17创建人 验布机-->
+         cDefine13 <!-- 18委外订单号-->
+        )
+        VALUES (
+        #{ID},
+                #{cVouchType},<!--1 单据类型编码 采购入库-->
+                #{cCode},<!--2 收发单据号-->
+                getdate(),<!--3 单据日期 当前日期-->
+                'W50081',<!--4 #{cWhCode}仓库编码-->
+                #{cOrderCode},<!--5 委外订单号 验布机-->
+                #{cVenCode}, <!--6 供应商编码-->
+                #{cDepCode},<!-- 7部门编码-->
+                #{cPersonCode},<!--8业务员编码-->
+               '委外加工', <!-- 9业务类型-根据订单号获取或者默认 委外加工-->
+               '02',<!--10采购类型编码   02-->
+                '12',<!--11 委外入库 默认12-->
+                0, <!--12红蓝标识-->
+                1, <!--13收发标志 1-->
+                '验布机',<!--14 单据来源-->
+                0, <!--15是否传递 0-->
+                0, <!--16是否传递 0-->
+                '验布机',<!--17创建人 验布机-->
+                #{cOrderCode} <!-- 18委外订单号-->
+
+               )
+    </insert>
+
+    <insert id="saveRdrecords01One" >
+            INSERT INTO rdrecords01
+            (
+            AutoID,--1 子表主键
+            ID,--2 主表主键
+            cDefine22,--3 款号
+            cInvCode,--5 存货编码
+            iQuantity,--6 数量
+            cBatch,--7 批号
+            cFree1,--8 颜色
+            cDefine30, --9 染厂色号
+            cbMemo,--10 备注
+            iordercode, --11 订单号
+            irowno,--12 行号
+            iFlag,--13是否传递 --> 0
+            iMatSettleState,--14结算状态 --> 0
+            iBillSettleCount,--15结算次数 --> 0
+            cAssUnit,--18 辅计量单位编码
+            cFree4, -- 19 光坯毛门幅CM
+            cFree6, -- 20 克重/工艺
+            cFree5, -- 21 件数 总卷数
+            cPOID --22 订单号
+            )
+            VALUES
+            (
+            #{AutoID},--1 子表主键
+            #{ID},--2 主表主键
+            #{cDefine22},--3 款号
+            #{cInvCode},--5 存货编码
+            #{iQuantity},--6 数量
+            #{cBatch},--7 批号
+            #{color},--8 颜色
+            #{cDefine30},--9 染厂色号
+            #{cbMemo},--10 备注
+            #{iordercode}, --11 订单号
+            #{irowno},--12 行号
+            0,--13是否传递 --> 0
+            0,--14结算状态 --> 0
+            0,--15结算次数 --> 0
+            #{unit}, -- 18 单位
+            #{polishedBlank}, -- 19 光坯毛门幅CM
+            #{gramWeight}, -- 20 克重/工艺
+            #{num}, -- 21 件数 总卷数
+            #{cPOID}--22 订单号
+            )
+    </insert>
+
+    <select id="selectRdRecord01ByCode" resultType="map">
+
+        select ID,
+               bredvouch,-- 红蓝标识
+               cVouchType, -- 单据类型编码  01
+               cCode, -- 收发单据号
+               dDate, -- 单据日期 当前日期
+               cWhCode, -- 仓库编码
+               cOrderCode, -- 采购订单号
+               cARVCode, -- 采购到货单号
+               cVenCode, -- 供应商编码
+               cDepCode, -- 部门编码
+               cPersonCode, -- 业务员编码
+               dARVDate, -- 到货日期 空
+               cBusType, -- 业务类型   普通采购
+               cPTCode, -- 采购类型编码   01
+               cMemo, -- 备注
+               cRdCode, -- 收发类别编码 1
+               bredvouch,--红蓝标识--> 0
+               bRdFlag,--收发标志-- 1
+               cSource,--单据来源-->
+               bTransFlag,--是否传递 --> 0
+               bIsSTQc,--是否传递 --> 0
+               cMaker, -- 创建人 验布机
+               cHandler, -- 审核人 空
+               dVeriDate, -- 审核日期
+               dnverifytime, -- 审核时间
+               cDefine13 -- 委外订单号
+        from RdRecord01 where cCode = #{code}
+
+    </select>
+
+    <select id="selectRdChildById" resultType="map">
+
+        select AutoID, -- 子表主键
+               ID, -- 主表主键
+               cDefine22, -- 款号
+               cDefine28, -- 小PO 空
+               cInvCode, -- 存货编码
+               iQuantity,-- 数量
+               cBatch, -- 批号
+               cFree1, -- 颜色
+               cDefine30, -- 染厂色号
+               cbMemo, -- 备注
+               iordercode, -- 订单号
+               irowno, -- 行号
+               iFlag, --是否传递 --> 0
+               iMatSettleState, --结算状态 --> 0
+               iBillSettleCount, --结算次数 --> 0
+               iPOsID, -- 采购订单子表标识 空
+               iOMoDID, -- 委外订单子表ID  空
+               cPOID, -- 订单号
+               cAssUnit --辅计量单位编码
+        from rdrecords01 where id =#{id}
+
+    </select>
+
+    <update id="toExamine">
+        update RdRecord01 set cHandler =#{cHandler} ,dVeriDate = getdate() , dnverifytime = getdate()
+        where cCode = #{code}
+
+    </update>
+</mapper>

+ 19 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/openApi/service/IDxpDataPlanService.java

@@ -0,0 +1,19 @@
+package org.jeecg.modules.openApi.service;
+
+import org.jeecg.modules.openApi.entity.DxpDataPlan;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+import java.util.Date;
+
+/**
+ * @Description: 项目推单接口信息
+ * @Author: jeecg-boot
+ * @Date:   2022-04-01
+ * @Version: V1.0
+ */
+public interface IDxpDataPlanService extends IService<DxpDataPlan> {
+
+    //回写调用时间
+    public void updateLastTime(Date time, String code);
+
+}

+ 14 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/openApi/service/IPurchaseWarehousingService.java

@@ -3,6 +3,9 @@ package org.jeecg.modules.openApi.service;
 import org.jeecg.modules.openApi.entity.PurchaseWarehousing;
 import com.baomidou.mybatisplus.extension.service.IService;
 
+import java.util.List;
+import java.util.Map;
+
 /**
  * @Description: 采购入库
  * @Author: jeecg-boot
@@ -11,4 +14,15 @@ import com.baomidou.mybatisplus.extension.service.IService;
  */
 public interface IPurchaseWarehousingService extends IService<PurchaseWarehousing> {
 
+    void savaOne(List<Map<String,Object>> mapList);
+
+    void savaTwo(List<Map<String,Object>> mapList);
+
+    void savaThree(List<Map<String,Object>> mapList);
+
+
+    String getMaxId(String id,String tableName);
+
+
+
 }

+ 14 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/openApi/service/IRdrecord11Service.java

@@ -0,0 +1,14 @@
+package org.jeecg.modules.openApi.service;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import org.jeecg.modules.openApi.entity.SubcontractingOrder;
+
+import java.util.List;
+
+public interface IRdrecord11Service {
+
+    public JSONObject getRdrecord(String org,String cCode) throws Exception;//条件查询材料出库单
+
+    public JSONObject getRdrecordToPrint(String org,String cCode) throws Exception;//条件查询材料出库单并打印生成二维码
+}

+ 18 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/openApi/service/ISenYuDataSourceThree.java

@@ -0,0 +1,18 @@
+package org.jeecg.modules.openApi.service;
+
+import java.util.List;
+import java.util.Map;
+
+
+/***
+ * 数据源3
+ *
+ */
+public interface ISenYuDataSourceThree {
+
+    public List<Map<String, Object>> queryForList(String sql);//查询
+
+    public boolean update(String sql);//执行更新或删除语句
+
+
+}

+ 18 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/openApi/service/ISenYuDataSourceTwo.java

@@ -0,0 +1,18 @@
+package org.jeecg.modules.openApi.service;
+
+import java.util.List;
+import java.util.Map;
+
+
+/***
+ * 数据源2
+ *
+ */
+public interface ISenYuDataSourceTwo {
+
+    public List<Map<String, Object>> queryForList(String sql);//查询
+
+    public boolean update(String sql);//执行更新或删除语句
+
+
+}

+ 25 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/openApi/service/SubcontractingOrderService.java

@@ -0,0 +1,25 @@
+package org.jeecg.modules.openApi.service;
+
+import com.alibaba.fastjson.JSONArray;
+import com.baomidou.mybatisplus.extension.service.IService;
+import org.jeecg.modules.openApi.entity.SubcontractingOrder;
+
+import java.util.List;
+import java.util.Map;
+
+public interface SubcontractingOrderService extends IService<SubcontractingOrder> {
+
+    List<SubcontractingOrder> selectOrderByCodeOne(String code,String MoDetailsID);
+    List<SubcontractingOrder> selectOrderByCodeTwo(String code,String MoDetailsID);
+    List<SubcontractingOrder> selectOrderByCodeThree(String code,String MoDetailsID);
+
+    String saveWarehousing(List<Map<String,Object>> map);
+
+    String callGetMaxCode(String StuNo);
+
+    Map<String,Integer> callGetUAMaxPK(String StuNo);
+
+    Map<String,Object> selectRdRecord01ByCode(String code);
+
+    int toExamine(String code,String cHandler);
+}

+ 35 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/openApi/service/impl/DxpDataPlanServiceImpl.java

@@ -0,0 +1,35 @@
+package org.jeecg.modules.openApi.service.impl;
+
+import org.jeecg.modules.openApi.entity.DxpDataPlan;
+import org.jeecg.modules.openApi.mapper.DxpDataPlanMapper;
+import org.jeecg.modules.openApi.service.IDxpDataPlanService;
+import org.springframework.stereotype.Service;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+
+import javax.annotation.Resource;
+import java.util.Date;
+
+/**
+ * @Description: 项目推单接口信息
+ * @Author: jeecg-boot
+ * @Date:   2022-04-01
+ * @Version: V1.0
+ */
+@Service
+public class DxpDataPlanServiceImpl extends ServiceImpl<DxpDataPlanMapper, DxpDataPlan> implements IDxpDataPlanService {
+
+    @Resource
+    private DxpDataPlanMapper dxpDataPlanMapper;
+
+
+    /**
+     * 调用最后时间
+     * @param time
+     * @param code
+     */
+    @Override
+    public void updateLastTime(Date time, String code) {
+        dxpDataPlanMapper.updateLastTime(time,code);
+    }
+}

+ 481 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/openApi/service/impl/PurchaseWarehousingServiceImpl.java

@@ -1,11 +1,22 @@
 package org.jeecg.modules.openApi.service.impl;
 
+import com.baomidou.dynamic.datasource.annotation.DS;
+import org.apache.commons.lang.StringUtils;
 import org.jeecg.modules.openApi.entity.PurchaseWarehousing;
 import org.jeecg.modules.openApi.mapper.PurchaseWarehousingMapper;
 import org.jeecg.modules.openApi.service.IPurchaseWarehousingService;
+import org.jeecg.modules.system.entity.SysUser;
+import org.jeecg.modules.system.service.ISysUserService;
+import org.jeecg.modules.system.util.oConvertUtils;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.math.BigDecimal;
+import java.text.SimpleDateFormat;
+import java.util.*;
 
 /**
  * @Description: 采购入库
@@ -13,7 +24,477 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
  * @Date:   2022-03-31
  * @Version: V1.0
  */
+@Transactional
 @Service
 public class PurchaseWarehousingServiceImpl extends ServiceImpl<PurchaseWarehousingMapper, PurchaseWarehousing> implements IPurchaseWarehousingService {
 
+    @Autowired
+    private ISysUserService iSysUserService;
+
+    @Autowired
+    private PurchaseWarehousingMapper purchaseWarehousingMapper;
+
+    @DS("multi-one")
+    @Override
+    public void savaOne(List<Map<String, Object>> mapList) {
+        save(mapList);
+    }
+
+    @DS("multi-two")
+    @Override
+    public void savaTwo(List<Map<String, Object>> mapList) {
+        save(mapList);
+    }
+
+    @DS("multi-three")
+    @Override
+    public void savaThree(List<Map<String, Object>> mapList) {
+        save(mapList);
+    }
+
+    public void save(List<Map<String, Object>> mapList){
+        if(mapList!=null&&mapList.size()>0){
+
+            for(Map<String,Object> map:mapList){
+                //获取主表最大编码
+                map.put("ID", oConvertUtils.addOne(getMaxId("ID","RdRecord01")));
+
+                System.out.println(map.get("ID"));
+                //获取最大code
+                String cCode=oConvertUtils.addOne(this.baseMapper.getMaxCode("cCode","RdRecord01"));
+
+                if(cCode!=null){
+                    map.put("cCode",cCode);
+                    this.baseMapper.updateVoucherHistoryCNumber(oConvertUtils.maxNumber(String.valueOf(map.get("cCode"))),"24");
+                }else{
+                    throw new RuntimeException("获取入库单号失败");
+                }
+                //日期
+                Long longtime=Long.valueOf(String.valueOf(map.get("dDate")));
+                String formatTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date(longtime));
+                map.put("dDate",formatTime);
+                //红蓝标识
+                if(map.get("cVouchType").toString().equals("1")){
+                    map.put("cVouchType",0);//采购入库
+                }else{
+                    map.put("cVouchType",1);//红字入库
+                }
+                //入库类别、采购类型
+                if(map.get("cRdCode").toString().equals("采购入库")){
+                    //采购入库
+                    map.put("cRdCode","11");
+                    map.put("cPTCode","01");
+                    map.put("cSource","采购订单");
+                }else{
+                    //委外入库
+                    map.put("cRdCode","12");
+                    map.put("cPTCode","01");
+                    map.put("cSource","委外订单");
+                }
+                //获取部门编码
+                if(map.get("cPersonCode")!=null){
+                    String cPersonCode=String.valueOf(map.get("cPersonCode"));
+                    Map<String,Object> personMap=this.baseMapper.getPerson(cPersonCode);
+                    if(personMap==null){
+                        throw new RuntimeException("通过业务员编码未找到部门");
+                    }else{
+                        map.put("cDepCode",personMap.get("cDepCode"));
+                    }
+                }else{
+                    throw new RuntimeException("业务员编码不能为空");
+                }
+                //获取根据供应商获取仓库编码
+                String cVenCode=String.valueOf(map.get("cVenCode"));
+                if(map.get("cVenCode")!=null){
+                    Map<String,Object> whCodeMap= this.baseMapper.getWhCodeByVenCode(cVenCode);
+                    if(whCodeMap!=null){
+                        if(whCodeMap.get("cVenDefine2")!=null){
+                            String cWhCode=String.valueOf(whCodeMap.get("cVenDefine2"));//成品仓库
+                            map.put("cWhCode",cWhCode);
+                        }else{
+                            throw new RuntimeException("未找到供应商的成品仓库");
+                        }
+                    }else{
+                        throw new RuntimeException("未找到供应商");
+                    }
+
+                }else{
+                    throw new RuntimeException("供应商编码不能为空");
+                }
+
+
+                //子表
+                List<Map<String,Object>> itemList=new ArrayList<>();
+                if(map.get("item")!=null&&!map.get("item").equals("")){
+                    itemList=(List<Map<String,Object>>)map.get("item");
+                    Integer rowId=1;
+                    String message="";
+                    for(Map<String,Object> itemMap:itemList){
+                        //获取子表最大id
+                        itemMap.put("AutoID",oConvertUtils.addOne(getMaxId("AutoID","rdrecords01")));
+                        //主表id
+                        itemMap.put("ID",map.get("ID"));
+                        //行号
+                        itemMap.put("irowno",rowId);
+                        //订单号
+                        itemMap.put("cPOID",String.valueOf(map.get("cOrderCode")));
+                        String rowmId="";
+                        //订单子表id
+                        if(map.get("cRdCode").toString().equals("11")){
+                            if(itemMap.get("moDetailId")!=null&&StringUtils.isNotBlank(String.valueOf(itemMap.get("moDetailId")))) {
+                                itemMap.put("iPOsID", itemMap.get("moDetailId"));//采购订单行id
+                                itemMap.put("iOMoDID", "");//委外订单行id
+                                rowmId = String.valueOf(itemMap.get("moDetailId"));
+                                //获取订单行的数据
+                                Map<String,Object> mapPOPodetails= this.baseMapper.getPOPodetails(rowmId);
+
+                                if(mapPOPodetails!=null){
+                                    map.put("ipurorderid",mapPOPodetails.get("POID"));
+                                    //获取订单行的自定义项数据
+                                    getcFree(itemMap,mapPOPodetails);
+                                    //回写入库数量到采购订单行
+                                    if(mapPOPodetails.get("freceivedqty")!=null){
+                                        BigDecimal freceivedqty=getDecimalNew(String.valueOf(mapPOPodetails.get("freceivedqty"))).add(getDecimalNew(String.valueOf(itemMap.get("iQuantity"))));
+                                        Map<String,Object> mapFreceivedqty=new HashMap<>();
+                                        mapFreceivedqty.put("freceivedqty",freceivedqty);//入库数量
+                                        mapFreceivedqty.put("ID",rowmId);//订单行id
+                                        //回写到采购订单对应行
+                                        this.baseMapper.updatePodetailsfreceivedqty(mapFreceivedqty);
+                                    }
+
+                                }else{
+                                    message=message+"第"+rowId+"未找到对应的采购订单行;";
+                                }
+                            }else{
+                                message=message+"第"+rowId+"缺少采购订单行id;";
+                            }
+                        }else{//委外入库
+
+                            if(itemMap.get("moDetailId")!=null&&StringUtils.isNotBlank(String.valueOf(itemMap.get("moDetailId")))){
+                                itemMap.put("iPOsID","");//采购订单行id
+                                itemMap.put("iOMoDID",itemMap.get("moDetailId"));//委外订单行id
+                                String moDetailId=String.valueOf(itemMap.get("moDetailId"));//委外订单行id
+                                //获取来源订单号
+                                Map<String,Object> omMoDetails=this.baseMapper.getOMMoDetails(moDetailId);
+                                itemMap.put("iordercode",omMoDetails.get("csoordercode"));//来源订单号
+                                rowmId=String.valueOf(itemMap.get("moDetailId"));
+                                //获取订单行数据
+                                Map<String,Object> mapOMMODetails=this.baseMapper.getOMMODetails(rowmId);
+                                if(mapOMMODetails!=null){
+                                    //获取订单的自定义数据
+                                    getcFree(itemMap,mapOMMODetails);
+                                    //回写入库数量到委外订单行
+                                    if(mapOMMODetails.get("iReceivedQTY")!=null){
+                                        BigDecimal freceivedqty=getDecimalNew(String.valueOf(mapOMMODetails.get("iReceivedQTY"))).add(getDecimalNew(String.valueOf(itemMap.get("iQuantity"))));
+                                        Map<String,Object> mapFreceivedqty=new HashMap<>();
+                                        mapFreceivedqty.put("iReceivedQTY",freceivedqty);//入库数量
+                                        mapFreceivedqty.put("ID",rowmId);//订单行id
+                                        //回写到委外订单对应行
+                                        this.baseMapper.updateOMMODetailsfreceivedqty(mapFreceivedqty);
+                                    }
+                                }else{
+                                    message=message+"第"+rowId+"未找到对应的委外订单行;";
+                                }
+                            }else{
+                                message=message+"第"+rowId+"缺少委外订单行id;";
+                            }
+                        }
+                        //如果是红字入库则处理是否需要做结算单
+                        if(map.get("cVouchType").toString().equals("1")){
+                            //保存结算单
+//                            savePurSettleVouch(map,itemMap,rowmId);
+                            itemMap.put("iQuantity","-"+itemMap.get("iQuantity"));
+                        }
+
+                        rowId++;
+                        if(StringUtils.isEmpty(message)) {
+                            this.baseMapper.saveRdrecords01(itemMap);
+                        }
+                    }
+                    if(StringUtils.isNotBlank(message)){
+                        throw new RuntimeException(message);
+                    }
+//                    this.baseMapper.saveRdrecords01One(itemList);
+                }
+                this.baseMapper.saveRdRecord01One(map);
+                //调拨单
+                //判断接收方是否有只值 宁波森语 马菲羊 森语集团
+//                if(map.get("cVenCodeReceiver")!=null&&!String.valueOf(map.get("cVenCodeReceiver")).equals("")){
+//                    //根据接收方获取供应商信息
+//                    Map<String,Object> mapVenCode= this.baseMapper.getWhCodeByVenCode(String.valueOf(map.get("cVenCodeReceiver")));
+//                    if(mapVenCode!=null){
+//                        String cVenAbbName=String.valueOf(mapVenCode.get("cVenAbbName"));//供应商简称
+//                        //判断是否外部供应商  外部则进入下一波做调拨单 非则不做
+//                        if(!cVenAbbName.equals("宁波森语")&&!cVenAbbName.equals("马菲羊")&&!cVenAbbName.equals("森语集团")){
+//                            //保存调拨单
+//                            saveTransVouch(map,itemList);
+//                        }
+//                    }else{
+//                        throw new RuntimeException("未能找到接收方信息");
+//                    }
+//                }
+            }
+        }
+    }
+
+    //获取采购订单行自定义项数据与存货自定义项数据
+    public void getcFree(Map<String,Object> itemMap,Map<String,Object> mapPOPodetails){
+        itemMap.put("cDefine22",setNull(mapPOPodetails.get("cDefine22")));
+        itemMap.put("cDefine23",setNull(mapPOPodetails.get("cDefine23")));
+        itemMap.put("cDefine24",setNull(mapPOPodetails.get("cDefine24")));
+        itemMap.put("cDefine25",setNull(mapPOPodetails.get("cDefine25")));
+        itemMap.put("cDefine26",setNull(mapPOPodetails.get("cDefine26")));
+        itemMap.put("cDefine27",setNull(mapPOPodetails.get("cDefine27")));
+        itemMap.put("cDefine28",setNull(mapPOPodetails.get("cDefine28")));
+        itemMap.put("cDefine29",setNull(mapPOPodetails.get("cDefine29")));
+        itemMap.put("cDefine30",setNull(mapPOPodetails.get("cDefine30")));
+        itemMap.put("cDefine31",setNull(mapPOPodetails.get("cDefine31")));
+        itemMap.put("cDefine32",setNull(mapPOPodetails.get("cDefine32")));
+        itemMap.put("cDefine33",setNull(mapPOPodetails.get("cDefine33")));
+        itemMap.put("cDefine34",setNull(mapPOPodetails.get("cDefine34")));
+        itemMap.put("cDefine35",setNull(mapPOPodetails.get("cDefine35")));
+        itemMap.put("cDefine36",setNull(mapPOPodetails.get("cDefine36")));
+        itemMap.put("cDefine37",setNull(mapPOPodetails.get("cDefine37")));
+        itemMap.put("cFree1",setNull(mapPOPodetails.get("cFree1")));
+        itemMap.put("cFree2",setNull(mapPOPodetails.get("cFree2")));
+        itemMap.put("cFree3",setNull(mapPOPodetails.get("cFree3")));
+        itemMap.put("cFree4",setNull(mapPOPodetails.get("cFree4")));
+        itemMap.put("cFree5",setNull(mapPOPodetails.get("cFree5")));
+        itemMap.put("cFree6",setNull(mapPOPodetails.get("cFree6")));
+        itemMap.put("cFree7",setNull(mapPOPodetails.get("cFree7")));
+        itemMap.put("cFree8",setNull(mapPOPodetails.get("cFree8")));
+        itemMap.put("cFree9",setNull(mapPOPodetails.get("cFree9")));
+        itemMap.put("cFree10",setNull(mapPOPodetails.get("cFree10")));
+    }
+    public Object setNull(Object o){
+        if(o==null){
+            return "";
+        }else{
+            return o;
+        }
+
+    }
+
+    //保存结算单
+    public void savePurSettleVouch(Map<String,Object> map,Map<String,Object> itemMap,String rowmId){
+        BigDecimal rdiQuantity=getDecimalNew(String.valueOf(itemMap.get("iQuantity")));
+        BigDecimal decimal=this.baseMapper.getRdrecords01WriteQuantity(rowmId);
+        //根据红字查询对应的蓝字入库的未做发票的数量判断是否有且是否大于红字入库数量
+        if(decimal!=null&&decimal.doubleValue()>0.0&&decimal.doubleValue()>rdiQuantity.doubleValue()){
+            Map<String,Object> mapPurSettleVouch=new HashMap<>();
+            Map<String,Object> mapPurSettleVouchs=new HashMap<>();
+            //主表
+            mapPurSettleVouch.put("PSVID",oConvertUtils.addOne(getMaxId("PSVID","PurSettleVouch")));
+            mapPurSettleVouch.put("cSVCode",oConvertUtils.addOne(getMaxId("cSVCode","PurSettleVouch")));
+            mapPurSettleVouch.put("cVenCode",map.get("cVenCode"));
+            mapPurSettleVouch.put("cDepCode",map.get("cDepCode"));
+            mapPurSettleVouch.put("cPersonCode",map.get("cPersonCode"));
+            mapPurSettleVouch.put("cPTCode",map.get("cPTCode"));
+            //子表
+            mapPurSettleVouchs.put("cPIVCode",map.get("cCode"));//入库单号
+            mapPurSettleVouchs.put("cInvCode",itemMap.get("cInvCode"));//存货编码
+            mapPurSettleVouchs.put("iSVQuantity",itemMap.get("iQuantity"));//结算数量
+
+            BigDecimal money=new BigDecimal("0.0");//金额
+            BigDecimal iNatUnitPrice=new BigDecimal("0.0");//单价
+            BigDecimal iPerTaxRate=new BigDecimal("0.0");//税率
+            //根据业务类型取不同的值
+            if(map.get("cRdCode").toString().equals("11")){//采购入库
+                mapPurSettleVouch.put("cBusType","普通采购");
+                //获取采购订单行的本币单价
+                Map<String,Object> mappoPoDetails=this.baseMapper.getPOPodetailsINatUnitPrice(rowmId);
+
+                if(mappoPoDetails!=null){
+                    if(mappoPoDetails.get("iNatUnitPrice")!=null){
+                        iNatUnitPrice=getDecimalNew(String.valueOf(mappoPoDetails.get("iNatUnitPrice")));//单价
+                        money=rdiQuantity.multiply(iNatUnitPrice);//单价*数量获取金额
+                    }
+                    if(mappoPoDetails.get("iPerTaxRate")!=null){
+                        iPerTaxRate=getDecimalNew(String.valueOf(mappoPoDetails.get("iPerTaxRate")));
+                    }
+
+                }
+
+            }else{//委外入库
+                mapPurSettleVouch.put("cBusType","委外加工");
+            }
+            //主
+            mapPurSettleVouch.put("iTaxRate",iPerTaxRate.doubleValue());
+            //子
+            mapPurSettleVouchs.put("iSVCost",iNatUnitPrice.doubleValue());//结算单价
+            mapPurSettleVouchs.put("iSVPrice",money.doubleValue());//结算金额
+            mapPurSettleVouchs.put("iSVACost",iNatUnitPrice.doubleValue());//暂估单价
+            mapPurSettleVouchs.put("iSVAPrice",money.doubleValue());//暂估金额
+            mapPurSettleVouchs.put("ID",oConvertUtils.addOne(getMaxId("ID","PurSettleVouchs")));//ID
+            mapPurSettleVouchs.put("PSVID",mapPurSettleVouch.get("PSVID"));//主表id
+            mapPurSettleVouchs.put("iRdsID",mapPurSettleVouch.get("PSVID"));//蓝字入库单id ???
+            mapPurSettleVouchs.put("crdcvencode",map.get("cVenCode"));//入库单单据类型
+            this.baseMapper.savePurSettleVouch(mapPurSettleVouch);
+            this.baseMapper.savePurSettleVouchs(mapPurSettleVouchs);
+        }
+    }
+
+    public BigDecimal getDecimalNew(String d){
+        if(StringUtils.isEmpty(d)){
+            d="0.0";
+        }
+        BigDecimal decimal= new BigDecimal(d);
+        return decimal;
+    }
+
+    //保存调拨单
+    public void saveTransVouch(Map<String,Object> rdRecord01Map,List<Map<String,Object>> rdRecords01List){
+        Map<String,Object> transVouchMao=new HashMap<>();
+        //获取主表最大ID
+        transVouchMao.put("ID",oConvertUtils.addOne(getMaxId("ID","TransVouch")));
+        //获取最大编码
+        transVouchMao.put("cTVCode",oConvertUtils.addOne(getMaxId("cTVCode","TransVouch")));
+        //修改最大编码
+        this.baseMapper.updateVoucherHistoryCNumber(oConvertUtils.maxNumber(String.valueOf(transVouchMao.get("cTVCode"))),"0304");
+        //单据日期
+        Date date=new Date();
+        SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        transVouchMao.put("dTVDate",formatter.format(date));
+        //转出部门
+        transVouchMao.put("cODepCode","");
+        //转入部门
+        transVouchMao.put("cIDepCode",rdRecord01Map.get("cDepCode"));
+        //转出仓库
+        transVouchMao.put("cOWhCode",rdRecord01Map.get("cWhCode"));
+        //转入仓库??
+        //通过接收方查询原材料仓库
+//        String cVenCodeReceiver=rdRecord01Map.get("cVenCodeReceiver").toString();
+        //获取根据供应商获取仓库编码
+        String cVenCodeReceiver=String.valueOf(rdRecord01Map.get("cVenCodeReceiver"));
+        if(rdRecord01Map.get("cVenCodeReceiver")!=null){
+            Map<String,Object> whCodeMap= this.baseMapper.getWhCodeByVenCode(cVenCodeReceiver);
+            if(whCodeMap!=null){
+                if(whCodeMap.get("cVenDefine1")!=null){
+                    String cWhCode=String.valueOf(whCodeMap.get("cVenDefine1"));//原材料仓库
+                    transVouchMao.put("cIWhCode",cWhCode);
+                }else{
+                    throw new RuntimeException("未找到接收方的原材料仓库");
+                }
+            }else{
+                throw new RuntimeException("未找到接收方");
+            }
+
+        }else{
+            throw new RuntimeException("接收方编码不能为空");
+        }
+//        transVouchMao.put("cIWhCode","");
+        //订单号
+        transVouchMao.put("cMPoCode",rdRecord01Map.get("cOrderCode"));
+        transVouchMao.put("cDefine13",rdRecord01Map.get("cOrderCode"));
+        //业务员
+        transVouchMao.put("cPersonCode",rdRecord01Map.get("cPersonCode"));
+        this.baseMapper.saveTransVouch(transVouchMao);
+        List<Map<String,Object>> transVouchsList=new ArrayList<>();
+        if(rdRecords01List!=null&&rdRecords01List.size()>0){
+            for(Map<String,Object> recordsMap:rdRecords01List){
+                Map<String,Object> vouchsMap=new HashMap<>();
+                vouchsMap.put("comcode",rdRecord01Map.get("cOrderCode"));//委外订单号
+                vouchsMap.put("cDefine22",recordsMap.get("cDefine22"));//款号
+                vouchsMap.put("cTVBatch",recordsMap.get("cBatch"));//批号
+                vouchsMap.put("cInvCode",recordsMap.get("cInvCode"));//存货编码
+                vouchsMap.put("iTVQuantity",recordsMap.get("iQuantity"));//数量
+                vouchsMap.put("cFree1",recordsMap.get("cFree1"));//颜色
+                vouchsMap.put("cFree2",recordsMap.get("cFree2"));//尺码
+                vouchsMap.put("cFree4",recordsMap.get("cFree4"));//光坯门幅
+                vouchsMap.put("cFree6",recordsMap.get("cFree6"));//克重/工艺
+                vouchsMap.put("cFree5",recordsMap.get("cFree5"));//品质/品种
+                vouchsMap.put("cDefine30",recordsMap.get("cDefine30"));//染厂色号
+                vouchsMap.put("cbMemo",recordsMap.get("cbMemo"));//备注
+                vouchsMap.put("cTVCode",transVouchMao.get("cTVCode"));//主表调拨单号
+                vouchsMap.put("autoID", oConvertUtils.addOne(getMaxId("autoID","TransVouchs")));//子表id
+                vouchsMap.put("ID",transVouchMao.get("ID"));//主表ID
+                vouchsMap.put("invcode",recordsMap.get(""));//产品编码
+                vouchsMap.put("iomids",recordsMap.get(""));//委外订单自件id
+                vouchsMap.put("irowno",recordsMap.get("irowno"));//行号
+                this.baseMapper.saveTransVouchs(vouchsMap);
+                transVouchsList.add(vouchsMap);
+            }
+        }
+        //保存其他出库单
+        saveRdRecord09(transVouchMao,transVouchsList);
+        //保存其他入库单
+        saveRdRecord08(transVouchMao,transVouchsList);
+    }
+
+    //根据调拨单新增其他出库单
+    public void saveRdRecord09(Map<String,Object> transVouchMao,List<Map<String,Object>> transVouchsList){
+        //主表
+        Map<String,Object> RdRecord09Map=new HashMap<>();
+        RdRecord09Map.put("cCode",oConvertUtils.addOne(getMaxId("cCode","RdRecord09")));
+        //修改最大编码
+        this.baseMapper.updateVoucherHistoryCNumber(oConvertUtils.maxNumber(String.valueOf(transVouchMao.get("cCode"))),"0302");
+        RdRecord09Map.put("cWhCode",transVouchMao.get("cOWhCode"));//仓库 调拨单转出仓库
+        RdRecord09Map.put("cBusCode",transVouchMao.get("cTVCode"));//调拨单号
+        RdRecord09Map.put("cPersonCode",transVouchMao.get("cPersonCode"));//业务员
+        RdRecord09Map.put("cDepCode",transVouchMao.get("cODepCode"));//部门 转出部门
+        RdRecord09Map.put("ID",oConvertUtils.addOne(getMaxId("ID","RdRecord09")));//ID
+        RdRecord09Map.put("bredvouch",0);//红蓝标识
+        this.baseMapper.saveRdRecord09(RdRecord09Map);
+        if(transVouchsList!=null){
+            for(Map<String,Object> transVouchsMap:transVouchsList){
+                Map<String,Object> RdRecords09Map=new HashMap<>();
+                RdRecords09Map.put("cInvCode",transVouchsMap.get("cInvCode"));//存货编码
+                RdRecords09Map.put("cBatch",transVouchsMap.get("cTVBatch"));//批号
+                RdRecords09Map.put("iQuantity",transVouchsMap.get("iTVQuantity"));//数量
+                RdRecords09Map.put("cbMemo",transVouchsMap.get("cbMemo"));//备注
+                RdRecords09Map.put("AutoID",oConvertUtils.addOne(getMaxId("AutoID","RdRecords09")));//主键
+                RdRecords09Map.put("ID",RdRecord09Map.get("ID"));//主表id
+                RdRecords09Map.put("iTrIds",transVouchsMap.get("autoID"));//调拨单子表id
+                RdRecords09Map.put("cDefine22",transVouchsMap.get("cDefine22"));//款号
+                RdRecords09Map.put("iNQuantity",transVouchsMap.get("iQuantity"));//应发数量 默认为数量
+                RdRecords09Map.put("irowno",transVouchsMap.get("irowno"));//行号
+                this.baseMapper.saveRdRecords09(RdRecords09Map);
+            }
+        }
+    }
+
+    //根据调拨单新增其他入库单
+    public void saveRdRecord08(Map<String,Object> transVouchMao,List<Map<String,Object>> transVouchsList){
+        //主表
+        Map<String,Object> RdRecord08Map=new HashMap<>();
+        RdRecord08Map.put("cCode",oConvertUtils.addOne(getMaxId("cCode","RdRecord08")));
+        //修改最大编码
+        this.baseMapper.updateVoucherHistoryCNumber(oConvertUtils.maxNumber(String.valueOf(transVouchMao.get("cCode"))),"0301");
+        RdRecord08Map.put("cWhCode",transVouchMao.get("cOWhCode"));//仓库 调拨单转出仓库
+        RdRecord08Map.put("cBusCode",transVouchMao.get("cTVCode"));//调拨单号
+        RdRecord08Map.put("cPersonCode",transVouchMao.get("cPersonCode"));//业务员
+        RdRecord08Map.put("cDepCode",transVouchMao.get("cODepCode"));//部门 转出部门
+        RdRecord08Map.put("ID",oConvertUtils.addOne(getMaxId("ID","RdRecord08")));//ID
+        RdRecord08Map.put("bredvouch",0);//红蓝标识
+        this.baseMapper.saveRdRecord08(RdRecord08Map);
+        if(transVouchsList!=null){
+            for(Map<String,Object> transVouchsMap:transVouchsList){
+                Map<String,Object> RdRecords08Map=new HashMap<>();
+                RdRecords08Map.put("cInvCode",transVouchsMap.get("cInvCode"));//存货编码
+                RdRecords08Map.put("cBatch",transVouchsMap.get("cTVBatch"));//批号
+                RdRecords08Map.put("iQuantity",transVouchsMap.get("iTVQuantity"));//数量
+                RdRecords08Map.put("cbMemo",transVouchsMap.get("cbMemo"));//备注
+                RdRecords08Map.put("AutoID",oConvertUtils.addOne(getMaxId("AutoID","rdrecords08")));//主键
+                RdRecords08Map.put("ID",RdRecord08Map.get("ID"));//主表id
+                RdRecords08Map.put("iTrIds",transVouchsMap.get("autoID"));//调拨单子表id
+                RdRecords08Map.put("cDefine22",transVouchsMap.get("cDefine22"));//款号
+                RdRecords08Map.put("iNQuantity",transVouchsMap.get("iQuantity"));//应发数量 默认为数量
+                RdRecords08Map.put("irowno",transVouchsMap.get("irowno"));//行号
+                this.baseMapper.saveRdRecords08(RdRecords08Map);
+            }
+        }
+    }
+
+    @Override
+    public String getMaxId(String id, String tableName) {
+        String maxId=purchaseWarehousingMapper.getMaxId(id,tableName);
+        if(maxId!=null){
+//            maxId=maxId+1;
+        }else{
+            maxId="0";
+        }
+        return maxId;
+    }
+
+
 }

+ 79 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/openApi/service/impl/Rdrecord11ServiceImpl.java

@@ -0,0 +1,79 @@
+package org.jeecg.modules.openApi.service.impl;
+
+import com.alibaba.fastjson.JSONObject;
+import org.jeecg.modules.openApi.service.IRdrecord11Service;
+import org.jeecg.modules.openApi.service.ISenYuDataSourceOne;
+import org.jeecg.modules.openApi.service.ISenYuDataSourceThree;
+import org.jeecg.modules.openApi.service.ISenYuDataSourceTwo;
+import org.jeecg.modules.system.util.JsonChangeUtils;
+import org.jeecg.modules.system.util.oConvertUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+import java.util.Map;
+
+@Service
+public class Rdrecord11ServiceImpl  implements IRdrecord11Service {
+
+    @Autowired
+    private ISenYuDataSourceOne senYuDataSourceOne;
+    @Autowired
+    private ISenYuDataSourceTwo senYuDataSourceTwo;
+    @Autowired
+    private ISenYuDataSourceThree senYuDataSourceThree;
+
+    @Override
+    public JSONObject getRdrecord(String org, String cCode) throws Exception{
+        JSONObject resultJson=new JSONObject();
+        //主表查询SQl
+        String hsql="select top 1  a.ccode,c.cVenName,a.cMPoCode,a.dDate,b.cDefine22,d.cWhName " +
+                "From  rdrecord11 a  left join rdrecords11 b on a.id=b.id left join  Vendor c on a.cVenCode=c.cVenCode " +
+                "left join Warehouse d on a.cWhCode=d.cWhCode where a.cCode='"+cCode+"'";
+        //子表查询SQl 件数/KG不确认
+        String bsql="select b.cbatch,b.cbatchproperty9,b.iquantity,b.cfree5,b.cinvcode,b.cfree4,b.cfree1,b.cfree6  " +
+                "From  rdrecord11 a   join rdrecords11 b on a.id=b.id where a.cCode='"+cCode+"'";
+        if(org.equals("101")){
+            List<Map<String, Object>> hresult = senYuDataSourceOne.queryForList(hsql);
+            List<Map<String, Object>> bresult = senYuDataSourceOne.queryForList(bsql);
+            if(hresult.size()!=1||bresult.size()==0){
+                throw  new Exception(cCode+"单号查询有误,请确认数据!");
+            }
+            resultJson=JsonChangeUtils.toJSONObject(hresult).get(0);
+            resultJson.put("b",JsonChangeUtils.toJSONObject(bresult));
+        }else if(org.equals("102")){
+
+        }else if(org.equals("103")){
+
+        }else{
+            throw  new Exception(org+"该账套号不存在!");
+        }
+        return resultJson;
+    }
+
+    @Override
+    public JSONObject getRdrecordToPrint(String org, String cCode) throws Exception {
+        JSONObject resultJson=new JSONObject();
+        //查询SQl
+        String sql="select a.csysbarcode as '缸单条码(单据条码)',c.cCusCode as '客户',b.cBatch as '缸号' ,a.cVenCode as '供应商', " +
+                "'染厂色号',d.cVenCode  as '委外供应商',b.iQuantity   as '数量',b.csocode as '上游订单号',b.irowno   as '匹数(行号)', " +
+                "b.comcode as '委外订单号',b.cInvCode as '存货名称',a.cCode  as '材料出库单号','描述'  From rdrecord11 a left join  rdrecords11 b " +
+                "on a.id=b.id left join SO_SOMain c on  b.csocode=c.csocode left join OM_MOMain d on b.comcode=d.cCode " +
+                "where  a.cCode='"+cCode+"'";
+        if(org.equals("101")){
+            List<Map<String, Object>> result = senYuDataSourceOne.queryForList(sql);
+            if(result.size()==0){
+                throw  new Exception(cCode+"单号查询有误,请确认数据!");
+            }
+            resultJson.put("b",JsonChangeUtils.toJSONObject(result));
+            oConvertUtils.generateQRCodeImage(JsonChangeUtils.toJSONObject(result).toString(),350,350,"C:/Users/AF/Desktop/text.png");
+        }else if(org.equals("102")){
+
+        }else if(org.equals("103")){
+
+        }else{
+            throw  new Exception(org+"该账套号不存在!");
+        }
+        return resultJson;
+    }
+}

+ 5 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/openApi/service/impl/SenYuDataSourceOneServiceImpl.java

@@ -2,6 +2,8 @@ package org.jeecg.modules.openApi.service.impl;
 
 
 import com.baomidou.dynamic.datasource.annotation.DS;
+import org.jeecg.modules.documents.failDocument.entity.SyFailDocument;
+import org.jeecg.modules.documents.failDocument.service.ISyFailDocumentService;
 import org.jeecg.modules.openApi.service.ISenYuDataSourceOne;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.jdbc.core.JdbcTemplate;
@@ -16,6 +18,8 @@ public class SenYuDataSourceOneServiceImpl implements ISenYuDataSourceOne {
 
     @Autowired
     private JdbcTemplate jdbcTemplate;
+    @Autowired
+    private ISyFailDocumentService failDocumentService;
 
     @Override
     public List<Map<String, Object>> queryForList(String sql) {
@@ -32,4 +36,5 @@ public class SenYuDataSourceOneServiceImpl implements ISenYuDataSourceOne {
         return flag;
     }
 
+
 }

+ 37 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/openApi/service/impl/SenYuDataSourceThreeServiceImpl.java

@@ -0,0 +1,37 @@
+package org.jeecg.modules.openApi.service.impl;
+
+import com.baomidou.dynamic.datasource.annotation.DS;
+import org.jeecg.modules.openApi.service.ISenYuDataSourceThree;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.jdbc.core.JdbcTemplate;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+import java.util.Map;
+
+
+@Service
+@DS("multi-three")
+public class SenYuDataSourceThreeServiceImpl implements ISenYuDataSourceThree {
+
+
+    @Autowired
+    private JdbcTemplate jdbcTemplate;
+
+    @Override
+    public List<Map<String, Object>> queryForList(String sql) {
+        return jdbcTemplate.queryForList(sql);
+    }
+
+    @Override
+    public boolean update(String sql) {
+        boolean flag = false;
+        int i=jdbcTemplate.update(sql);
+        if (i > 0) {
+            flag = true;
+        }
+        return flag;
+    }
+
+
+}

+ 36 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/openApi/service/impl/SenYuDataSourceTwoServiceImpl.java

@@ -0,0 +1,36 @@
+package org.jeecg.modules.openApi.service.impl;
+
+import com.baomidou.dynamic.datasource.annotation.DS;
+import org.jeecg.modules.openApi.service.ISenYuDataSourceTwo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.jdbc.core.JdbcTemplate;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+import java.util.Map;
+
+@Service
+@DS("multi-two")
+public class SenYuDataSourceTwoServiceImpl implements ISenYuDataSourceTwo {
+
+
+    @Autowired
+    private JdbcTemplate jdbcTemplate;
+
+    @Override
+    public List<Map<String, Object>> queryForList(String sql) {
+        return jdbcTemplate.queryForList(sql);
+    }
+
+    @Override
+    public boolean update(String sql) {
+        boolean flag = false;
+        int i=jdbcTemplate.update(sql);
+        if (i > 0) {
+            flag = true;
+        }
+        return flag;
+    }
+
+
+}

+ 234 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/openApi/service/impl/SubcontractingOrderImpl.java

@@ -0,0 +1,234 @@
+package org.jeecg.modules.openApi.service.impl;
+
+import com.baomidou.dynamic.datasource.annotation.DS;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.jeecg.modules.openApi.entity.SubcontractingOrder;
+import org.jeecg.modules.openApi.mapper.PurchaseWarehousingMapper;
+import org.jeecg.modules.openApi.mapper.SubcontractingOrderMapper;
+import org.jeecg.modules.openApi.service.SubcontractingOrderService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Propagation;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.text.SimpleDateFormat;
+import java.util.*;
+
+import static org.apache.commons.lang3.RegExUtils.replaceFirst;
+
+@Service
+public class SubcontractingOrderImpl extends ServiceImpl<SubcontractingOrderMapper, SubcontractingOrder> implements SubcontractingOrderService {
+    @Autowired
+    private SubcontractingOrderMapper subcontractingOrderMapper;
+
+    /**
+     * 调用存储过程 获取下一个编码
+     * @param StuNo 单据类型 24:入库单
+     * @return
+     */
+    @Transactional(propagation = Propagation.REQUIRES_NEW)
+    @DS("multi-three")
+    public String callGetMaxCode(String StuNo) {
+        int num = subcontractingOrderMapper.callGetMaxCode(StuNo);
+        if(num == 0){
+            return "";
+        }
+        if(num < 1000000000){
+            num = num + 1000000000;
+        }else{
+            return String.valueOf(num);
+        }
+        String code = String.valueOf(num);
+        code = replaceFirst(code, "1", "0");
+
+        return code;
+    }
+
+
+     /**
+     * 调用存储过程 获取下一个主键(包含主子表)
+     * @param StuNo rd:入库单
+     * @return
+     */
+    @Transactional(propagation = Propagation.REQUIRES_NEW)
+    @DS("multi-three")
+    public Map<String,Integer> callGetUAMaxPK(String StuNo) {
+        Map<String,Integer> map = subcontractingOrderMapper.callGetUAMaxPK(StuNo,"103");
+        Map<String,Integer> map1 = new HashMap<>();
+
+        if(map.get("iFatherId") != null){//主表主键
+            if(map.get("iFatherId") >= 1000000000){
+                map1.put("iFatherId",map.get("iFatherId"));
+            }else{
+                map1.put("iFatherId",map.get("iFatherId")+1000000000);
+            }
+        }
+        if(map.get("iChildId") != null){ //子表主键
+            if(map.get("iChildId") >= 1000000000){
+                map1.put("iChildId",map.get("iChildId"));
+            }else{
+                map1.put("iChildId",map.get("iChildId")+1000000000);
+            }
+        }
+        return map1;
+    }
+
+    @DS("multi-one")
+    public List<SubcontractingOrder> selectOrderByCodeOne(String code,String MoDetailsID){
+        return subcontractingOrderMapper.selectOrderByCode(code,MoDetailsID);
+    }
+    @DS("multi-two")
+    public List<SubcontractingOrder> selectOrderByCodeTwo(String code,String MoDetailsID){
+        return subcontractingOrderMapper.selectOrderByCode(code,MoDetailsID);
+    }
+    @DS("multi-three")
+    public List<SubcontractingOrder> selectOrderByCodeThree(String code,String MoDetailsID){
+        return subcontractingOrderMapper.selectOrderByCode(code,MoDetailsID);
+    }
+
+    @DS("multi-three")
+    @Override
+    @Transactional(rollbackFor=Exception.class)
+    public String saveWarehousing(List<Map<String,Object>> mapList){
+
+        for(Map<String,Object> map:mapList){
+
+            //红蓝标识
+            map.put("cVouchType","01");//采购入库
+
+            //委外入库
+            map.put("cRdCode","12");//入库类别
+            map.put("cPTCode","02");//采购类型 默认 委外加工 02 类型
+            map.put("cBusType","委外加工");//业务类型 默认 委外加工 12 类型
+            map.put("dDate",new Date());//入库日期
+
+            if(map.get("cOrderCode") == null){
+                throw new RuntimeException("委外订单号为空");
+            }
+
+            Map<String,String> orderInfo = subcontractingOrderMapper.selectInfoByCode(map.get("cOrderCode").toString());
+            if(orderInfo == null){
+                throw new RuntimeException("未查询到该委外订单号:"+map.get("cOrderCode").toString());
+            }else{
+                map.put("cVenCode",orderInfo.get("cVenCode"));//供货单位  委外订单供应商-根据订单号获取
+                map.put("cDepCode",orderInfo.get("cDepCode"));//部门-根据订单号获取
+                map.put("cPersonCode",orderInfo.get("cPersonCode"));//业务员-根据订单号获取
+            }
+
+            Map<String,String> vendorInfo = subcontractingOrderMapper.selectVendorByCode(orderInfo.get("cVenCode"));
+            if(vendorInfo == null){
+                throw new RuntimeException("委外订单号的供应商未维护成品仓库:"+orderInfo.get("cVenCode"));
+            }else{
+                map.put("cWhCode",vendorInfo.get("cVenDefine2"));// 通过单据供应商找到对应的成品仓库
+            }
+//
+
+            //获取新的主表主键
+            Map<String,Integer> pkMap = this.callGetUAMaxPK("rd");
+            map.put("ID",pkMap.get("iFatherId"));
+            //获取新code
+            String cCode = this.callGetMaxCode("24");
+            if(cCode!=null){
+                map.put("cCode",cCode);
+            }else{
+                throw new RuntimeException("获取入库单号失败");
+            }
+
+            //插入主表
+            this.baseMapper.saveRdRecord01One(map);
+            //子表
+            if(map.get("item") != null && !map.get("item").equals("")){
+                List<Map<String,Object>> itemList=(List<Map<String,Object>>)map.get("item");
+                Integer rowId=0;
+                for(Map<String,Object> itemMap:itemList){
+                    rowId++;
+                    //获取子表最大id
+                    Map<String,Integer> pkMapChild = this.callGetUAMaxPK("rd");
+                    itemMap.put("AutoID",pkMapChild.get("iChildId"));
+                    //主表id
+                    itemMap.put("ID",map.get("ID"));
+                    //行号
+                    itemMap.put("irowno",rowId);
+
+                    //itemMap.put("cDefine22",rowId);//款号
+                    //itemMap.put("cDefine28",rowId);//小PO 空
+                    //itemMap.put("cInvCode",rowId);//存货编码   必填
+                    if(itemMap.get("cInvCode") == null){
+                        throw new RuntimeException("cInvCode为空");
+                    }
+                    //itemMap.put("iQuantity",rowId);//数量   必填
+                    if(itemMap.get("iQuantity") == null){
+                        throw new RuntimeException("iQuantity为空");
+                    }
+                    Map<String,String> invInfo = subcontractingOrderMapper.selectUnitByCode(itemMap.get("cInvCode").toString());
+                    if(invInfo == null){
+                        throw new RuntimeException("未查询到该存货编码:"+itemMap.get("cInvCode"));
+                    }else{
+                        itemMap.put("unit",invInfo.get("cComUnitCode"));//单位    必填
+                    }
+
+                    //itemMap.put("cBatch",rowId);//批号  必填
+                    if(itemMap.get("cBatch") == null){
+                        throw new RuntimeException("cBatch为空");
+                    }
+                    //itemMap.put("color",rowId);//颜色   必填
+                    if(itemMap.get("color") == null){
+                        throw new RuntimeException("color为空");
+                    }
+                    itemMap.put("polishedBlank",rowId);//光坯毛门幅CM 验布机 要求门幅
+                    itemMap.put("gramWeight",rowId);//克重/工艺 验布机 克重
+                    itemMap.put("cDefine30",rowId);//染厂色号 验布机 色号
+                    itemMap.put("iordercode",map.get("cOrderCode"));//委外订单号    必填
+                    //itemMap.put("num",rowId);/件数   总卷数     必填
+                    //itemMap.put("cbMemo",rowId);/备注
+                    if(itemMap.get("num") == null){
+                        throw new RuntimeException("num为空");
+                    }
+                    subcontractingOrderMapper.saveRdrecords01One(itemMap);
+                }
+            }else{
+                throw new RuntimeException("item为空");
+            }
+
+        }
+
+        return "true";
+    }
+
+    /**
+     * 根据编码获取入库单数据
+     * @param code
+     * @return
+     */
+    @DS("multi-one")
+    public Map<String,Object> selectRdRecord01ByCode(String code) {
+        Map<String,Object> map = subcontractingOrderMapper.selectRdRecord01ByCode(code);
+        if(map != null && map.get("ID") != null){
+            List<Map<String,Object>> item = subcontractingOrderMapper.selectRdChildById(map.get("ID").toString());
+            map.put("item",item);
+        }
+        return map;
+    }
+
+    /**
+     * 审核入库单
+     * @param code
+     * @return
+     */
+    @DS("multi-one")
+    public int toExamine(String code,String cHandler){
+        return subcontractingOrderMapper.toExamine(code,cHandler);
+    }
+
+//    public Integer getMaxId(String id, String tableName) {
+//        Integer maxId=purchaseWarehousingMapper.getMaxId(id,tableName);
+//        if(maxId!=null){
+//            maxId=maxId+1;
+//        }else{
+//            maxId=0;
+//        }
+//        return maxId;
+//    }
+
+
+}

+ 43 - 4
jeecg-boot-module-system/src/main/java/org/jeecg/modules/quartz/job/AsyncJob.java

@@ -1,8 +1,18 @@
 package org.jeecg.modules.quartz.job;
 
+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.util.DateUtils;
+import org.jeecg.modules.openApi.controller.MOMainController;
+import org.jeecg.modules.openApi.controller.POPomainController;
+import org.jeecg.modules.openApi.entity.DxpDataPlan;
+import org.jeecg.modules.openApi.service.IDxpDataPlanService;
 import org.quartz.*;
+import org.springframework.beans.factory.annotation.Autowired;
+
+import java.util.List;
 
 /**
  * @Description: 同步定时任务测试
@@ -19,16 +29,45 @@ import org.quartz.*;
 @Slf4j
 public class AsyncJob implements Job {
 
+    @Autowired
+    private IDxpDataPlanService dxpDataPlanService;
+
     @Override
     public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
         log.info(" --- 同步任务调度开始 --- ");
         try {
-            //此处模拟任务执行时间 5秒  任务表达式配置为每秒执行一次:0/1 * * * * ? *
-            Thread.sleep(5000);
-        } catch (InterruptedException e) {
+
+            String time = DateUtils.now();
+
+            //委外订单
+            QueryWrapper<DxpDataPlan> queryWrapperMoMain = new QueryWrapper<>();
+            queryWrapperMoMain.eq("code", "senYu_moMain");
+            Page<DxpDataPlan> page = new Page<DxpDataPlan>(1, 100);
+            IPage<DxpDataPlan> pageList = dxpDataPlanService.page(page, queryWrapperMoMain);
+            List<DxpDataPlan> resultList = pageList.getRecords();
+            if(resultList.get(0).getIsauto() == 0){
+                MOMainController momain = new MOMainController();
+                momain.QueryMoMain(time);
+            }else{
+                System.out.println("委外订单接口未开启同步!");
+            }
+
+            //采购订单
+            QueryWrapper<DxpDataPlan> queryWrapperPoMain = new QueryWrapper<>();
+            queryWrapperPoMain.eq("code", "senYu_poMain");
+            Page<DxpDataPlan> pagePoMain = new Page<DxpDataPlan>(1, 100);
+            IPage<DxpDataPlan> pageListPoMain = dxpDataPlanService.page(pagePoMain, queryWrapperPoMain);
+            List<DxpDataPlan> resultListPoMain = pageListPoMain.getRecords();
+            if(resultListPoMain.get(0).getIsauto() == 0){
+                POPomainController momain = new POPomainController();
+                momain.QueryPoMain(time);
+            }else{
+                System.out.println("采购订单接口未开启同步!");
+            }
+        } catch (Exception e) {
             e.printStackTrace();
         }
-        //测试发现 每5秒执行一次
+
         log.info(" --- 执行完毕,时间:"+DateUtils.now()+"---");
     }
 

+ 41 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/report/entity/FabricLoss.java

@@ -0,0 +1,41 @@
+package org.jeecg.modules.report.entity;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.Date;
+
+//面料损耗实体
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+public class FabricLoss {
+    //计划单号
+    private String csoCode;
+    //款号
+    private String cDefine22;
+    //业务员
+    private  String cPersonName;
+    //计划员
+    private  String planner;
+    //排单数量
+    private String number;
+    //实际出库数量
+    private  String outboundNumber;
+    //制单人
+    private  String makingPeople;
+    //实际单件成本
+    private  String actualPrice;
+    //单件成本
+    private  String price;
+    //成衣合同号
+    private  String contractNo;
+    //查询日期
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    private Date dateTime;
+
+}

+ 42 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/report/mapper/FabricLossMapper.java

@@ -0,0 +1,42 @@
+package org.jeecg.modules.report.mapper;
+
+import com.baomidou.dynamic.datasource.annotation.DS;
+import com.baomidou.mybatisplus.core.conditions.Wrapper;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.Constants;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import org.apache.ibatis.annotations.Param;
+import org.jeecg.modules.report.entity.FabricLoss;
+import org.jeecg.modules.system.entity.SysUser;
+import org.jeecg.modules.system.model.SysUserSysDepartModel;
+import org.jeecg.modules.system.vo.SysUserDepVo;
+
+import java.util.List;
+
+/**
+ * <p>
+ *面料损耗表 Mapper 接口
+ * </p>
+ *
+ * @Author scott
+ * @since 2018-12-20
+ */
+public interface FabricLossMapper extends BaseMapper<FabricLoss> {
+
+	//获取面料损耗数据
+	@DS("multi-one")
+	FabricLoss getFabricLossData(@Param("code")String code);
+
+	//查询103委外制单人=计划员
+	List<String>getPlanner(@Param("code")String code);
+
+	//查询103的委外发票制单人=制单人
+	List<String>getMakingPeople(@Param("code")String code);
+
+	//查询103委外订单数量=排单量
+	String getNumber(@Param("code")String code);
+
+	//查询103委外订单 单价成本
+	String getPrice(@Param("code")String code);
+}

+ 52 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/report/mapper/xml/FabricLossMapper.xml

@@ -0,0 +1,52 @@
+<?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.report.mapper.FabricLossMapper">
+
+
+	<select id="getFabricLossData" resultType="org.jeecg.modules.report.entity.FabricLoss">
+		select distinct   a.csocode as 'csoCode',b.cdefine22 as 'cDefine22',c.cPersonName as 'cPersonName',d.iQuantity as 'number',e.iQuantity as 'outboundNumber',
+				f.dj as 'price',CONVERT(varchar,GETDATE(),120) as 'dateTime',a.csocode as 'csoCode',f.dj as 'actualPrice'
+		from SO_SOMain a left join SO_SODetails b on a.csocode=b.csocode
+						 left join Person c on a.cPersonCode=c.cPersonCode
+						 left join (select sum(a.iQuantity)as 'iQuantity' ,b.csocode  from OM_MODetails a left join SO_SODetails b on a.isosid =b.isosid																			  left join OM_MOMain c on a.moid=c.moid GROUP BY b.csocode) d on a.csocode=d.csocode
+						 left join (select sum(iQuantity) as 'iQuantity',csocode from rdrecords32  GROUP BY csocode) e on a.csocode=e.csocode
+						 left join (select (b.iProcessFee+b.iMaterialFee)/b.iQuantity as 'dj',b.csocode  from (
+							select sum(b.iMaterialFee) as 'iMaterialFee',sum(b.iProcessFee) as 'iProcessFee',sum(b.iQuantity) as 'iQuantity',bc.csocode  from rdrecord01 a left join rdrecords01 b on a.id=b.id
+							GROUP BY bc.csocode)  b  ) f on a.csocode=f.csocode
+		where 1=1
+		<if test="code!=null and ''!=code">
+			a.csocode=#{code}
+		</if>
+	</select>
+	<select id="getPlanner" resultType="java.lang.String">
+		select distinct c.cMaker   from OM_MODetails a
+		left join OM_MOMain c on a.moid=c.moid where 1=1
+		<if test="code!=null and ''!=code">
+			a.csocode=#{code}
+		</if>
+
+	</select>
+	<select id="getMakingPeople" resultType="java.lang.String">
+		select distinct cMaker from SaleBillVouch where 1=1
+		<if test="code!=null and ''!=code">
+			cSOCode=#{code}
+		</if>
+	</select>
+	<select id="getNumber" resultType="java.lang.String">
+		select sum(a.iQuantity)as 'iQuantity'  from OM_MODetails a left join SO_SODetails b on a.isosid =b.isosid
+																   left join OM_MOMain c on a.moid=c.moid where 1=1
+		<if test="code!=null and ''!=code">
+			b.csocode=#{code}
+		</if>
+	</select>
+	<select id="getPrice" resultType="java.lang.String">
+		select (b.iProcessFee+b.iMaterialFee)/b.iQuantity as 'dj'  from (
+		select sum(b.iMaterialFee) as 'iMaterialFee',sum(b.iProcessFee) as 'iProcessFee',sum(b.iQuantity) as 'iQuantity',bc.csocode  from rdrecord01 a left join rdrecords01 b on a.id=b.id
+		left join OM_MOMain c on c.moid=a.ipurorderid
+		left join  OM_MODetails bc on c.moid=bc.moid
+		GROUP BY bc.csocode)  b where 1=1
+		<if test="code!=null and ''!=code">
+			b.csocode=#{code}
+		</if>
+	</select>
+</mapper>

+ 36 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/report/service/IFabricLossService.java

@@ -0,0 +1,36 @@
+package org.jeecg.modules.report.service;
+
+import com.baomidou.dynamic.datasource.annotation.DS;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.IService;
+import org.apache.ibatis.annotations.Param;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.system.vo.SysUserCacheInfo;
+import org.jeecg.modules.report.entity.FabricLoss;
+import org.jeecg.modules.system.entity.SysUser;
+import org.jeecg.modules.system.model.SysUserSysDepartModel;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * <p>
+ * 面料损耗表 服务类
+ * </p>
+ *
+ * @Author scott
+ * @since 2018-12-20
+ */
+public interface IFabricLossService extends IService<FabricLoss> {
+	//获取面料损耗数据
+	FabricLoss getFabricLossData(String code);
+
+
+
+}

+ 76 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/report/service/impl/FabricLossServiceImpl.java

@@ -0,0 +1,76 @@
+package org.jeecg.modules.report.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import lombok.extern.slf4j.Slf4j;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.constant.CacheConstant;
+import org.jeecg.common.constant.CommonConstant;
+import org.jeecg.common.system.api.ISysBaseAPI;
+import org.jeecg.common.system.vo.LoginUser;
+import org.jeecg.common.system.vo.SysUserCacheInfo;
+import org.jeecg.common.util.PasswordUtil;
+import org.jeecg.common.util.UUIDGenerator;
+import org.jeecg.common.util.oConvertUtils;
+import org.jeecg.modules.base.service.BaseCommonService;
+import org.jeecg.modules.report.entity.FabricLoss;
+import org.jeecg.modules.report.mapper.FabricLossMapper;
+import org.jeecg.modules.report.service.IFabricLossService;
+import org.jeecg.modules.system.entity.*;
+import org.jeecg.modules.system.mapper.*;
+import org.jeecg.modules.system.model.SysUserSysDepartModel;
+import org.jeecg.modules.system.service.ISysUserService;
+import org.jeecg.modules.system.service.impl.ThirdAppDingtalkServiceImpl;
+import org.jeecg.modules.system.service.impl.ThirdAppWechatEnterpriseServiceImpl;
+import org.jeecg.modules.system.vo.SysUserDepVo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.cache.annotation.CacheEvict;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import javax.annotation.Resource;
+import java.util.*;
+import java.util.stream.Collectors;
+
+/**
+ * <p>
+ * 面料损耗表 服务实现类
+ * </p>
+ *
+ * @Author: scott
+ * @Date: 2018-12-20
+ */
+@Service
+@Slf4j
+public class FabricLossServiceImpl extends ServiceImpl<FabricLossMapper, FabricLoss> implements IFabricLossService {
+
+	@Autowired
+	private  FabricLossMapper fabricLossMapper;
+
+	/**
+	 * 面料损耗信息接口
+	 * @param code 计划号
+	 * @return
+	 */
+	@Override
+	public FabricLoss getFabricLossData(String code) {
+		if (oConvertUtils.isNotEmpty(code)){
+			FabricLoss fabricLoss = fabricLossMapper.getFabricLossData(code);
+			if (oConvertUtils.isNotEmpty(fabricLoss)){
+				//103排单数量
+				String number = fabricLossMapper.getNumber(code);
+				//制单人
+				List<String> makingPeople = fabricLossMapper.getMakingPeople(code);
+				//计划员
+				List<String> planner = fabricLossMapper.getPlanner(code);
+				//103单间成本
+				String price = fabricLossMapper.getPrice(code);
+
+			}
+		}
+		return null;
+	}
+}

+ 46 - 2
jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/util/InterfaceConnUtils.java

@@ -24,10 +24,10 @@ import java.util.Map;
 public class InterfaceConnUtils {
 
     /**
-     * post请求-推数据
+     * post请求-推数据,Token认证:Basic Auth
      * @throws Exception
      */
-    public static JSONObject doPost(JSONObject json, String url,String type) throws Exception {
+    public static JSONObject doPostToBasicAuth(JSONObject json, String url) throws Exception {
         //定义测试返回JSON
         JSONObject onejb = new JSONObject();
         HttpClient httpClient = new DefaultHttpClient();
@@ -60,5 +60,49 @@ public class InterfaceConnUtils {
         }
           return onejb;
     }
+    /**
+     * post请求-推数据,Token认证:Bearer Token
+     * @throws Exception
+     */
+    public static JSONObject doPostToBearer(JSONObject json, String url,String tokenIp,String type) throws Exception {
+        //定义返回JSON
+        JSONObject onejb = new JSONObject();
+        String token=null;
+        HttpClient httpClient = new DefaultHttpClient();
+        //获取token的Url
+        String tokenUrl=tokenIp;
+        try {
+            HttpPost hpGetToken=new HttpPost(tokenUrl);
+            //调用接口
+            HttpResponse response = httpClient.execute(hpGetToken);
+            //返回信息
+            String resultTokenStr = EntityUtils.toString(response.getEntity());
+            JSONObject tokenjb=JSONObject.parseObject(resultTokenStr);
+            token=tokenjb.getString("access_token");
+           // System.out.println("token:"+token);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        HttpPost httpPost=new HttpPost(url);
+        httpPost.setHeader("Content-Type", "application/json");
+        httpPost.setHeader("Authorization","Bearer " + token);
 
+        StringEntity entity;
+        entity = new StringEntity(json.toString(),"utf-8");
+        entity.setContentEncoding("utf-8");
+        entity.setContentType("application/json");
+        httpPost.setEntity(entity);
+        try {
+            //调用接口
+            HttpResponse response = httpClient.execute(httpPost);
+            //返回信息
+            String resultStr = EntityUtils.toString(response.getEntity());
+            onejb=JSONObject.parseObject(resultStr);
+            System.out.println(type+"返回信息:"+onejb);
+
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return onejb;
+    }
 }

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

@@ -1,26 +1,369 @@
 package org.jeecg.modules.system.util;
 
 import com.alibaba.fastjson.JSONObject;
+import com.fasterxml.jackson.core.io.JsonStringEncoder;
+import com.google.gson.Gson;
+import com.google.gson.GsonBuilder;
+import org.apache.commons.lang.StringEscapeUtils;
+import org.jeecg.modules.openApi.service.ISenYuDataSourceOne;
+import org.jeecg.modules.openApi.service.ISenYuDataSourceThree;
+import org.jeecg.modules.openApi.service.ISenYuDataSourceTwo;
+import org.jeecg.modules.openApi.service.impl.SenYuDataSourceOneServiceImpl;
+import org.springframework.beans.BeansException;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.ApplicationContext;
+import org.springframework.context.ApplicationContextAware;
 import org.springframework.stereotype.Component;
 
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
+import java.math.BigDecimal;
+import java.text.SimpleDateFormat;
+import java.util.*;
 
 /***
  * json转换类
  * 赵万发
  */
-public class JsonChangeUtils{
+@Component
+public class JsonChangeUtils implements ApplicationContextAware{
+
+    private static ISenYuDataSourceOne senYuDataSourceOne;
+
+    private static ISenYuDataSourceTwo senYuDataSourceTwo;
+
+    private static ISenYuDataSourceThree iSenYuDataSourceThree;
 
     /**
-     * 数据库查询返回集合转换为json对象集合
+     * 原始通用转JSON方法
+     * @param result
+     * @return
+     */
+    public static List<JSONObject> toJSONObject (List<Map<String, Object>> result){
+        List<JSONObject> pljf = new ArrayList<JSONObject>();// 表数据json集合
+        JSONObject jf = new JSONObject();
+        for (int i = 0; i < result.size(); i++) {
+            Map<String, Object> map = result.get(i);
+            Set<String> keys = map.keySet();
+            jf = new JSONObject();
+            for (String key : keys) {
+                if(null==map.get(key)){
+                    jf.put(key, "");
+                }else{
+                    jf.put(key, map.get(key));
+                }
+            }
+            pljf.add(jf);
+        }
+        return pljf;
+    }
+
+
+    /**
+     * 委外订单转JSON
+     * @param result
+     * @return
+     */
+    public static List<JSONObject> toMoMainJson(Map<String, Object> result) {
+        List<JSONObject> pljf = new ArrayList<JSONObject>();// 表数据json集合
+        SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd");
+        JSONObject jf = new JSONObject();
+       // for (int i = 0; i < result.size(); i++) {
+            Map<String, Object> map = result;//.get(i);
+            Set<String> keys = map.keySet();
+            jf = new JSONObject();
+            for (String key : keys) {
+                if(null==map.get(key)){
+                    jf.put(key, "");
+                }else{
+                    jf.put(key, map.get(key));
+
+                }
+            }
+            if(oConvertUtils.isNotEmpty(map.get("customerDemandDate"))){
+                String customerDemandDate = sf.format(map.get("customerDemandDate"));
+                jf.put("customerDemandDate",customerDemandDate+" 00:00:00");
+            }
+            if(oConvertUtils.isNotEmpty(map.get("publishDate"))){
+                String publishDate = sf.format(map.get("publishDate"));
+                jf.put("publishDate",publishDate+" 00:00:00");
+
+            }
+
+            //查询子表信息
+            if(map.get("pkorg").equals("one")){
+                BigDecimal totalAmount = BigDecimal.ZERO; //总金额
+                BigDecimal exTaxAmount = BigDecimal.ZERO;//总无税金额
+                String sql = "select mo.iVouchRowNo as 'poLineNum',mo.MODetailsID as MODetailsID,mo.MODetailsID as 'moDetailId','"+map.get("pkorg")+"' as pkorg," +
+                        "'' as receivingInventoryOrgCode,'"+map.get("moId")+"' as MOID,'"+map.get("accId")+"' as 'accId'," +
+                        "'"+map.get("poNum")+"' as poNum,mo.cInvCode as 'customerItemCode',inv.cInvName as 'itemName',mo.dArriveDate as 'customerDemandDate', " +
+                        "'' as 'poLineStatus',mo.cFree1 as cFree1,mo.cFree2 as cFree2,mo.cFree3 as cFree3,mo.cFree4 as cFree4," +
+                        "mo.cFree5 as cFree5,mo.cFree6 as cFree6,mo.cFree7 as cFree7,mo.cFree8 as cFree8,mo.cFree9 as cFree9,mo.cFree10 as cFree10,mo.iQuantity as 'customerDemandQty',mo.cUnitID as 'customerUomCode'," +
+                        "mo.iMoney as 'iMoney'," +
+                        "mo.iTax as lineAttributeDecimal1,mo.dbCloseDate as lineAttributeDatetime1,mo.cDefine24 as lineAttributeString9," +
+                        "mo.iTaxPrice as 'customerPrice',(mo.iPerTaxRate/100) as 'lineTaxRate',mo.iSum as 'amount',ex.cbdefine2 as lineAttributeString7,ex.cbdefine3 as lineAttributeString8," +
+                        "mo.cDefine28 as 'lineAttributeString1',mo.cDefine32 as 'lineAttributeString2',mo.cDefine29 as 'lineAttributeString3'," +
+                        "mo.cDefine30 as 'lineAttributeString4',mo.cbMemo as 'lineAttributeString5',mo.cDefine22 as lineAttributeString6,'' as lineAttributeString7,'' as lineAttributeString8," +
+                        "cFree1 as 'color','' as 'customerNumber',mo.iUnitPrice as supplierExTaxPrice,'"+map.get("dVerifyDate")+"' as lineAttributeDatetime2," +
+                        "'' as externalLineNum,'' as itemAttrId,'"+map.get("moId")+"' as poId  from OM_MODetails mo  " +
+                        "left join Inventory inv  on mo.cInvCode = inv.cInvCode "+
+                        "left join OM_MOdetails_extradefine ex on mo.MODetailsID = ex.MODetailsID "+
+                        " where mo.MOID = "+map.get("moId");
+                List<Map<String, Object>> list = senYuDataSourceOne.queryForList(sql);
+                for(Map<String, Object> mapList:list){
+                    totalAmount = totalAmount.add(new BigDecimal(mapList.get("amount").toString()));
+                    exTaxAmount = exTaxAmount.add(new BigDecimal(mapList.get("iMoney").toString()));
+                }
+                //子表转JSON
+                List<JSONObject> json = toMOListJson(list);
+                jf.put("poLineList",json);
+                jf.put("totalAmount",totalAmount);
+                jf.put("exTaxAmount",exTaxAmount);
+            }else if(map.get("pkorg").equals("two")){
+                BigDecimal totalAmount = BigDecimal.ZERO; //总金额
+                BigDecimal exTaxAmount = BigDecimal.ZERO;//总无税金额
+                String sql = "select mo.iVouchRowNo as 'poLineNum',mo.MODetailsID as MODetailsID,mo.MODetailsID as 'moDetailId','"+map.get("pkorg")+"' as pkorg," +
+                        "'' as receivingInventoryOrgCode,'"+map.get("moId")+"' as MOID,'"+map.get("accId")+"' as 'accId'," +
+                        "'"+map.get("poNum")+"' as poNum,mo.cInvCode as 'customerItemCode',inv.cInvName as 'itemName',mo.dArriveDate as 'customerDemandDate', " +
+                        "'' as 'poLineStatus',mo.cFree1 as cFree1,mo.cFree2 as cFree2,mo.cFree3 as cFree3,mo.cFree4 as cFree4," +
+                        "mo.cFree5 as cFree5,mo.cFree6 as cFree6,mo.cFree7 as cFree7,mo.cFree8 as cFree8,mo.cFree9 as cFree9,mo.cFree10 as cFree10,mo.iQuantity as 'customerDemandQty',mo.cUnitID as 'customerUomCode'," +
+                        "mo.iMoney as 'iMoney'," +
+                        "mo.iTax as lineAttributeDecimal1,mo.dbCloseDate as lineAttributeDatetime1,mo.cDefine24 as lineAttributeString9," +
+                        "mo.iTaxPrice as 'customerPrice',(mo.iPerTaxRate/100) as 'lineTaxRate',mo.iSum as 'amount',ex.cbdefine2 as lineAttributeString7,ex.cbdefine3 as lineAttributeString8," +
+                        "mo.cDefine28 as 'lineAttributeString1',mo.cDefine32 as 'lineAttributeString2',mo.cDefine29 as 'lineAttributeString3'," +
+                        "mo.cDefine30 as 'lineAttributeString4',mo.cbMemo as 'lineAttributeString5',mo.cDefine22 as lineAttributeString6,'' as lineAttributeString7,'' as lineAttributeString8," +
+                        "cFree1 as 'color','' as 'customerNumber',mo.iUnitPrice as supplierExTaxPrice,'"+map.get("dVerifyDate")+"' as lineAttributeDatetime2," +
+                        "'' as externalLineNum,'' as itemAttrId,'"+map.get("moId")+"' as poId  from OM_MODetails mo  " +
+                        "left join Inventory inv  on mo.cInvCode = inv.cInvCode "+
+                        "left join OM_MOdetails_extradefine ex on mo.MODetailsID = ex.MODetailsID "+
+                        " where mo.MOID = "+map.get("moId");
+                List<Map<String, Object>> list = senYuDataSourceTwo.queryForList(sql);
+                for(Map<String, Object> mapList:list){
+                    totalAmount = totalAmount.add(new BigDecimal(mapList.get("amount").toString()));
+                    exTaxAmount = exTaxAmount.add(new BigDecimal(mapList.get("iMoney").toString()));
+                }
+                //子表转JSON
+                List<JSONObject> json = toMOListJson(list);
+                jf.put("poLineList",json);
+                jf.put("totalAmount",totalAmount);
+                jf.put("exTaxAmount",exTaxAmount);
+            }else if(map.get("pkorg").equals("three")){
+                BigDecimal totalAmount = BigDecimal.ZERO; //总金额
+                BigDecimal exTaxAmount = BigDecimal.ZERO;//总无税金额
+                String sql = "select mo.iVouchRowNo as 'poLineNum',mo.MODetailsID as MODetailsID,mo.MODetailsID as 'moDetailId','"+map.get("pkorg")+"' as pkorg," +
+                        "'' as receivingInventoryOrgCode,'"+map.get("moId")+"' as MOID,'"+map.get("accId")+"' as 'accId'," +
+                        "'"+map.get("poNum")+"' as poNum,mo.cInvCode as 'customerItemCode',inv.cInvName as 'itemName',mo.dArriveDate as 'customerDemandDate', " +
+                        "'' as 'poLineStatus',mo.cFree1 as cFree1,mo.cFree2 as cFree2,mo.cFree3 as cFree3,mo.cFree4 as cFree4," +
+                        "mo.cFree5 as cFree5,mo.cFree6 as cFree6,mo.cFree7 as cFree7,mo.cFree8 as cFree8,mo.cFree9 as cFree9,mo.cFree10 as cFree10,mo.iQuantity as 'customerDemandQty',mo.cUnitID as 'customerUomCode'," +
+                        "mo.iMoney as 'iMoney'," +
+                        "mo.iTax as lineAttributeDecimal1,mo.dbCloseDate as lineAttributeDatetime1,mo.cDefine24 as lineAttributeString9," +
+                        "mo.iTaxPrice as 'customerPrice',(mo.iPerTaxRate/100) as 'lineTaxRate',mo.iSum as 'amount',ex.cbdefine2 as lineAttributeString7,ex.cbdefine3 as lineAttributeString8," +
+                        "mo.cDefine28 as 'lineAttributeString1',mo.cDefine32 as 'lineAttributeString2',mo.cDefine29 as 'lineAttributeString3'," +
+                        "mo.cDefine30 as 'lineAttributeString4',mo.cbMemo as 'lineAttributeString5',mo.cDefine22 as lineAttributeString6,'' as lineAttributeString7,'' as lineAttributeString8," +
+                        "cFree1 as 'color','' as 'customerNumber',mo.iUnitPrice as supplierExTaxPrice,'"+map.get("dVerifyDate")+"' as lineAttributeDatetime2," +
+                        "'' as externalLineNum,'' as itemAttrId,'"+map.get("moId")+"' as poId  from OM_MODetails mo  " +
+                        "left join Inventory inv  on mo.cInvCode = inv.cInvCode "+
+                        "left join OM_MOdetails_extradefine ex on mo.MODetailsID = ex.MODetailsID "+
+                        " where mo.MOID = "+map.get("moId");
+                List<Map<String, Object>> list = iSenYuDataSourceThree.queryForList(sql);
+                for(Map<String, Object> mapList:list){
+                    totalAmount = totalAmount.add(new BigDecimal(mapList.get("amount").toString()));
+                    exTaxAmount = exTaxAmount.add(new BigDecimal(mapList.get("iMoney").toString()));
+                }
+                //子表转JSON
+                List<JSONObject> json = toMOListJson(list);
+                jf.put("poLineList",json);
+                jf.put("totalAmount",totalAmount);
+                jf.put("exTaxAmount",exTaxAmount);
+            }
+
+
+                jf.remove("MODetailsID");
+                jf.remove("MOID");
+                jf.remove("pkorg");
+                jf.remove("dVerifyDate");
+                pljf.add(jf);
+
+        return pljf;
+    }
+
+    /**
+     * 普通采购订单转JSON
+     * @param result
+     * @return
+     */
+    public static List<JSONObject> toPoMainJson(Map<String, Object> result) {
+        List<JSONObject> pljf = new ArrayList<JSONObject>();// 表数据json集合
+        SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd");
+
+        JSONObject jf = new JSONObject();
+        //for (int i = 0; i < result.size(); i++) {
+            Map<String, Object> map = result;//.get(i);
+            Set<String> keys = map.keySet();
+            jf = new JSONObject();
+            for (String key : keys) {
+                if(null==map.get(key)){
+                    jf.put(key, "");
+                }else{
+                    jf.put(key, map.get(key));
+                }
+            }
+            if(oConvertUtils.isNotEmpty(map.get("customerDemandDate"))){
+                String customerDemandDate = sf.format(map.get("customerDemandDate"));
+                jf.put("customerDemandDate",customerDemandDate+" 00:00:00");
+            }
+            if(oConvertUtils.isNotEmpty(map.get("publishDate"))){
+                String publishDate = sf.format(map.get("publishDate"));
+                jf.put("publishDate",publishDate+" 00:00:00");
+
+            }
+//            String cAuditDate = sf.format(map.get("cAuditDate"));
+//            jf.put("cAuditDate",cAuditDate+" 00:00:00");
+            //查询子表信息
+            if(map.get("pkorg").equals("one")){
+                BigDecimal totalAmount = BigDecimal.ZERO; //总金额
+                BigDecimal exTaxAmount = BigDecimal.ZERO;//总无税金额
+
+                String sql ="select '"+map.get("accId")+"' as 'accId',mo.iVouchRowNo as 'poLineNum',mo.ID as 'moDetailId','"+map.get("poNum")+"' as poNum," +
+                        "mo.cInvCode as 'customerItemCode',inv.cInvName as 'itemName','' as 'poLineStatus',mo.dArriveDate as 'customerDemandDate'," +
+                        "'' as receivingInventoryOrgCode,mo.cFree1 as cFree1,mo.cFree2 as cFree2,mo.cFree3 as cFree3,mo.cFree4 as cFree4," +
+                        "mo.cFree5 as cFree5,mo.cFree6 as cFree6,mo.cFree7 as cFree7,mo.cFree8 as cFree8,mo.cFree9 as cFree9,mo.cFree10 as cFree10,mo.iQuantity as 'customerDemandQty',mo.cUnitID as 'customerUomCode'," +
+                        "mo.iMoney as 'iMoney',mo.iUnitPrice as supplierExTaxPrice,'"+map.get("cAuditDate")+"' as lineAttributeDatetime2," +
+                        "mo.iTax as lineAttributeDecimal1,mo.cbCloseDate as lineAttributeDatetime1,mo.cDefine24 as lineAttributeString9,ex.cbdefine2 as lineAttributeString7,ex.cbdefine3 as lineAttributeString8," +
+                        "mo.iTaxPrice as 'customerPrice',(mo.iPerTaxRate/100) as 'lineTaxRate',mo.iSum as 'amount',mo.cDefine28 as 'lineAttributeString1'," +
+                        "mo.cDefine32 as 'lineAttributeString2',mo.cDefine29 as 'lineAttributeString3','' as 'attributeString1',mo.cDefine30 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 " +
+                        "left join PO_Podetails_extradefine ex on mo.ID = ex.ID"+
+                        " where mo.POID = '"+map.get("moId")+"'";
+                List<Map<String, Object>> list = senYuDataSourceOne.queryForList(sql);
+                for(Map<String, Object> mapList:list){
+                    totalAmount = totalAmount.add(new BigDecimal(mapList.get("amount").toString()));
+                    exTaxAmount = exTaxAmount.add(new BigDecimal(mapList.get("iMoney").toString()));
+                }
+                //子表转JSON
+                List<JSONObject> json = toListJson(list);
+                jf.put("poLineList",json);
+                jf.put("totalAmount",totalAmount);
+                jf.put("exTaxAmount",exTaxAmount);
+            }
+            else if(map.get("pkorg").equals("two")){
+                BigDecimal totalAmount = BigDecimal.ZERO; //总金额
+                BigDecimal exTaxAmount = BigDecimal.ZERO;//总无税金额
+                String sql ="select '"+map.get("accId")+"' as 'accId',mo.iVouchRowNo as 'poLineNum',mo.ID as 'moDetailId','"+map.get("poNum")+"' as poNum," +
+                        "mo.cInvCode as 'customerItemCode',inv.cInvName as 'itemName','' as 'poLineStatus',mo.dArriveDate as 'customerDemandDate'," +
+                        "'' as receivingInventoryOrgCode,mo.cFree1 as cFree1,mo.cFree2 as cFree2,mo.cFree3 as cFree3,mo.cFree4 as cFree4," +
+                        "mo.cFree5 as cFree5,mo.cFree6 as cFree6,mo.cFree7 as cFree7,mo.cFree8 as cFree8,mo.cFree9 as cFree9,mo.cFree10 as cFree10,mo.iQuantity as 'customerDemandQty',mo.cUnitID as 'customerUomCode'," +
+                        "mo.iMoney as 'iMoney',mo.iUnitPrice as supplierExTaxPrice,'"+map.get("cAuditDate")+"' as lineAttributeDatetime2," +
+                        "mo.iTax as lineAttributeDecimal1,mo.cbCloseDate as lineAttributeDatetime1,mo.cDefine24 as lineAttributeString9,ex.cbdefine2 as lineAttributeString7,ex.cbdefine3 as lineAttributeString8," +
+                        "mo.iTaxPrice as 'customerPrice',(mo.iPerTaxRate/100) as 'lineTaxRate',mo.iSum as 'amount',mo.cDefine28 as 'lineAttributeString1'," +
+                        "mo.cDefine32 as 'lineAttributeString2',mo.cDefine29 as 'lineAttributeString3','' as 'attributeString1',mo.cDefine30 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 " +
+                        "left join PO_Podetails_extradefine ex on mo.ID = ex.ID"+
+                        " where mo.POID = '"+map.get("moId")+"'";
+                List<Map<String, Object>> list = senYuDataSourceTwo.queryForList(sql);
+                for(Map<String, Object> mapList:list){
+                    totalAmount = totalAmount.add(new BigDecimal(mapList.get("amount").toString()));
+                    exTaxAmount = exTaxAmount.add(new BigDecimal(mapList.get("iMoney").toString()));
+                }
+                //子表转JSON
+                List<JSONObject> json = toListJson(list);
+                jf.put("poLineList",json);
+                jf.put("totalAmount",totalAmount);
+                jf.put("exTaxAmount",exTaxAmount);
+            }else if(map.get("pkorg").equals("three")){
+                BigDecimal totalAmount = BigDecimal.ZERO; //总金额
+                BigDecimal exTaxAmount = BigDecimal.ZERO;//总无税金额
+                String sql ="select '"+map.get("accId")+"' as 'accId',mo.iVouchRowNo as 'poLineNum',mo.ID as 'moDetailId','"+map.get("poNum")+"' as poNum," +
+                        "mo.cInvCode as 'customerItemCode',inv.cInvName as 'itemName','' as 'poLineStatus',mo.dArriveDate as 'customerDemandDate'," +
+                        "'' as receivingInventoryOrgCode,mo.cFree1 as cFree1,mo.cFree2 as cFree2,mo.cFree3 as cFree3,mo.cFree4 as cFree4," +
+                        "mo.cFree5 as cFree5,mo.cFree6 as cFree6,mo.cFree7 as cFree7,mo.cFree8 as cFree8,mo.cFree9 as cFree9,mo.cFree10 as cFree10,mo.iQuantity as 'customerDemandQty',mo.cUnitID as 'customerUomCode'," +
+                        "mo.iMoney as 'iMoney',mo.iUnitPrice as supplierExTaxPrice,'"+map.get("cAuditDate")+"' as lineAttributeDatetime2," +
+                        "mo.iTax as lineAttributeDecimal1,mo.cbCloseDate as lineAttributeDatetime1,mo.cDefine24 as lineAttributeString9,ex.cbdefine2 as lineAttributeString7,ex.cbdefine3 as lineAttributeString8," +
+                        "mo.iTaxPrice as 'customerPrice',(mo.iPerTaxRate/100) as 'lineTaxRate',mo.iSum as 'amount',mo.cDefine28 as 'lineAttributeString1'," +
+                        "mo.cDefine32 as 'lineAttributeString2',mo.cDefine29 as 'lineAttributeString3','' as 'attributeString1',mo.cDefine30 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 " +
+                        "left join PO_Podetails_extradefine ex on mo.ID = ex.ID "+
+                        " where mo.POID = '"+map.get("moId")+"'";
+                List<Map<String, Object>> list = iSenYuDataSourceThree.queryForList(sql);
+                for(Map<String, Object> mapList:list){
+                    totalAmount = totalAmount.add(new BigDecimal(mapList.get("amount").toString()));
+                    exTaxAmount = exTaxAmount.add(new BigDecimal(mapList.get("iMoney").toString()));
+                }
+                //子表转JSON
+                List<JSONObject> json = toListJson(list);
+                jf.put("poLineList",json);
+                jf.put("totalAmount",totalAmount);
+                jf.put("exTaxAmount",exTaxAmount);
+            }
+
+            jf.remove("pkorg");
+            jf.remove("cAuditDate");
+
+            pljf.add(jf);
+        //}
+        return pljf;
+    }
+
+
+    /**
+     * 材料出库单转JSON
+     * @param result
+     * @return
+     */
+    public static List<JSONObject> toRdrecordJson(List<Map<String, Object>> result) {
+        List<JSONObject> pljf = new ArrayList<JSONObject>();// 表数据json集合
+        SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd");
+        JSONObject jf = new JSONObject();
+        for (int i = 0; i < result.size(); i++) {
+            Map<String, Object> map = result.get(i);
+            Set<String> keys = map.keySet();
+            jf = new JSONObject();
+            for (String key : keys) {
+                if(null==map.get(key)){
+                    jf.put(key, "");
+                }else{
+                    jf.put(key, map.get(key));
+                }
+            }
+            if(oConvertUtils.isNotEmpty(map.get("customerDemandDate"))){
+                String customerDemandDate = sf.format(map.get("customerDemandDate"));
+                jf.put("customerDemandDate",customerDemandDate+" 00:00:00");
+            }
+            if(oConvertUtils.isNotEmpty(map.get("publishDate"))){
+                String publishDate = sf.format(map.get("publishDate"));
+                jf.put("publishDate",publishDate+" 00:00:00");
+
+            }
+            //查询子表信息
+            if(map.get("accId").equals("903")){
+                String sql = "select '903' as cAccId,'' as '发货单号',AutoID as '发货单行ID',ID as '发货单ID', irowno as '发货单行号'," +
+                        "'' as '发货单行状态',cInVoucherType as '发货单来源类型','' as '来源单据ID','' as '来源单据编号'," +
+                        "'' as '来源单据行ID',cInvCode as '供应商物料编码',cBVencode as '供应商单位ID','' as '单位'," +
+                        "iQuantity as '采购数量',iSOutQuantity as '出库数量',cBatch as '批号' from rdrecords11 " +
+                        "where ID = '"+map.get("ID")+"'";
+
+                List<Map<String, Object>> list = senYuDataSourceOne.queryForList(sql);
+                //子表转JSON
+                List<JSONObject> json = toListJson(list);
+                jf.put("poLineList",json);
+            }
+
+            pljf.add(jf);
+        }
+        return pljf;
+    }
+
+    /**
+     * 采购订单子表转json集合
      * @param result
      * @return
      */
     public static List<JSONObject> toListJson(List<Map<String, Object>> result) {
         List<JSONObject> pljf = new ArrayList<JSONObject>();// 表数据json集合
+        Map<String, Object> mapCfree = new HashMap<>();//处理物料属性
+        int ii = 1;
+        SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd");
         JSONObject jf = new JSONObject();
         for (int i = 0; i < result.size(); i++) {
             Map<String, Object> map = result.get(i);
@@ -30,11 +373,187 @@ public class JsonChangeUtils{
                 if(null==map.get(key)){
                     jf.put(key, "");
                 }else{
+                    if(key.equals("cFree1")&&oConvertUtils.isNotEmpty(map.get(key))){
+                        mapCfree.put(key,map.get(key));
+                    }else if(key.equals("cFree2")&&oConvertUtils.isNotEmpty(map.get(key))){
+                        mapCfree.put(key,map.get(key));
+                    }else if(key.equals("cFree3")&&oConvertUtils.isNotEmpty(map.get(key))){
+                        mapCfree.put(key,map.get(key));
+                    }else if(key.equals("cFree4")&&oConvertUtils.isNotEmpty(map.get(key))){
+                        mapCfree.put(key,map.get(key));
+                    }else if(key.equals("cFree5")&&oConvertUtils.isNotEmpty(map.get(key))){
+                        mapCfree.put(key,map.get(key));
+                    }else if(key.equals("cFree6")&&oConvertUtils.isNotEmpty(map.get(key))){
+                        mapCfree.put(key,map.get(key));
+                    }else if(key.equals("cFree7")&&oConvertUtils.isNotEmpty(map.get(key))){
+                        mapCfree.put(key,map.get(key));
+                    }else if(key.equals("cFree8")&&oConvertUtils.isNotEmpty(map.get(key))){
+                        mapCfree.put(key,map.get(key));
+                    }else if(key.equals("cFree9")&&oConvertUtils.isNotEmpty(map.get(key))){
+                        mapCfree.put(key,map.get(key));
+                    }else if(key.equals("cFree10")&&oConvertUtils.isNotEmpty(map.get(key))){
+                        mapCfree.put(key,map.get(key));
+                    }
                     jf.put(key, map.get(key));
                 }
             }
+            if(oConvertUtils.isNotEmpty(map.get("customerDemandDate"))){
+                String customerDemandDate = sf.format(map.get("customerDemandDate"));
+                jf.put("customerDemandDate",customerDemandDate+" 00:00:00");
+            }
+
+            if(oConvertUtils.isNotEmpty(map.get("lineAttributeDatetime1"))){
+                String lineAttributeDatetime1 = sf.format(map.get("lineAttributeDatetime1"));
+                jf.put("lineAttributeDatetime1",lineAttributeDatetime1+" 00:00:00");
+            }
+
+            Set<String> keysCfree = mapCfree.keySet();
+            for (String key : keysCfree) {
+                jf.put("attributeCode"+ii, key);
+                jf.put("attributeValue"+ii, map.get(key));
+                ii++;
+            }
+            ii = 1;
+            jf.remove("iMoney");
+            jf.remove("cFree1");
+            jf.remove("cFree2");
+            jf.remove("cFree3");
+            jf.remove("cFree4");
+            jf.remove("cFree5");
+            jf.remove("cFree6");
+            jf.remove("cFree7");
+            jf.remove("cFree8");
+            jf.remove("cFree9");
+            jf.remove("cFree10");
             pljf.add(jf);
         }
         return pljf;
     }
+
+    /**
+     * 委外专用JSON
+     * @param result
+     * @return
+     */
+    public static List<JSONObject> toMOListJson(List<Map<String, Object>> result) {
+        List<JSONObject> pljf = new ArrayList<JSONObject>();// 表数据json集合
+        Map<String, Object> mapCfree = new HashMap<>();//处理物料属性
+        int ii = 1;
+        SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd");
+        JSONObject jf = new JSONObject();
+        for (int i = 0; i < result.size(); i++) {
+            Map<String, Object> map = result.get(i);
+            Set<String> keys = map.keySet();
+            jf = new JSONObject();
+            for (String key : keys) {
+                if(null==map.get(key)){
+                    jf.put(key, "");
+                }else{
+                    if(key.equals("cFree1")&&oConvertUtils.isNotEmpty(map.get(key))){
+                        mapCfree.put(key,map.get(key));
+                    }else if(key.equals("cFree2")&&oConvertUtils.isNotEmpty(map.get(key))){
+                        mapCfree.put(key,map.get(key));
+                    }else if(key.equals("cFree3")&&oConvertUtils.isNotEmpty(map.get(key))){
+                        mapCfree.put(key,map.get(key));
+                    }else if(key.equals("cFree4")&&oConvertUtils.isNotEmpty(map.get(key))){
+                        mapCfree.put(key,map.get(key));
+                    }else if(key.equals("cFree5")&&oConvertUtils.isNotEmpty(map.get(key))){
+                        mapCfree.put(key,map.get(key));
+                    }else if(key.equals("cFree6")&&oConvertUtils.isNotEmpty(map.get(key))){
+                        mapCfree.put(key,map.get(key));
+                    }else if(key.equals("cFree7")&&oConvertUtils.isNotEmpty(map.get(key))){
+                        mapCfree.put(key,map.get(key));
+                    }else if(key.equals("cFree8")&&oConvertUtils.isNotEmpty(map.get(key))){
+                        mapCfree.put(key,map.get(key));
+                    }else if(key.equals("cFree9")&&oConvertUtils.isNotEmpty(map.get(key))){
+                        mapCfree.put(key,map.get(key));
+                    }else if(key.equals("cFree10")&&oConvertUtils.isNotEmpty(map.get(key))){
+                        mapCfree.put(key,map.get(key));
+                    }
+                    jf.put(key, map.get(key));
+                }
+            }
+            if(oConvertUtils.isNotEmpty(map.get("customerDemandDate"))){
+                String customerDemandDate = sf.format(map.get("customerDemandDate"));
+                jf.put("customerDemandDate",customerDemandDate+" 00:00:00");
+            }
+            if(oConvertUtils.isNotEmpty(map.get("lineAttributeDatetime1"))){
+                String lineAttributeDatetime1 = sf.format(map.get("lineAttributeDatetime1"));
+                jf.put("lineAttributeDatetime1",lineAttributeDatetime1+" 00:00:00");
+            }
+            //查询委外用料子表数据
+            if(map.get("pkorg").equals("one")){
+
+                String sql1 = "select '"+map.get("accId")+"' as accId,'"+map.get("MOID")+"' as poId,'"+map.get("poNum")+"' as poNum," +
+                        "mo.cInvCode as 'customerItemCode','' as 'itemAttrId','' as customerItemId," +
+                        "mo.cFree1 as cFree1,mo.cFree2 as cFree2,mo.cFree3 as cFree3,mo.cFree4 as cFree4," +
+                        "mo.cFree5 as cFree5,mo.cFree6 as cFree6,mo.cFree7 as cFree7,mo.cFree8 as cFree8,mo.cFree9 as cFree9,mo.cFree10 as cFree10," +
+                        "'' as poOutsourceId,''as poOutsourceNum,'' as 'customerUomId','' as customerUomCode,0 as customerPromiseQty, " +
+                        "mo.cDefine25 as outsourceAttributeString1,mo.cDefine24 as 'outsourceAttributeString2',mo.cDefine27 as 'outsourceAttributeString3'" +
+                        " from OM_MOMaterials mo where MODetailsID  = '"+map.get("MODetailsID")+"'";
+                List<Map<String, Object>> list = senYuDataSourceOne.queryForList(sql1);
+                //子表转JSON
+                List<JSONObject> json = toListJson(list);
+                jf.put("outSourceList",json);
+            }else if(map.get("pkorg").equals("two")){
+
+                String sql1 = "select '"+map.get("accId")+"' as accId,'"+map.get("MOID")+"' as poId,'"+map.get("poNum")+"' as poNum," +
+                        "mo.cInvCode as 'customerItemCode','' as 'itemAttrId','' as customerItemId," +
+                        "mo.cFree1 as cFree1,mo.cFree2 as cFree2,mo.cFree3 as cFree3,mo.cFree4 as cFree4," +
+                        "mo.cFree5 as cFree5,mo.cFree6 as cFree6,mo.cFree7 as cFree7,mo.cFree8 as cFree8,mo.cFree9 as cFree9,mo.cFree10 as cFree10," +
+                        "'' as poOutsourceId,''as poOutsourceNum,'' as 'customerUomId','' as customerUomCode,0 as customerPromiseQty, " +
+                        "mo.cDefine25 as outsourceAttributeString1,mo.cDefine24 as 'outsourceAttributeString2',mo.cDefine27 as 'outsourceAttributeString3'" +
+                        " from OM_MOMaterials mo where MODetailsID  = '"+map.get("MODetailsID")+"'";
+                List<Map<String, Object>> list = senYuDataSourceTwo.queryForList(sql1);
+                //子表转JSON
+                List<JSONObject> json = toListJson(list);
+                jf.put("outSourceList",json);
+            }else if(map.get("pkorg").equals("three")){
+
+                String sql1 = "select '"+map.get("accId")+"' as accId,'"+map.get("MOID")+"' as poId,'"+map.get("poNum")+"' as poNum," +
+                        "mo.cInvCode as 'customerItemCode','' as 'itemAttrId','' as customerItemId," +
+                        "mo.cFree1 as cFree1,mo.cFree2 as cFree2,mo.cFree3 as cFree3,mo.cFree4 as cFree4," +
+                        "mo.cFree5 as cFree5,mo.cFree6 as cFree6,mo.cFree7 as cFree7,mo.cFree8 as cFree8,mo.cFree9 as cFree9,mo.cFree10 as cFree10," +
+                        "'' as poOutsourceId,''as poOutsourceNum,'' as 'customerUomId','' as customerUomCode,0 as customerPromiseQty, " +
+                        "mo.cDefine25 as outsourceAttributeString1,mo.cDefine24 as 'outsourceAttributeString2',mo.cDefine27 as 'outsourceAttributeString3'" +
+                        " from OM_MOMaterials mo where MODetailsID  = '"+map.get("MODetailsID")+"'";
+                List<Map<String, Object>> list = iSenYuDataSourceThree.queryForList(sql1);
+                //子表转JSON
+                List<JSONObject> json = toListJson(list);
+                jf.put("outSourceList",json);
+            }
+            Set<String> keysCfree = mapCfree.keySet();
+            for (String key : keysCfree) {
+                jf.put("attributeCode"+ii, key);
+                jf.put("attributeValue"+ii, map.get(key));
+                ii++;
+            }
+            ii = 1;
+            jf.remove("cFree1");
+            jf.remove("cFree2");
+            jf.remove("cFree3");
+            jf.remove("cFree4");
+            jf.remove("cFree5");
+            jf.remove("cFree6");
+            jf.remove("cFree7");
+            jf.remove("cFree8");
+            jf.remove("cFree9");
+            jf.remove("cFree10");
+                jf.remove("MODetailsID");
+                jf.remove("MOID");
+                jf.remove("pkorg");
+                jf.remove("iMoney");
+                pljf.add(jf);
+        }
+        return pljf;
+    }
+
+
+    @Override
+    public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
+
+        this.senYuDataSourceOne = applicationContext.getBean(ISenYuDataSourceOne.class);
+        this.senYuDataSourceTwo = applicationContext.getBean(ISenYuDataSourceTwo.class);
+        this.iSenYuDataSourceThree = applicationContext.getBean(ISenYuDataSourceThree.class);
+    }
 }

+ 45 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/util/oConvertUtils.java

@@ -1,13 +1,21 @@
 package org.jeecg.modules.system.util;
 
+import com.google.zxing.BarcodeFormat;
+import com.google.zxing.WriterException;
+import com.google.zxing.client.j2se.MatrixToImageWriter;
+import com.google.zxing.common.BitMatrix;
+import com.google.zxing.qrcode.QRCodeWriter;
 import org.apache.shiro.SecurityUtils;
 import org.jeecg.modules.system.entity.SysUser;
 
 import javax.servlet.http.HttpServletRequest;
+import java.io.IOException;
 import java.io.UnsupportedEncodingException;
 import java.math.BigDecimal;
 import java.math.BigInteger;
 import java.net.*;
+import java.nio.file.FileSystems;
+import java.nio.file.Path;
 import java.sql.Date;
 import java.text.SimpleDateFormat;
 import java.util.*;
@@ -580,7 +588,6 @@ public class oConvertUtils {
 
 	}
     /**
-
      * 字符串+1方法,该方法将其结尾的整数+1,适用于任何以整数结尾的字符串,不限格式,不限分隔符。
      * @author 隔壁老赵
      * @param testStr 要+1的字符串
@@ -601,6 +608,23 @@ public class oConvertUtils {
             throw new NumberFormatException();
         }
     }
+
+	/**
+	 * 获取流水号最大值去除单号中的前缀0
+	 * @param testStr
+	 * @return
+	 */
+	public static String maxNumber(String testStr){
+		String[] strs = testStr.split("[^0-9]");//根据不是数字的字符拆分字符串
+		String numStr = strs[strs.length - 1];//取出最后一组数字
+		if (numStr != null && numStr.length() > 0) {//如果最后一组没有数字(也就是不以数字结尾),抛NumberFormatException异常
+			int i = Integer.valueOf(testStr);
+			return String.valueOf(i);
+		}else {
+			throw new NumberFormatException();
+		}
+	}
+
     public static String getId(){
         //生成主键:12位时间+8位随机数字
         StringBuffer b=new StringBuffer();
@@ -614,4 +638,24 @@ public class oConvertUtils {
         }
         return b.toString();
     }
+
+    /***
+     * 字段信息生成二维码图片
+     * @param text
+     * @param width
+     * @param height
+     * @param filePath
+     * @throws WriterException
+     * @throws IOException
+     */
+    public static void generateQRCodeImage(String text, int width, int height, String filePath) throws WriterException, IOException {
+        QRCodeWriter qrCodeWriter = new QRCodeWriter();
+
+        BitMatrix bitMatrix = qrCodeWriter.encode(text, BarcodeFormat.QR_CODE, width, height);
+
+        Path path = FileSystems.getDefault().getPath(filePath);
+
+        MatrixToImageWriter.writeToPath(bitMatrix, "PNG", path);
+
+    }
 }

+ 35 - 9
jeecg-boot-module-system/src/main/resources/application-prod.yml

@@ -1,5 +1,5 @@
 server:
-  port: 8090
+  port: 8001
   tomcat:
     max-swallow-size: -1
   error:
@@ -118,7 +118,7 @@ spring:
         timeBetweenEvictionRunsMillis: 60000
         # 配置一个连接在池中最小生存的时间,单位是毫秒
         minEvictableIdleTimeMillis: 300000
-        validationQuery: SELECT 1 FROM DUAL
+#        validationQuery: SELECT 1 FROM DUAL
         testWhileIdle: true
         testOnBorrow: false
         testOnReturn: false
@@ -131,16 +131,42 @@ spring:
         connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000
       datasource:
         master:
-          url: jdbc:mysql://127.0.0.1:3306/sen_yu_dz_dev?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
+          url: jdbc:mysql://106.15.206.14:3306/sen_yu_dz_dev?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
           username: root
-          password: CuiDian1234
+          password: root
           driver-class-name: com.mysql.cj.jdbc.Driver
           # 多数据源配置
-          #multi-datasource1:
-          #url: jdbc:mysql://localhost:3306/jeecg-boot2?useUnicode=true&characterEncoding=utf8&autoReconnect=true&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
-          #username: root
-          #password: root
-          #driver-class-name: com.mysql.cj.jdbc.Driver
+        multi-one:
+          url: jdbc:sqlserver://192.168.1.253;DatabaseName=UFDATA_901_2021
+          username: sa
+          password: Windows2008R2
+          driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
+        multi-two:
+          url: jdbc:sqlserver://192.168.1.253;DatabaseName=UFDATA_902_2021
+          username: sa
+          password: Windows2008R2
+          driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
+        multi-three:
+          url: jdbc:sqlserver://192.168.1.253;DatabaseName=UFDATA_903_2021
+          username: sa
+          password: Windows2008R2
+          driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
+#        multi-one:
+#          url: jdbc:sqlserver://192.168.1.18;DatabaseName=UFDATA_101_2021
+#          username: sa
+#          password: Windows2008R2
+#          driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
+#        multi-two:
+#          url: jdbc:sqlserver://192.168.1.18;DatabaseName=UFDATA_102_2021
+#          username: sa
+#          password: Windows2008R2
+#          driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
+#        multi-three:
+#          url: jdbc:sqlserver://192.168.1.18;DatabaseName=UFDATA_103_2021
+#          username: sa
+#          password: Windows2008R2
+#          driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
+
   #redis 配置
   redis:
     database: 0

+ 3 - 3
jeecg-boot-module-system/src/main/resources/jeecg/jeecg_database.properties

@@ -1,9 +1,9 @@
 #mysql
 diver_name=com.mysql.jdbc.Driver
-url=jdbc:mysql://localhost:3306/sen_yu_dz_dev?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
+url=jdbc:mysql://106.15.206.14:3306/sen_yu_dz_dev?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
 username=root
-password=root
-database_name=jeecg-boot
+password=CuiDian1234
+database_name=sen_yu_dz_dev
 
 #oracle
 #diver_name=oracle.jdbc.driver.OracleDriver

+ 11 - 0
pom.xml

@@ -291,6 +291,17 @@
 					</exclusion>
 				</exclusions>
 			</dependency>
+            <!-- 二维码工具类 -->
+            <dependency>
+                <groupId>com.google.zxing</groupId>
+                <artifactId>core</artifactId>
+                <version>3.2.0</version>
+            </dependency>
+            <dependency>
+                <groupId>com.google.zxing</groupId>
+                <artifactId>javase</artifactId>
+                <version>3.2.0</version>
+            </dependency>
 		</dependencies>
 	</dependencyManagement>