523096025 2 months ago
parent
commit
ce402ac2df
19 changed files with 1165 additions and 90 deletions
  1. 5 0
      get-data/src/main/java/com/huimv/getdata/controller/ErpXiaoShouController.java
  2. 41 0
      get-data/src/main/java/com/huimv/getdata/entity/ErpBdMaterial.java
  3. 0 3
      huimv-farm/src/main/java/vip/xiaonuo/money/controller/MoneyCostController.java
  4. 198 0
      huimv-farm/src/main/java/vip/xiaonuo/sale/controller/ErpBaseMaterialController.java
  5. 102 0
      huimv-farm/src/main/java/vip/xiaonuo/sale/entity/ErpBaseMaterial.java
  6. 34 0
      huimv-farm/src/main/java/vip/xiaonuo/sale/enums/ErpBaseMaterialEnum.java
  7. 25 0
      huimv-farm/src/main/java/vip/xiaonuo/sale/mapper/ErpBaseMaterialMapper.java
  8. 5 0
      huimv-farm/src/main/java/vip/xiaonuo/sale/mapper/mapping/ErpBaseMaterialMapper.xml
  9. 70 0
      huimv-farm/src/main/java/vip/xiaonuo/sale/param/ErpBaseMaterialAddParam.java
  10. 73 0
      huimv-farm/src/main/java/vip/xiaonuo/sale/param/ErpBaseMaterialEditParam.java
  11. 72 0
      huimv-farm/src/main/java/vip/xiaonuo/sale/param/ErpBaseMaterialEditTreeParam.java
  12. 35 0
      huimv-farm/src/main/java/vip/xiaonuo/sale/param/ErpBaseMaterialIdParam.java
  13. 51 0
      huimv-farm/src/main/java/vip/xiaonuo/sale/param/ErpBaseMaterialPageParam.java
  14. 83 0
      huimv-farm/src/main/java/vip/xiaonuo/sale/service/ErpBaseMaterialService.java
  15. 142 0
      huimv-farm/src/main/java/vip/xiaonuo/sale/service/impl/ErpBaseMaterialServiceImpl.java
  16. 2 2
      huimv-farm/src/test/java/vip/xiaonuo/CaiWuTest.java
  17. 81 78
      huimv-farm/src/test/java/vip/xiaonuo/KuCunTest.java
  18. 105 0
      huimv-farm/src/test/java/vip/xiaonuo/SengChanTest.java
  19. 41 7
      huimv-farm/src/test/java/vip/xiaonuo/XiaoShouTest.java

+ 5 - 0
get-data/src/main/java/com/huimv/getdata/controller/ErpXiaoShouController.java

@@ -51,5 +51,10 @@ public class ErpXiaoShouController {
         return iErpXiaoShouService.getYvQiHeTongMingXi(date);
         return iErpXiaoShouService.getYvQiHeTongMingXi(date);
     }
     }
 
 
+//    @RequestMapping(value = "/getErpId",method = RequestMethod.GET)
+//    public List<YvQiHeTongMingXi> getErpId(@RequestParam(value = "date" ,required = false) String date){
+//        return iErpXiaoShouService.getErpId(date);
+//    }
+
 
 
 }
 }

+ 41 - 0
get-data/src/main/java/com/huimv/getdata/entity/ErpBdMaterial.java

@@ -0,0 +1,41 @@
+package com.huimv.getdata.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+import java.io.Serializable;
+import java.time.LocalDateTime;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author author
+ * @since 2025-01-03
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@TableName("erp_bd_org")
+public class ErpBdMaterial implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    private Integer forgid;
+
+    private LocalDateTime fcreatedate;
+
+    private String fname;
+
+    private String orgId;
+
+
+}

+ 0 - 3
huimv-farm/src/main/java/vip/xiaonuo/money/controller/MoneyCostController.java

@@ -9,13 +9,10 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
 
 
 import org.springframework.web.bind.annotation.RestController;
 import org.springframework.web.bind.annotation.RestController;
 import vip.xiaonuo.common.pojo.CommonResult;
 import vip.xiaonuo.common.pojo.CommonResult;
 import vip.xiaonuo.money.entity.MoneyCost;
 import vip.xiaonuo.money.entity.MoneyCost;
-import vip.xiaonuo.money.entity.MoneyProduce;
-import vip.xiaonuo.money.param.MoneyAnalysisParam;
 import vip.xiaonuo.money.param.MoneyInOutPageParam;
 import vip.xiaonuo.money.param.MoneyInOutPageParam;
 import vip.xiaonuo.money.param.MoneyInOutParam;
 import vip.xiaonuo.money.param.MoneyInOutParam;
 import vip.xiaonuo.money.service.IMoneyCostService;
 import vip.xiaonuo.money.service.IMoneyCostService;

+ 198 - 0
huimv-farm/src/main/java/vip/xiaonuo/sale/controller/ErpBaseMaterialController.java

@@ -0,0 +1,198 @@
+/*
+ * Copyright [2022] [https://www.baiduc.com]
+ *
+ * Snowy采用APACHE LICENSE 2.0开源协议,您在使用过程中,需要注意以下几点:
+ *
+ * 1.请不要删除和修改根目录下的LICENSE文件。
+ * 2.请不要删除和修改Snowy源码头部的版权声明。
+ * 3.本项目代码可免费商业使用,商业使用请保留源码和相关描述文件的项目出处,作者声明等。
+ * 4.分发源码时候,请注明软件出处 https://www.baiduc.com
+ * 5.不可二次分发开源参与同类竞品,如有想法可联系团队xiaonuobase@qq.com商议合作。
+ * 6.若您的项目无法满足以上几点,需要更多功能代码,获取Snowy商业授权许可,请在官网购买授权,地址为 https://www.baiduc.com
+ */
+package vip.xiaonuo.sale.controller;
+
+
+import cn.dev33.satoken.annotation.SaCheckPermission;
+import cn.hutool.core.date.DateUtil;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.StringUtils;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
+import com.github.xiaoymin.knife4j.annotations.ApiSupport;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.core.ParameterizedTypeReference;
+import org.springframework.http.HttpMethod;
+import org.springframework.http.ResponseEntity;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.client.RestTemplate;
+import vip.xiaonuo.common.pojo.CommonResult;
+import vip.xiaonuo.common.pojo.CommonValidList;
+import vip.xiaonuo.sale.entity.ErpBaseMaterial;
+import vip.xiaonuo.sale.param.*;
+import vip.xiaonuo.sale.service.ErpBaseMaterialService;
+
+import javax.annotation.Resource;
+import javax.validation.Valid;
+import javax.validation.constraints.NotEmpty;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * erp_base_material控制器
+ *
+ * @author 1
+ * @date  2025/02/18 13:54
+ */
+@Api(tags = "erp_base_material控制器")
+@ApiSupport(author = "SNOWY_TEAM", order = 1)
+@RestController
+@Validated
+public class ErpBaseMaterialController {
+
+    @Resource
+    private ErpBaseMaterialService erpBaseMaterialService;
+    @Autowired
+    private RestTemplate restTemplate;
+    /**
+     * 获取erp_base_material分页
+     *
+     * @author 1
+     * @date  2025/02/18 13:54
+     */
+    @ApiOperationSupport(order = 1)
+    @ApiOperation("获取erp_base_material分页")
+    @PostMapping("/huimv-farm/basematerial/page")
+    public CommonResult<Page<ErpBaseMaterial>> page(@RequestBody ErpBaseMaterialPageParam erpBaseMaterialPageParam) {
+        return CommonResult.data(erpBaseMaterialService.page(erpBaseMaterialPageParam));
+    }
+
+
+    /**
+     * 添加erp_base_material
+     *
+     * @author 1
+     * @date  2025/02/18 13:54
+     */
+    @ApiOperationSupport(order = 2)
+    @ApiOperation("添加erp_base_material")
+    @PostMapping("/huimv-farm/basematerial/add")
+    public CommonResult<String> add(@RequestBody @Valid ErpBaseMaterialAddParam erpBaseMaterialAddParam) {
+        return erpBaseMaterialService.add(erpBaseMaterialAddParam);
+
+    }
+    @ApiOperationSupport(order = 1)
+    @ApiOperation("根据id查询下级列表")
+    @PostMapping("/huimv-farm/basematerial/listByParten")
+    public CommonResult<List<ErpBaseMaterial>> listByParten(@RequestBody ErpBaseMaterialEditParam erpBaseMaterialPageParam) {
+        List<ErpBaseMaterial> parentId = erpBaseMaterialService.list(new QueryWrapper<ErpBaseMaterial>().eq(StringUtils.isNotBlank(erpBaseMaterialPageParam.getOrgId()),"org_id",erpBaseMaterialPageParam.getOrgId()).eq("parent_id", erpBaseMaterialPageParam.getId()));
+        return CommonResult.data(parentId);
+    }
+
+    @ApiOperationSupport(order = 2 )
+    @ApiOperation("树形列表")
+    @PostMapping("/huimv-farm/basematerial/treeAll")
+    public CommonResult<List<ErpBaseMaterial>> treeAll(@RequestBody  ErpBaseMaterialEditParam erpBaseMaterialPageParam) {
+        List<ErpBaseMaterial>  treeList= erpBaseMaterialService.list(new QueryWrapper<ErpBaseMaterial>().eq(StringUtils.isNotBlank(erpBaseMaterialPageParam.getOrgId()),"org_id", erpBaseMaterialPageParam.getOrgId()));
+        for (ErpBaseMaterial erpBaseMaterial : treeList) {
+            erpBaseMaterial.setChilder(new ArrayList<>());
+        }
+        return CommonResult.data(buildTree(treeList, 0));
+    }
+
+
+//    @ApiOperationSupport(order = 2 )
+//    @ApiOperation("更新erpId")
+//    @GetMapping("/huimv-farm/basematerial/getErpId")
+//    public CommonResult<List<ErpBaseMaterial>> getErpId(ErpBaseMaterialEditParam erpBaseMaterialPageParam) {
+//
+//        ResponseEntity<List<ShiJiChanLiang>> response = restTemplate.exchange(
+//                "http://127.0.0.1:9200/erp-shengChan/getShiJiChanLiang?date=",
+//                HttpMethod.GET,
+//                null,
+//                new ParameterizedTypeReference<List<ShiJiChanLiang>>() {}
+//        );
+//    }
+    public static List<ErpBaseMaterial> buildTree(List<ErpBaseMaterial> nodes, int rootParentId) {
+        Map<Integer, ErpBaseMaterial> nodeMap = new HashMap<>();
+        List<ErpBaseMaterial> rootNodes = new ArrayList<>();
+
+        // 将所有节点放入 Map 中,方便通过 ID 查找
+        for (ErpBaseMaterial node : nodes) {
+            nodeMap.put(node.getId(), node);
+        }
+
+        // 构建树
+        for (ErpBaseMaterial node : nodes) {
+            if (node.getParentId() == 0) {
+                // 顶级节点,直接加入根节点列表
+                rootNodes.add(node);
+            } else {
+                // 查找父节点,并将当前节点加入父节点的子节点列表
+                ErpBaseMaterial parentNode = nodeMap.get(node.getParentId());
+                if (parentNode != null) {
+                    parentNode.addChild(node);
+                }
+            }
+        }
+        return rootNodes;
+    }
+
+    /**
+     * 编辑erp_base_material
+     *
+     * @author 1
+     * @date  2025/02/18 13:54
+     */
+    @ApiOperationSupport(order = 3)
+    @ApiOperation("编辑erp_base_material")
+    @PostMapping("/huimv-farm/basematerial/edit")
+    public CommonResult<String> edit(@RequestBody @Valid ErpBaseMaterialEditParam erpBaseMaterialEditParam) {
+        erpBaseMaterialService.edit(erpBaseMaterialEditParam);
+        return CommonResult.ok();
+
+    }
+
+    /**
+     * 删除erp_base_material
+     *
+     * @author 1
+     * @date  2025/02/18 13:54
+     */
+    @ApiOperationSupport(order = 4)
+    @ApiOperation("删除erp_base_material")
+    @PostMapping("/huimv-farm/basematerial/delete")
+    public CommonResult<String> delete(@RequestBody @Valid @NotEmpty(message = "集合不能为空")
+                                                   CommonValidList<ErpBaseMaterialIdParam> erpBaseMaterialIdParamList) {
+        erpBaseMaterialService.delete(erpBaseMaterialIdParamList);
+        return CommonResult.ok();
+    }
+
+    /**
+     * 获取erp_base_material详情
+     *
+     * @author 1
+     * @date  2025/02/18 13:54
+     */
+    @ApiOperationSupport(order = 5)
+    @ApiOperation("获取erp_base_material详情")
+    @PostMapping("/huimv-farm/basematerial/detail")
+    public CommonResult<ErpBaseMaterial> detail(@Valid ErpBaseMaterialIdParam erpBaseMaterialIdParam) {
+        return CommonResult.data(erpBaseMaterialService.detail(erpBaseMaterialIdParam));
+    }
+
+    @ApiOperationSupport(order = 5)
+    @ApiOperation("获取所有换算物料")
+    @PostMapping("/huimv-farm/basematerial/getHuan")
+    public CommonResult<List<ErpBaseMaterial>> getHuan(@Valid ErpBaseMaterialAddParam erpBaseMaterialIdParam) {
+        return CommonResult.data(erpBaseMaterialService.list(new QueryWrapper<ErpBaseMaterial>().eq(StringUtils.isNotBlank(erpBaseMaterialIdParam.getOrgId()),"org_id",erpBaseMaterialIdParam.getOrgId()).eq("attr",0)));
+    }
+}

+ 102 - 0
huimv-farm/src/main/java/vip/xiaonuo/sale/entity/ErpBaseMaterial.java

@@ -0,0 +1,102 @@
+/*
+ * Copyright [2022] [https://www.baiduc.com]
+ *
+ * Snowy采用APACHE LICENSE 2.0开源协议,您在使用过程中,需要注意以下几点:
+ *
+ * 1.请不要删除和修改根目录下的LICENSE文件。
+ * 2.请不要删除和修改Snowy源码头部的版权声明。
+ * 3.本项目代码可免费商业使用,商业使用请保留源码和相关描述文件的项目出处,作者声明等。
+ * 4.分发源码时候,请注明软件出处 https://www.baiduc.com
+ * 5.不可二次分发开源参与同类竞品,如有想法可联系团队xiaonuobase@qq.com商议合作。
+ * 6.若您的项目无法满足以上几点,需要更多功能代码,获取Snowy商业授权许可,请在官网购买授权,地址为 https://www.baiduc.com
+ */
+
+package vip.xiaonuo.sale.entity;
+import com.baomidou.mybatisplus.annotation.*;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * erp_base_material实体
+ *
+ * @author 1
+ * @date  2025/02/18 13:54
+ **/
+@Getter
+@Setter
+@TableName("erp_base_material")
+public class ErpBaseMaterial {
+
+    /** ID */
+    @TableId
+    @ApiModelProperty(value = "ID", position = 1)
+    private Integer id;
+
+    /** 名字 */
+    @ApiModelProperty(value = "名字", position = 2)
+    private String materialName;
+
+    /** 等级 */
+    @ApiModelProperty(value = "等级", position = 3)
+    private Integer level;
+
+    /** 父id */
+    @ApiModelProperty(value = "父id", position = 4)
+    private Integer parentId;
+
+    /** erpid */
+    @ApiModelProperty(value = "erpid", position = 5)
+    private String erpId;
+
+    /** 物料编码 */
+    @ApiModelProperty(value = "物料编码", position = 6)
+    private String materialCode;
+
+    /** 换算值 */
+    @ApiModelProperty(value = "换算值", position = 7)
+    private Double conver;
+
+    /** 属性 0是换算物料, 1其它 */
+    @ApiModelProperty(value = "属性 0是换算物料, 1其它", position = 8)
+    private Integer attr;
+
+    /** ORG_ID */
+    @ApiModelProperty(value = "ORG_ID", position = 9)
+    private String orgId;
+
+    /** DELETE_FLAG */
+    @ApiModelProperty(value = "DELETE_FLAG", position = 10)
+    @TableLogic
+    @TableField(fill = FieldFill.INSERT)
+    private String deleteFlag;
+
+    /** CREATE_USER */
+    @ApiModelProperty(value = "CREATE_USER", position = 11)
+    @TableField(fill = FieldFill.INSERT)
+    private String createUser;
+
+    /** UPDATE_TIME */
+    @ApiModelProperty(value = "UPDATE_TIME", position = 12)
+    @TableField(fill = FieldFill.UPDATE)
+    private Date updateTime;
+
+    /** UPDATE_USER */
+    @ApiModelProperty(value = "UPDATE_USER", position = 13)
+    @TableField(fill = FieldFill.UPDATE)
+    private String updateUser;
+
+    @ApiModelProperty(value = "规格", position = 14)
+    private String fspecification;
+
+
+    private List<ErpBaseMaterial> childer;
+
+
+    public void addChild(ErpBaseMaterial child) {
+        this.childer.add(child);
+    }
+}

+ 34 - 0
huimv-farm/src/main/java/vip/xiaonuo/sale/enums/ErpBaseMaterialEnum.java

@@ -0,0 +1,34 @@
+/*
+ * Copyright [2022] [https://www.baiduc.com]
+ *
+ * Snowy采用APACHE LICENSE 2.0开源协议,您在使用过程中,需要注意以下几点:
+ *
+ * 1.请不要删除和修改根目录下的LICENSE文件。
+ * 2.请不要删除和修改Snowy源码头部的版权声明。
+ * 3.本项目代码可免费商业使用,商业使用请保留源码和相关描述文件的项目出处,作者声明等。
+ * 4.分发源码时候,请注明软件出处 https://www.baiduc.com
+ * 5.不可二次分发开源参与同类竞品,如有想法可联系团队xiaonuobase@qq.com商议合作。
+ * 6.若您的项目无法满足以上几点,需要更多功能代码,获取Snowy商业授权许可,请在官网购买授权,地址为 https://www.baiduc.com
+ */
+package vip.xiaonuo.sale.enums;
+
+import lombok.Getter;
+
+/**
+ * erp_base_material枚举
+ *
+ * @author 1
+ * @date  2025/02/18 13:54
+ **/
+@Getter
+public enum ErpBaseMaterialEnum {
+
+    /** 测试 */
+    TEST("TEST");
+
+    private final String value;
+
+    ErpBaseMaterialEnum(String value) {
+        this.value = value;
+    }
+}

+ 25 - 0
huimv-farm/src/main/java/vip/xiaonuo/sale/mapper/ErpBaseMaterialMapper.java

@@ -0,0 +1,25 @@
+/*
+ * Copyright [2022] [https://www.baiduc.com]
+ *
+ * Snowy采用APACHE LICENSE 2.0开源协议,您在使用过程中,需要注意以下几点:
+ *
+ * 1.请不要删除和修改根目录下的LICENSE文件。
+ * 2.请不要删除和修改Snowy源码头部的版权声明。
+ * 3.本项目代码可免费商业使用,商业使用请保留源码和相关描述文件的项目出处,作者声明等。
+ * 4.分发源码时候,请注明软件出处 https://www.baiduc.com
+ * 5.不可二次分发开源参与同类竞品,如有想法可联系团队xiaonuobase@qq.com商议合作。
+ * 6.若您的项目无法满足以上几点,需要更多功能代码,获取Snowy商业授权许可,请在官网购买授权,地址为 https://www.baiduc.com
+ */
+package vip.xiaonuo.sale.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import vip.xiaonuo.sale.entity.ErpBaseMaterial;
+
+/**
+ * erp_base_materialMapper接口
+ *
+ * @author 1
+ * @date  2025/02/18 13:54
+ **/
+public interface ErpBaseMaterialMapper extends BaseMapper<ErpBaseMaterial> {
+}

+ 5 - 0
huimv-farm/src/main/java/vip/xiaonuo/sale/mapper/mapping/ErpBaseMaterialMapper.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="vip.xiaonuo.huimv-farm.modular.basematerial.mapper.ErpBaseMaterialMapper">
+
+</mapper>

+ 70 - 0
huimv-farm/src/main/java/vip/xiaonuo/sale/param/ErpBaseMaterialAddParam.java

@@ -0,0 +1,70 @@
+/*
+ * Copyright [2022] [https://www.baiduc.com]
+ *
+ * Snowy采用APACHE LICENSE 2.0开源协议,您在使用过程中,需要注意以下几点:
+ *
+ * 1.请不要删除和修改根目录下的LICENSE文件。
+ * 2.请不要删除和修改Snowy源码头部的版权声明。
+ * 3.本项目代码可免费商业使用,商业使用请保留源码和相关描述文件的项目出处,作者声明等。
+ * 4.分发源码时候,请注明软件出处 https://www.baiduc.com
+ * 5.不可二次分发开源参与同类竞品,如有想法可联系团队xiaonuobase@qq.com商议合作。
+ * 6.若您的项目无法满足以上几点,需要更多功能代码,获取Snowy商业授权许可,请在官网购买授权,地址为 https://www.baiduc.com
+ */
+package vip.xiaonuo.sale.param;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * erp_base_material添加参数
+ *
+ * @author 1
+ * @date  2025/02/18 13:54
+ **/
+@Getter
+@Setter
+public class ErpBaseMaterialAddParam {
+
+
+    /** 名字 */
+    @ApiModelProperty(value = "名字", position = 2)
+    private String materialName;
+
+    /** 等级 */
+    @ApiModelProperty(value = "等级", position = 3)
+    private Integer level;
+
+    /** 父id */
+    @ApiModelProperty(value = "父id", position = 4)
+    private Integer parentId;
+
+    /** erpid */
+    @ApiModelProperty(value = "erpid", position = 5)
+    private String erpId;
+
+    /** 物料编码 */
+    @ApiModelProperty(value = "物料编码", position = 6)
+    private String materialCode;
+
+    /** 换算值 */
+    @ApiModelProperty(value = "换算值", position = 7)
+    private Double conver;
+
+    /** 属性 0是换算物料, 1其它 */
+    @ApiModelProperty(value = "属性 0是换算物料, 1其它", position = 8)
+    private Integer attr;
+
+    /** ORG_ID */
+    @ApiModelProperty(value = "ORG_ID", position = 9)
+    private String orgId;
+
+    @ApiModelProperty(value = "规格", position = 14)
+    private String fspecification;
+
+}

+ 73 - 0
huimv-farm/src/main/java/vip/xiaonuo/sale/param/ErpBaseMaterialEditParam.java

@@ -0,0 +1,73 @@
+/*
+ * Copyright [2022] [https://www.baiduc.com]
+ *
+ * Snowy采用APACHE LICENSE 2.0开源协议,您在使用过程中,需要注意以下几点:
+ *
+ * 1.请不要删除和修改根目录下的LICENSE文件。
+ * 2.请不要删除和修改Snowy源码头部的版权声明。
+ * 3.本项目代码可免费商业使用,商业使用请保留源码和相关描述文件的项目出处,作者声明等。
+ * 4.分发源码时候,请注明软件出处 https://www.baiduc.com
+ * 5.不可二次分发开源参与同类竞品,如有想法可联系团队xiaonuobase@qq.com商议合作。
+ * 6.若您的项目无法满足以上几点,需要更多功能代码,获取Snowy商业授权许可,请在官网购买授权,地址为 https://www.baiduc.com
+ */
+package vip.xiaonuo.sale.param;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * erp_base_material编辑参数
+ *
+ * @author 1
+ * @date  2025/02/18 13:54
+ **/
+@Getter
+@Setter
+public class ErpBaseMaterialEditParam {
+
+    /** ID */
+    @ApiModelProperty(value = "ID", required = true, position = 1)
+    private Integer id;
+
+    /** 名字 */
+    @ApiModelProperty(value = "名字", position = 2)
+    private String materialName;
+
+    /** 等级 */
+    @ApiModelProperty(value = "等级", position = 3)
+    private Integer level;
+
+    /** 父id */
+    @ApiModelProperty(value = "父id", position = 4)
+    private Integer parentId;
+
+    /** erpid */
+    @ApiModelProperty(value = "erpid", position = 5)
+    private String erpId;
+
+    /** 物料编码 */
+    @ApiModelProperty(value = "物料编码", position = 6)
+    private String materialCode;
+
+    /** 换算值 */
+    @ApiModelProperty(value = "换算值", position = 7)
+    private Double conver;
+
+    /** 属性 0是换算物料, 1其它 */
+    @ApiModelProperty(value = "属性 0是换算物料, 1其它", position = 8)
+    private Integer attr;
+
+    /** ORG_ID */
+    @ApiModelProperty(value = "ORG_ID", position = 9)
+    private String orgId;
+
+    @ApiModelProperty(value = "规格", position = 14)
+    private String fspecification;
+
+}

+ 72 - 0
huimv-farm/src/main/java/vip/xiaonuo/sale/param/ErpBaseMaterialEditTreeParam.java

@@ -0,0 +1,72 @@
+/*
+ * Copyright [2022] [https://www.baiduc.com]
+ *
+ * Snowy采用APACHE LICENSE 2.0开源协议,您在使用过程中,需要注意以下几点:
+ *
+ * 1.请不要删除和修改根目录下的LICENSE文件。
+ * 2.请不要删除和修改Snowy源码头部的版权声明。
+ * 3.本项目代码可免费商业使用,商业使用请保留源码和相关描述文件的项目出处,作者声明等。
+ * 4.分发源码时候,请注明软件出处 https://www.baiduc.com
+ * 5.不可二次分发开源参与同类竞品,如有想法可联系团队xiaonuobase@qq.com商议合作。
+ * 6.若您的项目无法满足以上几点,需要更多功能代码,获取Snowy商业授权许可,请在官网购买授权,地址为 https://www.baiduc.com
+ */
+package vip.xiaonuo.sale.param;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.List;
+
+/**
+ * erp_base_material编辑参数
+ *
+ * @author 1
+ * @date  2025/02/18 13:54
+ **/
+@Getter
+@Setter
+public class ErpBaseMaterialEditTreeParam {
+
+    /** ID */
+    @ApiModelProperty(value = "ID", required = true, position = 1)
+    private Integer id;
+
+    /** 名字 */
+    @ApiModelProperty(value = "名字", position = 2)
+    private String materialName;
+
+    /** 等级 */
+    @ApiModelProperty(value = "等级", position = 3)
+    private Integer level;
+
+    /** 父id */
+    @ApiModelProperty(value = "父id", position = 4)
+    private Integer parentId;
+
+    /** erpid */
+    @ApiModelProperty(value = "erpid", position = 5)
+    private String erpId;
+
+    /** 物料编码 */
+    @ApiModelProperty(value = "物料编码", position = 6)
+    private String materialCode;
+
+    /** 换算值 */
+    @ApiModelProperty(value = "换算值", position = 7)
+    private Double conver;
+
+    /** 属性 0是换算物料, 1其它 */
+    @ApiModelProperty(value = "属性 0是换算物料, 1其它", position = 8)
+    private Integer attr;
+
+    /** ORG_ID */
+    @ApiModelProperty(value = "ORG_ID", position = 9)
+    private String orgId;
+    @ApiModelProperty(value = "规格", position = 14)
+    private String fspecification;
+
+    @ApiModelProperty(value = "ORG_ID", position = 9)
+    private List<ErpBaseMaterialEditTreeParam> childer;
+
+}

+ 35 - 0
huimv-farm/src/main/java/vip/xiaonuo/sale/param/ErpBaseMaterialIdParam.java

@@ -0,0 +1,35 @@
+/*
+ * Copyright [2022] [https://www.baiduc.com]
+ *
+ * Snowy采用APACHE LICENSE 2.0开源协议,您在使用过程中,需要注意以下几点:
+ *
+ * 1.请不要删除和修改根目录下的LICENSE文件。
+ * 2.请不要删除和修改Snowy源码头部的版权声明。
+ * 3.本项目代码可免费商业使用,商业使用请保留源码和相关描述文件的项目出处,作者声明等。
+ * 4.分发源码时候,请注明软件出处 https://www.baiduc.com
+ * 5.不可二次分发开源参与同类竞品,如有想法可联系团队xiaonuobase@qq.com商议合作。
+ * 6.若您的项目无法满足以上几点,需要更多功能代码,获取Snowy商业授权许可,请在官网购买授权,地址为 https://www.baiduc.com
+ */
+package vip.xiaonuo.sale.param;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+
+import javax.validation.constraints.NotBlank;
+
+/**
+ * erp_base_materialId参数
+ *
+ * @author 1
+ * @date  2025/02/18 13:54
+ **/
+@Getter
+@Setter
+public class ErpBaseMaterialIdParam {
+
+    /** ID */
+    @ApiModelProperty(value = "ID", required = true)
+    @NotBlank(message = "id不能为空")
+    private Integer id;
+}

+ 51 - 0
huimv-farm/src/main/java/vip/xiaonuo/sale/param/ErpBaseMaterialPageParam.java

@@ -0,0 +1,51 @@
+/*
+ * Copyright [2022] [https://www.baiduc.com]
+ *
+ * Snowy采用APACHE LICENSE 2.0开源协议,您在使用过程中,需要注意以下几点:
+ *
+ * 1.请不要删除和修改根目录下的LICENSE文件。
+ * 2.请不要删除和修改Snowy源码头部的版权声明。
+ * 3.本项目代码可免费商业使用,商业使用请保留源码和相关描述文件的项目出处,作者声明等。
+ * 4.分发源码时候,请注明软件出处 https://www.baiduc.com
+ * 5.不可二次分发开源参与同类竞品,如有想法可联系团队xiaonuobase@qq.com商议合作。
+ * 6.若您的项目无法满足以上几点,需要更多功能代码,获取Snowy商业授权许可,请在官网购买授权,地址为 https://www.baiduc.com
+ */
+package vip.xiaonuo.sale.param;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * erp_base_material查询参数
+ *
+ * @author 1
+ * @date  2025/02/18 13:54
+ **/
+@Getter
+@Setter
+public class ErpBaseMaterialPageParam {
+
+    /** 当前页 */
+    @ApiModelProperty(value = "当前页码")
+    private Integer current;
+
+    /** 每页条数 */
+    @ApiModelProperty(value = "每页条数")
+    private Integer size;
+
+    /** 排序字段 */
+    @ApiModelProperty(value = "排序字段,字段驼峰名称,如:userName")
+    private String sortField;
+
+    /** 排序方式 */
+    @ApiModelProperty(value = "排序方式,升序:ASCEND;降序:DESCEND")
+    private String sortOrder;
+
+    /** 关键词 */
+    @ApiModelProperty(value = "关键词")
+    private String searchKey;
+
+}

+ 83 - 0
huimv-farm/src/main/java/vip/xiaonuo/sale/service/ErpBaseMaterialService.java

@@ -0,0 +1,83 @@
+/*
+ * Copyright [2022] [https://www.baiduc.com]
+ *
+ * Snowy采用APACHE LICENSE 2.0开源协议,您在使用过程中,需要注意以下几点:
+ *
+ * 1.请不要删除和修改根目录下的LICENSE文件。
+ * 2.请不要删除和修改Snowy源码头部的版权声明。
+ * 3.本项目代码可免费商业使用,商业使用请保留源码和相关描述文件的项目出处,作者声明等。
+ * 4.分发源码时候,请注明软件出处 https://www.baiduc.com
+ * 5.不可二次分发开源参与同类竞品,如有想法可联系团队xiaonuobase@qq.com商议合作。
+ * 6.若您的项目无法满足以上几点,需要更多功能代码,获取Snowy商业授权许可,请在官网购买授权,地址为 https://www.baiduc.com
+ */
+package vip.xiaonuo.sale.service;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.IService;
+import vip.xiaonuo.common.pojo.CommonResult;
+import vip.xiaonuo.sale.entity.ErpBaseMaterial;
+import vip.xiaonuo.sale.param.ErpBaseMaterialAddParam;
+import vip.xiaonuo.sale.param.ErpBaseMaterialEditParam;
+import vip.xiaonuo.sale.param.ErpBaseMaterialIdParam;
+import vip.xiaonuo.sale.param.ErpBaseMaterialPageParam;
+
+import java.util.List;
+
+/**
+ * erp_base_materialService接口
+ *
+ * @author 1
+ * @date  2025/02/18 13:54
+ **/
+public interface ErpBaseMaterialService extends IService<ErpBaseMaterial> {
+
+    /**
+     * 获取erp_base_material分页
+     *
+     * @author 1
+     * @date  2025/02/18 13:54
+     */
+    Page<ErpBaseMaterial> page(ErpBaseMaterialPageParam erpBaseMaterialPageParam);
+
+    /**
+     * 添加erp_base_material
+     *
+     * @author 1
+     * @date  2025/02/18 13:54
+     */
+    CommonResult<String> add(ErpBaseMaterialAddParam erpBaseMaterialAddParam);
+
+    /**
+     * 编辑erp_base_material
+     *
+     * @author 1
+     * @date  2025/02/18 13:54
+     */
+    void edit(ErpBaseMaterialEditParam erpBaseMaterialEditParam);
+
+    /**
+     * 删除erp_base_material
+     *
+     * @author 1
+     * @date  2025/02/18 13:54
+     */
+    void delete(List<ErpBaseMaterialIdParam> erpBaseMaterialIdParamList);
+
+    /**
+     * 获取erp_base_material详情
+     *
+     * @author 1
+     * @date  2025/02/18 13:54
+     */
+    ErpBaseMaterial detail(ErpBaseMaterialIdParam erpBaseMaterialIdParam);
+
+    /**
+     * 获取erp_base_material详情
+     *
+     * @author 1
+     * @date  2025/02/18 13:54
+     **/
+    ErpBaseMaterial queryEntity(Integer id);
+
+    Object getHuan(ErpBaseMaterialEditParam erpBaseMaterialIdParam);
+}

+ 142 - 0
huimv-farm/src/main/java/vip/xiaonuo/sale/service/impl/ErpBaseMaterialServiceImpl.java

@@ -0,0 +1,142 @@
+/*
+ * Copyright [2022] [https://www.baiduc.com]
+ *
+ * Snowy采用APACHE LICENSE 2.0开源协议,您在使用过程中,需要注意以下几点:
+ *
+ * 1.请不要删除和修改根目录下的LICENSE文件。
+ * 2.请不要删除和修改Snowy源码头部的版权声明。
+ * 3.本项目代码可免费商业使用,商业使用请保留源码和相关描述文件的项目出处,作者声明等。
+ * 4.分发源码时候,请注明软件出处 https://www.baiduc.com
+ * 5.不可二次分发开源参与同类竞品,如有想法可联系团队xiaonuobase@qq.com商议合作。
+ * 6.若您的项目无法满足以上几点,需要更多功能代码,获取Snowy商业授权许可,请在官网购买授权,地址为 https://www.baiduc.com
+ */
+package vip.xiaonuo.sale.service.impl;
+
+import cn.hutool.core.bean.BeanUtil;
+import cn.hutool.core.collection.CollStreamUtil;
+import cn.hutool.core.util.ObjectUtil;
+import cn.hutool.core.util.StrUtil;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.StringUtils;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.checkerframework.checker.units.qual.A;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+import vip.xiaonuo.common.enums.CommonSortOrderEnum;
+import vip.xiaonuo.common.exception.CommonException;
+import vip.xiaonuo.common.page.CommonPageRequest;
+import vip.xiaonuo.common.pojo.CommonResult;
+import vip.xiaonuo.sale.entity.ErpBaseMaterial;
+import vip.xiaonuo.sale.mapper.ErpBaseMaterialMapper;
+import vip.xiaonuo.sale.param.ErpBaseMaterialAddParam;
+import vip.xiaonuo.sale.param.ErpBaseMaterialEditParam;
+import vip.xiaonuo.sale.param.ErpBaseMaterialIdParam;
+import vip.xiaonuo.sale.param.ErpBaseMaterialPageParam;
+import vip.xiaonuo.sale.service.ErpBaseMaterialService;
+
+import java.util.List;
+
+/**
+ * erp_base_materialService接口实现类
+ *
+ * @author 1
+ * @date  2025/02/18 13:54
+ **/
+@Service
+public class ErpBaseMaterialServiceImpl extends ServiceImpl<ErpBaseMaterialMapper, ErpBaseMaterial> implements ErpBaseMaterialService {
+
+    @Autowired
+    private ErpBaseMaterialMapper erpBaseMaterialMapper;
+
+    @Override
+    public Page<ErpBaseMaterial> page(ErpBaseMaterialPageParam erpBaseMaterialPageParam) {
+        QueryWrapper<ErpBaseMaterial> queryWrapper = new QueryWrapper<>();
+        if(ObjectUtil.isAllNotEmpty(erpBaseMaterialPageParam.getSortField(), erpBaseMaterialPageParam.getSortOrder())) {
+            CommonSortOrderEnum.validate(erpBaseMaterialPageParam.getSortOrder());
+            queryWrapper.orderBy(true, erpBaseMaterialPageParam.getSortOrder().equals(CommonSortOrderEnum.ASC.getValue()),
+                    StrUtil.toUnderlineCase(erpBaseMaterialPageParam.getSortField()));
+        } else {
+            queryWrapper.lambda().orderByAsc(ErpBaseMaterial::getId);
+        }
+        return this.page(CommonPageRequest.defaultPage(), queryWrapper);
+    }
+
+    @Transactional(rollbackFor = Exception.class)
+    @Override
+    public CommonResult<String>  add(ErpBaseMaterialAddParam erpBaseMaterialAddParam) {
+        ErpBaseMaterial erpBaseMaterial = BeanUtil.toBean(erpBaseMaterialAddParam, ErpBaseMaterial.class);
+        if (StringUtils.isBlank(erpBaseMaterial.getOrgId())){
+            throw new CommonException("请选择公司");
+        }
+        if(erpBaseMaterialMapper.exists(new QueryWrapper<ErpBaseMaterial>().eq("org_id",erpBaseMaterial.getOrgId()).eq("material_name", erpBaseMaterial.getMaterialName()).eq("fspecification",erpBaseMaterial.getFspecification()))){
+            throw new CommonException("物料名称、规格重复");
+        }
+        if(StringUtils.isNotBlank(erpBaseMaterial.getErpId() ) && erpBaseMaterialMapper.exists(new QueryWrapper<ErpBaseMaterial>().eq("org_id",erpBaseMaterial.getOrgId()).eq("erp_id", erpBaseMaterial.getErpId()))){
+            throw new CommonException("erp编码重复");
+        }
+        if (erpBaseMaterial.getAttr() == 0 && erpBaseMaterialMapper.selectCount(new QueryWrapper<ErpBaseMaterial>().eq("org_id",erpBaseMaterial.getOrgId()).eq("attr",0).eq("parent_id",erpBaseMaterial.getParentId()))>0){
+            throw new CommonException("已有换算物料,请修改");
+        }
+        Integer parentId = erpBaseMaterial.getParentId();
+        if (parentId ==0){
+            erpBaseMaterial.setLevel(1);
+        }else {
+            erpBaseMaterial.setLevel(erpBaseMaterialMapper.selectById(parentId).getLevel()+1);
+        }
+        this.save(erpBaseMaterial);
+        return CommonResult.ok();
+    }
+
+    @Transactional(rollbackFor = Exception.class)
+    @Override
+    public void edit(ErpBaseMaterialEditParam erpBaseMaterialEditParam) {
+
+        ErpBaseMaterial erpBaseMaterial = BeanUtil.toBean(erpBaseMaterialEditParam, ErpBaseMaterial.class);
+        if (StringUtils.isBlank(erpBaseMaterial.getOrgId())){
+            throw new CommonException("请选择公司");
+        }
+        if(erpBaseMaterialMapper.selectCount(new QueryWrapper<ErpBaseMaterial>().eq("org_id",erpBaseMaterial.getOrgId()).eq("material_name", erpBaseMaterial.getMaterialName()).eq("fspecification",erpBaseMaterial.getFspecification()).ne("id",erpBaseMaterial.getId()))>0){
+            throw new CommonException("物料名称、规格重复");
+        }
+        if(StringUtils.isNotBlank(erpBaseMaterial.getErpId() ) && erpBaseMaterialMapper.selectCount(new QueryWrapper<ErpBaseMaterial>().eq("org_id",erpBaseMaterial.getOrgId()).eq("erp_id", erpBaseMaterial.getErpId()).ne("id",erpBaseMaterial.getId()))>0){
+            throw new CommonException("erp编码重复");
+        }
+        if (erpBaseMaterial.getAttr() == 0 && erpBaseMaterialMapper.selectCount(new QueryWrapper<ErpBaseMaterial>().eq("org_id",erpBaseMaterial.getOrgId()).eq("attr",0).eq("parent_id",erpBaseMaterial.getParentId()).ne("id",erpBaseMaterial.getId()))>0){
+            throw new CommonException("已有换算物料,请修改");
+        }
+        this.updateById(erpBaseMaterial);
+    }
+
+    @Transactional(rollbackFor = Exception.class)
+    @Override
+    public void delete(List<ErpBaseMaterialIdParam> erpBaseMaterialIdParamList) {
+        for (ErpBaseMaterialIdParam erpBaseMaterialIdParam : erpBaseMaterialIdParamList) {
+            if (erpBaseMaterialMapper.exists(new QueryWrapper<ErpBaseMaterial>().eq("parent_id",erpBaseMaterialIdParam.getId()))){
+                throw new CommonException("该物料有下级无聊,请删除");
+            }
+        }
+        // 执行删除
+        this.removeByIds(CollStreamUtil.toList(erpBaseMaterialIdParamList, ErpBaseMaterialIdParam::getId));
+    }
+
+    @Override
+    public ErpBaseMaterial detail(ErpBaseMaterialIdParam erpBaseMaterialIdParam) {
+        return this.queryEntity(erpBaseMaterialIdParam.getId());
+    }
+
+    @Override
+    public ErpBaseMaterial queryEntity(Integer id) {
+        ErpBaseMaterial erpBaseMaterial = this.getById(id);
+        if(ObjectUtil.isEmpty(erpBaseMaterial)) {
+            throw new CommonException("erp_base_material不存在,id值为:{}", id);
+        }
+        return erpBaseMaterial;
+    }
+
+    @Override
+    public Object getHuan(ErpBaseMaterialEditParam erpBaseMaterialIdParam) {
+        return null;
+    }
+}

+ 2 - 2
huimv-farm/src/test/java/vip/xiaonuo/CaiWuTest.java

@@ -238,9 +238,9 @@ public class CaiWuTest {
             moneyProduce.setOrgId(forgid.getOrgId());
             moneyProduce.setOrgId(forgid.getOrgId());
             moneyProduce.setCreateTime(forObject.getFDATE());
             moneyProduce.setCreateTime(forObject.getFDATE());
             if ("国内销售收入".equals(forObject.getFNAME())||"国内销售收入2".equals(forObject.getFNAME())){
             if ("国内销售收入".equals(forObject.getFNAME())||"国内销售收入2".equals(forObject.getFNAME())){
-                moneyProduce.setType(0);
+                moneyProduce.setInMoney(String.format("%.2f",forObject.getFcredit()));
             } else {
             } else {
-                moneyProduce.setType(1);
+                moneyProduce.setOutMoney(String.format("%.2f",forObject.getFcredit()));
             }
             }
             produceMapper.insert(moneyProduce);
             produceMapper.insert(moneyProduce);
         }
         }

+ 81 - 78
huimv-farm/src/test/java/vip/xiaonuo/KuCunTest.java

@@ -118,6 +118,7 @@ public class KuCunTest {
                 warehouseStockDetail.setMaterialCode(5);
                 warehouseStockDetail.setMaterialCode(5);
             }
             }
             warehouseStockDetail.setOrgId(forgid.getOrgId());
             warehouseStockDetail.setOrgId(forgid.getOrgId());
+//            warehouseStockDetail.setMaterialCode(forObject.getFMATERIALID());
             warehouseStockDetail.setMaterialName(forObject.getWuLiaoName());
             warehouseStockDetail.setMaterialName(forObject.getWuLiaoName());
             warehouseStockDetail.setMaterialNumber(String.format("%.2f",forObject.getFBASEQTY()));
             warehouseStockDetail.setMaterialNumber(String.format("%.2f",forObject.getFBASEQTY()));
             warehouseStockDetail.setStockName(forObject.getFNAME());
             warehouseStockDetail.setStockName(forObject.getFNAME());
@@ -125,80 +126,80 @@ public class KuCunTest {
             stockDetailMapper.insert(warehouseStockDetail);
             stockDetailMapper.insert(warehouseStockDetail);
         }
         }
     }
     }
-//    @Test
-//    public void test2() {
-//        //成品半成品
-//        ResponseEntity<List<ChengPinRuKu>> response1 = restTemplate.exchange(
-//                "http://127.0.0.1:9200/erp-kucun/getChengPinDangRi?date=",
-//                HttpMethod.GET,
-//                null,
-//                new ParameterizedTypeReference<List<ChengPinRuKu>>() {}
-//        );
-//        List<ChengPinRuKu> forObjects1= response1.getBody();
-//        System.out.println(forObjects1);
-//        for (ChengPinRuKu forObject : forObjects1) {
-//
-//            ErpBdOrg forgid = erpBdOrgMapper.selectOne(new QueryWrapper<ErpBdOrg>().eq("forgid", forObject.getFSTOCKORGID()));
-//            if (ObjectUtil.isEmpty(forgid))
-//                continue;
-//            WarehouseIncomStock warehouseIncomStock  = new WarehouseIncomStock();
-//            if (("原料库".equals(forObject.getFNAME()) || "高科原料仓库".equals(forObject.getFNAME())) && !forObject.getFnumber().equals("10020002")){
-//                warehouseIncomStock.setMaterial(String.format("%.2f",forObject.getFREALQTY()));
-//            }
-//            if ("成品库".equals(forObject.getFNAME()) || "成品库CW".equals(forObject.getFNAME())){
-//                warehouseIncomStock.setFinishProduce(String.format("%.2f",forObject.getFREALQTY()));
-//            }
-//            if ("五金库".equals(forObject.getFNAME())){
-//                warehouseIncomStock.setLowValue(String.format("%.2f",forObject.getFREALQTY()));
-//            }
-//            if ("包材库".equals(forObject.getFNAME())){
-//                warehouseIncomStock.setPackageMaterial(String.format("%.2f",forObject.getFREALQTY()));
-//            }
-//            if (forObject.getFnumber().equals("10020002")){
-//                warehouseIncomStock.setLanolin(String.format("%.2f",forObject.getFREALQTY()));
-//            }
-//
-//            warehouseIncomStock.setCreateTime(forObject.getFDATE());
-//            warehouseIncomStock.setOrgId(forgid.getOrgId());
-//            incomStockMapper.insert(warehouseIncomStock);
-//
-//            List<WarehouseStockDetail> warehouseStockDetails = stockDetailMapper.selectList(new QueryWrapper<WarehouseStockDetail>()
-//                    .eq("org_id", forgid.getOrgId()).eq("material_name", forObject.getWuLiaoName())
-//                    .between("create_time",DateUtil.beginOfDay(forObject.getFDATE()),DateUtil.endOfDay(forObject.getFDATE())));
-//            if (ObjectUtil.isEmpty(warehouseStockDetails)){
-//                WarehouseStockDetail warehouseStockDetail = new WarehouseStockDetail();
-//                if (("原料库".equals(forObject.getFNAME()) || "高科原料仓库".equals(forObject.getFNAME())) && !forObject.getFnumber().equals("10020002")){
-//                    warehouseStockDetail.setMaterialCode(0);
-//                }
-//                if ("成品库".equals(forObject.getFNAME()) || "成品库CW".equals(forObject.getFNAME())){
-//                    warehouseStockDetail.setMaterialCode(1);
-//                }
-//                if ("五金库".equals(forObject.getFNAME())){
-//                    warehouseStockDetail.setMaterialCode(3);
-//                }
-//                if ("包材库".equals(forObject.getFNAME())){
-//                    warehouseStockDetail.setMaterialCode(4);
-//                }
-//                if (forObject.getFnumber().equals("10020002")){
-//                    warehouseStockDetail.setMaterialCode(5);
-//                }
-//                warehouseStockDetail.setOrgId(forgid.getOrgId());
-//                warehouseStockDetail.setMaterialName(forObject.getWuLiaoName());
-//                warehouseStockDetail.setIncomeNumber(String.format("%.2f",forObject.getFREALQTY()));
-//                warehouseStockDetail.setStockName(forObject.getFNAME());
-//                warehouseStockDetail.setCreateTime(forObject.getFDATE());
-//                stockDetailMapper.insert(warehouseStockDetail);
-//            }else {
-//                WarehouseStockDetail warehouseStockDetail = warehouseStockDetails.get(0);
-//                if (warehouseStockDetail.getIncomeNumber() ==null){
-//                    warehouseStockDetail.setIncomeNumber(String.format("%.2f",forObject.getFREALQTY()));
-//                }else {
-//                    warehouseStockDetail.setIncomeNumber(String.format("%.2f",forObject.getFREALQTY() + Double.parseDouble(warehouseStockDetail.getIncomeNumber())));
-//                }
-//                stockDetailMapper.updateById(warehouseStockDetail);
-//            }
-//        }
-//    }
+    @Test
+    public void test2() {
+        //成品半成品
+        ResponseEntity<List<ChengPinRuKu>> response1 = restTemplate.exchange(
+                "http://127.0.0.1:9200/erp-kucun/getChengPinDangRi?date=",
+                HttpMethod.GET,
+                null,
+                new ParameterizedTypeReference<List<ChengPinRuKu>>() {}
+        );
+        List<ChengPinRuKu> forObjects1= response1.getBody();
+        System.out.println(forObjects1);
+        for (ChengPinRuKu forObject : forObjects1) {
+
+            ErpBdOrg forgid = erpBdOrgMapper.selectOne(new QueryWrapper<ErpBdOrg>().eq("forgid", forObject.getFSTOCKORGID()));
+            if (ObjectUtil.isEmpty(forgid))
+                continue;
+            WarehouseIncomStock warehouseIncomStock  = new WarehouseIncomStock();
+            if (("原料库".equals(forObject.getFNAME()) || "高科原料仓库".equals(forObject.getFNAME())) && !forObject.getFnumber().equals("10020002")){
+                warehouseIncomStock.setMaterial(String.format("%.2f",forObject.getFREALQTY()));
+            }
+            if ("成品库".equals(forObject.getFNAME()) || "成品库CW".equals(forObject.getFNAME())){
+                warehouseIncomStock.setFinishProduce(String.format("%.2f",forObject.getFREALQTY()));
+            }
+            if ("五金库".equals(forObject.getFNAME())){
+                warehouseIncomStock.setLowValue(String.format("%.2f",forObject.getFREALQTY()));
+            }
+            if ("包材库".equals(forObject.getFNAME())){
+                warehouseIncomStock.setPackageMaterial(String.format("%.2f",forObject.getFREALQTY()));
+            }
+            if (forObject.getFnumber().equals("10020002")){
+                warehouseIncomStock.setLanolin(String.format("%.2f",forObject.getFREALQTY()));
+            }
+
+            warehouseIncomStock.setCreateTime(forObject.getFDATE());
+            warehouseIncomStock.setOrgId(forgid.getOrgId());
+            incomStockMapper.insert(warehouseIncomStock);
+
+            List<WarehouseStockDetail> warehouseStockDetails = stockDetailMapper.selectList(new QueryWrapper<WarehouseStockDetail>()
+                    .eq("org_id", forgid.getOrgId()).eq("material_name", forObject.getWuLiaoName())
+                    .between("create_time",DateUtil.beginOfDay(forObject.getFDATE()),DateUtil.endOfDay(forObject.getFDATE())));
+            if (ObjectUtil.isEmpty(warehouseStockDetails)){
+                WarehouseStockDetail warehouseStockDetail = new WarehouseStockDetail();
+                if (("原料库".equals(forObject.getFNAME()) || "高科原料仓库".equals(forObject.getFNAME())) && !forObject.getFnumber().equals("10020002")){
+                    warehouseStockDetail.setMaterialCode(0);
+                }
+                if ("成品库".equals(forObject.getFNAME()) || "成品库CW".equals(forObject.getFNAME())){
+                    warehouseStockDetail.setMaterialCode(1);
+                }
+                if ("五金库".equals(forObject.getFNAME())){
+                    warehouseStockDetail.setMaterialCode(3);
+                }
+                if ("包材库".equals(forObject.getFNAME())){
+                    warehouseStockDetail.setMaterialCode(4);
+                }
+                if (forObject.getFnumber().equals("10020002")){
+                    warehouseStockDetail.setMaterialCode(5);
+                }
+                warehouseStockDetail.setOrgId(forgid.getOrgId());
+                warehouseStockDetail.setMaterialName(forObject.getWuLiaoName());
+                warehouseStockDetail.setIncomeNumber(String.format("%.2f",forObject.getFREALQTY()));
+                warehouseStockDetail.setStockName(forObject.getFNAME());
+                warehouseStockDetail.setCreateTime(forObject.getFDATE());
+                stockDetailMapper.insert(warehouseStockDetail);
+            }else {
+                WarehouseStockDetail warehouseStockDetail = warehouseStockDetails.get(0);
+                if (warehouseStockDetail.getIncomeNumber() ==null){
+                    warehouseStockDetail.setIncomeNumber(String.format("%.2f",forObject.getFREALQTY()));
+                }else {
+                    warehouseStockDetail.setIncomeNumber(String.format("%.2f",forObject.getFREALQTY() + Double.parseDouble(warehouseStockDetail.getIncomeNumber())));
+                }
+                stockDetailMapper.updateById(warehouseStockDetail);
+            }
+        }
+    }
 
 
     @Test
     @Test
     public void test3() {
     public void test3() {
@@ -304,11 +305,11 @@ public class KuCunTest {
             if (forObject.getFnumber().equals("10020002")){
             if (forObject.getFnumber().equals("10020002")){
                 warehouseIncomStock.setLanolin(String.format("%.2f",forObject.getFINSTOCKQTY()));
                 warehouseIncomStock.setLanolin(String.format("%.2f",forObject.getFINSTOCKQTY()));
             }
             }
-
+//
             warehouseIncomStock.setCreateTime(forObject.getFDATE());
             warehouseIncomStock.setCreateTime(forObject.getFDATE());
             warehouseIncomStock.setOrgId(forgid.getOrgId());
             warehouseIncomStock.setOrgId(forgid.getOrgId());
             incomStockMapper.insert(warehouseIncomStock);
             incomStockMapper.insert(warehouseIncomStock);
-
+//
             List<WarehouseStockDetail> warehouseStockDetails = stockDetailMapper.selectList(new QueryWrapper<WarehouseStockDetail>()
             List<WarehouseStockDetail> warehouseStockDetails = stockDetailMapper.selectList(new QueryWrapper<WarehouseStockDetail>()
                     .eq("org_id", forgid.getOrgId()).eq("material_name", forObject.getWuLiaoName())
                     .eq("org_id", forgid.getOrgId()).eq("material_name", forObject.getWuLiaoName())
                     .between("create_time",DateUtil.beginOfDay(forObject.getFDATE()),DateUtil.endOfDay(forObject.getFDATE())));
                     .between("create_time",DateUtil.beginOfDay(forObject.getFDATE()),DateUtil.endOfDay(forObject.getFDATE())));
@@ -334,6 +335,7 @@ public class KuCunTest {
                 warehouseStockDetail.setMaterialName(forObject.getWuLiaoName());
                 warehouseStockDetail.setMaterialName(forObject.getWuLiaoName());
                 warehouseStockDetail.setIncomeNumber(String.format("%.2f",forObject.getFINSTOCKQTY()));
                 warehouseStockDetail.setIncomeNumber(String.format("%.2f",forObject.getFINSTOCKQTY()));
                 warehouseStockDetail.setStockName(forObject.getFNAME());
                 warehouseStockDetail.setStockName(forObject.getFNAME());
+                warehouseStockDetail.setMaterialNumber((String.format("%.2f",forObject.getFSTOCKBASEQTY())));
                 warehouseStockDetail.setCreateTime(forObject.getFDATE());
                 warehouseStockDetail.setCreateTime(forObject.getFDATE());
                 warehouseStockDetail.setMaterialCheck(String.format("%.2f",forObject.getDaiJian()));
                 warehouseStockDetail.setMaterialCheck(String.format("%.2f",forObject.getDaiJian()));
                 stockDetailMapper.insert(warehouseStockDetail);
                 stockDetailMapper.insert(warehouseStockDetail);
@@ -356,7 +358,6 @@ public class KuCunTest {
             WarehouseStockSecond warehouseStockSecond = new WarehouseStockSecond();
             WarehouseStockSecond warehouseStockSecond = new WarehouseStockSecond();
             if (("原料库".equals(forObject.getFNAME()) || "高科原料仓库".equals(forObject.getFNAME())) && !forObject.getFnumber().equals("10020002")){
             if (("原料库".equals(forObject.getFNAME()) || "高科原料仓库".equals(forObject.getFNAME())) && !forObject.getFnumber().equals("10020002")){
                 warehouseStockSecond.setMaterialType(0);
                 warehouseStockSecond.setMaterialType(0);
-
             }
             }
             if ("成品库".equals(forObject.getFNAME()) || "成品库CW".equals(forObject.getFNAME())){
             if ("成品库".equals(forObject.getFNAME()) || "成品库CW".equals(forObject.getFNAME())){
                 warehouseStockSecond.setMaterialType(1);
                 warehouseStockSecond.setMaterialType(1);
@@ -371,8 +372,10 @@ public class KuCunTest {
                 warehouseStockSecond.setMaterialType(5);
                 warehouseStockSecond.setMaterialType(5);
             }
             }
             warehouseStockSecond.setIncomeNumber(String.format("%.2f",forObject.getFINSTOCKQTY()));
             warehouseStockSecond.setIncomeNumber(String.format("%.2f",forObject.getFINSTOCKQTY()));
+            warehouseStockSecond.setIncomeMoney(String.format("%.2f",forObject.getFBILLAMOUNTLC()));
             warehouseStockSecond.setCreateTime(forObject.getFDATE());
             warehouseStockSecond.setCreateTime(forObject.getFDATE());
             warehouseStockSecond.setOrgId(forgid.getOrgId());
             warehouseStockSecond.setOrgId(forgid.getOrgId());
+            warehouseStockSecond.setStock(String.format("%.2f",forObject.getFSTOCKBASEQTY()));
             stockSecondMapper.insert(warehouseStockSecond);
             stockSecondMapper.insert(warehouseStockSecond);
         }
         }
     }
     }
@@ -440,7 +443,7 @@ public class KuCunTest {
                 }else {
                 }else {
                     warehouseStockSecond.setStock(String.format("%.2f",forObject.getFBASEQTY()));
                     warehouseStockSecond.setStock(String.format("%.2f",forObject.getFBASEQTY()));
                 }
                 }
-
+                warehouseStockSecond.setStock(String.format("%.2f",forObject.getFBASEQTY()));
                 stockSecondMapper.updateById(warehouseStockSecond);
                 stockSecondMapper.updateById(warehouseStockSecond);
             }else {
             }else {
                 WarehouseStockSecond warehouseStockSecond = new WarehouseStockSecond();
                 WarehouseStockSecond warehouseStockSecond = new WarehouseStockSecond();

+ 105 - 0
huimv-farm/src/test/java/vip/xiaonuo/SengChanTest.java

@@ -0,0 +1,105 @@
+/*
+ * Copyright [2022] [https://www.baiduc.com]
+ *
+ * Snowy采用APACHE LICENSE 2.0开源协议,您在使用过程中,需要注意以下几点:
+ *
+ * 1.请不要删除和修改根目录下的LICENSE文件。
+ * 2.请不要删除和修改Snowy源码头部的版权声明。
+ * 3.本项目代码可免费商业使用,商业使用请保留源码和相关描述文件的项目出处,作者声明等。
+ * 4.分发源码时候,请注明软件出处 https://www.baiduc.com
+ * 5.不可二次分发开源参与同类竞品,如有想法可联系团队xiaonuobase@qq.com商议合作。
+ * 6.若您的项目无法满足以上几点,需要更多功能代码,获取Snowy商业授权许可,请在官网购买授权,地址为 https://www.baiduc.com
+ */
+package vip.xiaonuo;
+
+import cn.hutool.core.util.ObjectUtil;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.core.ParameterizedTypeReference;
+import org.springframework.http.HttpMethod;
+import org.springframework.http.ResponseEntity;
+import org.springframework.test.context.junit4.SpringRunner;
+import org.springframework.web.client.RestTemplate;
+import vip.xiaonuo.erp.entity.ErpBdOrg;
+import vip.xiaonuo.erp.entity.caigou.CaiGouRuKu;
+import vip.xiaonuo.erp.entity.shengcan.ShiJiChanLiang;
+import vip.xiaonuo.erp.mapper.ErpBdOrgMapper;
+import vip.xiaonuo.production.entity.ProductionTarget;
+import vip.xiaonuo.production.entity.ProductionWorkstopPlan;
+import vip.xiaonuo.production.entity.ProductionYield;
+import vip.xiaonuo.production.mapper.ProductionTargetMapper;
+import vip.xiaonuo.production.mapper.ProductionWorkstopPlanMapper;
+import vip.xiaonuo.production.mapper.ProductionYieldMapper;
+
+import java.util.List;
+
+
+@RunWith(SpringRunner.class)
+@SpringBootTest(classes = Application.class)
+public class SengChanTest {
+
+    @Autowired
+    private RestTemplate restTemplate;
+    @Autowired
+    private ErpBdOrgMapper erpBdOrgMapper;
+    @Autowired
+    private ProductionYieldMapper yieldMapper;
+
+    @Autowired
+    private ProductionWorkstopPlanMapper workstopPlanMapper;
+
+    @Autowired
+    private ProductionTargetMapper targetMapper;
+    @Test
+    public void  test1(){
+        ResponseEntity<List<ShiJiChanLiang>> response = restTemplate.exchange(
+                "http://127.0.0.1:9200/erp-shengChan/getShiJiChanLiang?date=",
+                HttpMethod.GET,
+                null,
+                new ParameterizedTypeReference<List<ShiJiChanLiang>>() {}
+        );
+        List<ShiJiChanLiang> forObjects = response.getBody();
+
+        for (ShiJiChanLiang forObject : forObjects) {
+            ErpBdOrg forgid = erpBdOrgMapper.selectOne(new QueryWrapper<ErpBdOrg>().eq("forgid", forObject.getFSTOCKORGID()));
+            if (ObjectUtil.isEmpty(forgid))
+                continue;
+            ProductionYield productionYield = new ProductionYield();
+            productionYield.setActualProduction(String.format("%.2f",forObject.getFREALQTY()));
+            productionYield.setCompanyName(forgid.getFname());
+//            productionYield.setCompleteRate();
+            productionYield.setCreateTime(forObject.getFDATE());
+            productionYield.setLocationName(forObject.getCheJianName());
+            productionYield.setOrgId(forgid.getOrgId());
+            productionYield.setProduceName(forObject.getWuLiaoName());
+            yieldMapper.insert(productionYield);
+
+            ProductionWorkstopPlan productionWorkstopPlan  = new ProductionWorkstopPlan();
+            productionWorkstopPlan.setActualProduction(String.format("%.2f",forObject.getFREALQTY()));
+//            productionWorkstopPlan.setAvgValue();
+            productionWorkstopPlan.setCreateTime(forObject.getFDATE());
+            productionWorkstopPlan.setLocationId(forObject.getFWORKSHOPID()+"");
+            productionWorkstopPlan.setLocationName(forObject.getCheJianName());
+            productionWorkstopPlan.setOrgId(forgid.getOrgId());
+//            productionWorkstopPlan.setPlanProduction();
+            productionWorkstopPlan.setProduceName(forObject.getWuLiaoName());
+//            productionWorkstopPlan.setUnitCost();
+            workstopPlanMapper.insert(productionWorkstopPlan);
+
+            ProductionTarget productionTarget = new ProductionTarget();
+            productionTarget.setActualProduction(String.format("%.2f",forObject.getFREALQTY()));
+            productionTarget.setCreateTime(forObject.getFDATE());
+            productionTarget.setLocationName(forObject.getCheJianName());
+            productionTarget.setOrgId(forgid.getOrgId());
+//            productionTarget.setPlanCompleteRate();
+//            productionTarget.setPlanProduction();
+//            productionTarget.setProductionEnergy();
+//            productionTarget.setReceiveRate();
+            targetMapper.insert(productionTarget);
+        }
+    }
+
+}

+ 41 - 7
huimv-farm/src/test/java/vip/xiaonuo/XiaoShouTest.java

@@ -31,6 +31,10 @@ import vip.xiaonuo.erp.entity.kucun.WuLiaoKuMingXi;
 import vip.xiaonuo.erp.entity.kucun.YuanCaiLiaoKuCun;
 import vip.xiaonuo.erp.entity.kucun.YuanCaiLiaoKuCun;
 import vip.xiaonuo.erp.entity.xiaoshou.*;
 import vip.xiaonuo.erp.entity.xiaoshou.*;
 import vip.xiaonuo.erp.mapper.ErpBdOrgMapper;
 import vip.xiaonuo.erp.mapper.ErpBdOrgMapper;
+import vip.xiaonuo.money.entity.MoneyOverdue;
+import vip.xiaonuo.money.entity.MoneyProduce;
+import vip.xiaonuo.money.mapper.MoneyOverdueMapper;
+import vip.xiaonuo.money.mapper.MoneyProduceMapper;
 import vip.xiaonuo.sale.entity.*;
 import vip.xiaonuo.sale.entity.*;
 import vip.xiaonuo.sale.mapper.*;
 import vip.xiaonuo.sale.mapper.*;
 import vip.xiaonuo.warehouse.entity.*;
 import vip.xiaonuo.warehouse.entity.*;
@@ -74,11 +78,17 @@ public class XiaoShouTest {
     private SaleProduceMapper produceMapper;
     private SaleProduceMapper produceMapper;
 
 
     @Autowired
     @Autowired
-    private SaleSalesmanMapper salesmanMapper;
+    private SaleOrderMapper orderMapper;
+
 
 
     @Autowired
     @Autowired
     private SaleTargetMapper targetMapper;
     private SaleTargetMapper targetMapper;
 
 
+    @Autowired
+    private MoneyOverdueMapper moneyOverdueMapper;
+    @Autowired
+    private SaleSalesmanMapper salesmanMapper;
+
 
 
     @Test
     @Test
     public void  test1(){
     public void  test1(){
@@ -100,7 +110,7 @@ public class XiaoShouTest {
             saleDetail.setOrgId(forgid.getOrgId());
             saleDetail.setOrgId(forgid.getOrgId());
             saleDetail.setProduceName(forObject.getWuLiaoName());
             saleDetail.setProduceName(forObject.getWuLiaoName());
             saleDetail.setSaleContraceOrder(forObject.getFBILLNO());
             saleDetail.setSaleContraceOrder(forObject.getFBILLNO());
-            saleDetail.setSaleMoney(String.format("%.2f",forObject.getFALLAMOUNT_LC()));
+            saleDetail.setSaleMoney(String.format("%.2f",forObject.getFALLAMOUNTLC()));
             saleDetail.setSaleNumber(String.format("%.2f",forObject.getFQTY()));
             saleDetail.setSaleNumber(String.format("%.2f",forObject.getFQTY()));
             saleDetail.setSalesman(forObject.getFNAME());
             saleDetail.setSalesman(forObject.getFNAME());
             detailMapper.insert(saleDetail);
             detailMapper.insert(saleDetail);
@@ -109,7 +119,7 @@ public class XiaoShouTest {
             SaleCustomer saleCustomer = new SaleCustomer();
             SaleCustomer saleCustomer = new SaleCustomer();
             saleCustomer.setCreateTime(forObject.getFDATE());
             saleCustomer.setCreateTime(forObject.getFDATE());
             saleCustomer.setCustomer(forObject.getKeHuName());
             saleCustomer.setCustomer(forObject.getKeHuName());
-            saleCustomer.setSaleMoney(String.format("%.2f",forObject.getFALLAMOUNT_LC()));
+            saleCustomer.setSaleMoney(String.format("%.2f",forObject.getFALLAMOUNTLC()));
             saleCustomer.setOrgId(forgid.getOrgId());
             saleCustomer.setOrgId(forgid.getOrgId());
             customerMapper.insert(saleCustomer);
             customerMapper.insert(saleCustomer);
 
 
@@ -125,9 +135,17 @@ public class XiaoShouTest {
             saleProduce.setOrgId(forgid.getOrgId());
             saleProduce.setOrgId(forgid.getOrgId());
             saleProduce.setPrice(String.format("%.4f",forObject.getXiaoShouDanJia()));
             saleProduce.setPrice(String.format("%.4f",forObject.getXiaoShouDanJia()));
             saleProduce.setProduceName(forObject.getWuLiaoName());
             saleProduce.setProduceName(forObject.getWuLiaoName());
-            saleProduce.setSaleMoney(String.format("%.2f",forObject.getFALLAMOUNT_LC()));
+            saleProduce.setSaleMoney(String.format("%.2f",forObject.getFALLAMOUNTLC()));
             produceMapper.insert(saleProduce);
             produceMapper.insert(saleProduce);
 
 
+             SaleOrder saleOrder = new SaleOrder();
+            saleOrder.setCreateTime(forObject.getFDATE());
+            saleOrder.setOrgId(forgid.getOrgId());
+            saleOrder.setSaleMoney(String.format("%.2f",forObject.getFALLAMOUNTLC()));
+            saleOrder.setSaleNumber(String.format("%.2f",forObject.getFQTY()));
+            saleOrder.setSaleOrder(forObject.getFBILLNO());
+            orderMapper.insert(saleOrder);
+
         }
         }
     }
     }
     @Test
     @Test
@@ -170,14 +188,14 @@ public class XiaoShouTest {
             SaleDeliver saleDeliver = new SaleDeliver();
             SaleDeliver saleDeliver = new SaleDeliver();
             saleDeliver.setCreateTime(forObject.getFDATE());
             saleDeliver.setCreateTime(forObject.getFDATE());
             saleDeliver.setOrgId(forgid.getOrgId());
             saleDeliver.setOrgId(forgid.getOrgId());
-            saleDeliver.setSaleDeliverMoney(String.format("%.2f",forObject.getFALLAMOUNT_LC()));
+            saleDeliver.setSaleDeliverMoney(String.format("%.2f",forObject.getFALLAMOUNTLC()));
             saleDeliver.setSaleDeliverNumber(String.format("%.2f",forObject.getFREALQTY()));
             saleDeliver.setSaleDeliverNumber(String.format("%.2f",forObject.getFREALQTY()));
             saleDeliver.setSaleOrder(forObject.getFBILLNO());
             saleDeliver.setSaleOrder(forObject.getFBILLNO());
             deliverMapper.insert(saleDeliver);
             deliverMapper.insert(saleDeliver);
             SaleSalesman saleSalesman = new SaleSalesman();
             SaleSalesman saleSalesman = new SaleSalesman();
             saleSalesman.setCreateTime(forObject.getFDATE());
             saleSalesman.setCreateTime(forObject.getFDATE());
             saleSalesman.setOrgId(forgid.getOrgId());
             saleSalesman.setOrgId(forgid.getOrgId());
-            saleSalesman.setSalesmanMoney(String.format("%.2f",forObject.getFALLAMOUNT_LC()));
+            saleSalesman.setSalesmanMoney(String.format("%.2f",forObject.getFALLAMOUNTLC()));
             saleSalesman.setSalesmanName(forObject.getXiaoShouName());
             saleSalesman.setSalesmanName(forObject.getXiaoShouName());
             salesmanMapper.insert(saleSalesman);
             salesmanMapper.insert(saleSalesman);
         }
         }
@@ -226,10 +244,25 @@ public class XiaoShouTest {
             saleOverdue.setDeliveryNumber(forObject.getFQTY());
             saleOverdue.setDeliveryNumber(forObject.getFQTY());
             saleOverdue.setOrgId(forgid.getOrgId());
             saleOverdue.setOrgId(forgid.getOrgId());
 //            saleOverdue.setOverdueDay();
 //            saleOverdue.setOverdueDay();
-            saleOverdue.setOverdueMoney(forObject.getFALLAMOUNT_LC());
+            saleOverdue.setOverdueMoney(String.format("%.2f",forObject.getFALLAMOUNTLC()));
             saleOverdue.setOverdueOrder(forObject.getFBILLNO());
             saleOverdue.setOverdueOrder(forObject.getFBILLNO());
             overdueMapper.insert(saleOverdue);
             overdueMapper.insert(saleOverdue);
 
 
+            MoneyOverdue moneyProduce = new MoneyOverdue();
+//            moneyProduce.setBalance();
+            moneyProduce.setCollectPrice(String.format("%.2f",forObject.getFALLAMOUNTLC()));
+            moneyProduce.setDateTime(forObject.getFDATE());
+            moneyProduce.setDocumentNumber(forObject.getFBILLNO());
+//            moneyProduce.setDocumentStatus();
+            moneyProduce.setDocumentType(forObject.getFNAME());
+            moneyProduce.setEndTime(forObject.getChuKuDate());
+            moneyProduce.setIsOverdue(0);
+            moneyProduce.setOrgId(forgid.getOrgId());
+            moneyProduce.setOverduePrice(String.format("%.2f",forObject.getFALLAMOUNTLC()));
+//            moneyProduce.setOverdueTime();
+            moneyProduce.setUserName(forObject.getKeHuName());
+
+            moneyOverdueMapper.insert(moneyProduce);
         }
         }
     }
     }
 
 
@@ -243,6 +276,7 @@ public class XiaoShouTest {
                 new ParameterizedTypeReference<List<BaiFangKeHu>>() {}
                 new ParameterizedTypeReference<List<BaiFangKeHu>>() {}
         );
         );
         List<BaiFangKeHu> forObjects = response.getBody();
         List<BaiFangKeHu> forObjects = response.getBody();
+        System.out.println(forObjects);
         for (BaiFangKeHu forObject : forObjects) {
         for (BaiFangKeHu forObject : forObjects) {
             ErpBdOrg forgid = erpBdOrgMapper.selectOne(new QueryWrapper<ErpBdOrg>().eq("forgid", forObject.getFZCORGID()));
             ErpBdOrg forgid = erpBdOrgMapper.selectOne(new QueryWrapper<ErpBdOrg>().eq("forgid", forObject.getFZCORGID()));
             if (ObjectUtil.isEmpty(forgid))
             if (ObjectUtil.isEmpty(forgid))