ysh 2 years ago
parent
commit
ea1bc161f1

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

@@ -377,7 +377,8 @@ public class PurchaseWarehousingServiceImpl extends ServiceImpl<PurchaseWarehous
 //                this.baseMapper.saveRdRecord01One(map); //主表新增
 
                 //由于前期是自己插入U8数据库 后前改变方式先择调用第三方插入接口 所以需要把字段名整体转换成第三方的
-                JSONArray resturn =InterfaceConnUtils.doPost(saveRdRecord01JSON(map,itemList,accID),"purchaseinlist_batch_get");
+//                JSONArray resturn =InterfaceConnUtils.doPost(saveRdRecord01JSON(map,itemList,accID),"purchaseinlist_batch_get");
+                JSONArray resturn =InterfaceConnUtils.doPost(saveRdRecord01JSON(map,itemList,accID),"purchasein_import");
                 if(resturn.getJSONObject(0).get("Result").equals("T")){
                     //成功
                     //调拨单

+ 67 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/productionScheduleReport/controller/ProductionScheduleController.java

@@ -11,6 +11,8 @@ import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.aspect.annotation.AutoLog;
 import org.jeecg.common.system.query.QueryGenerator;
 import org.jeecg.modules.productionScheduleReport.entity.ProductionSchedule;
+import org.jeecg.modules.productionScheduleReport.entity.ProductionScheduleCaiGou;
+import org.jeecg.modules.productionScheduleReport.entity.ProductionScheduleWeiWai;
 import org.jeecg.modules.productionScheduleReport.service.ProductionScheduleService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -88,6 +90,71 @@ public class ProductionScheduleController {
         return result;
     }
 
+    /**
+     * 生产进度报表-查看详情
+     * @param soCode 销售订单号
+     * @param marCode 存货编码
+     * @param itemNumber 款号
+     * @param color 颜色
+     * @param planCode 计划号
+     * @return
+     */
+    @AutoLog(value = "生产进度报表-查看详情")
+    @ApiOperation(value="生产进度报表-查看详情", notes="生产进度报表-查看详情")
+    @GetMapping(value = "/getView")
+    public Result<ProductionSchedule> getView(String soCode,String marCode,String itemNumber,String color,String planCode){
+        Result<ProductionSchedule> result = new Result<ProductionSchedule>();
+        result.setSuccess(false);
+        if(!StringUtils.isNotBlank(soCode)){
+            result.setMessage("销售订单号不能为空");
+            return result;
+        }
+        if(!StringUtils.isNotBlank(marCode)){
+            result.setMessage("存货编码不能为空");
+            return result;
+        }
+        if(!StringUtils.isNotBlank(itemNumber)){
+            result.setMessage("款号不能为空");
+            return result;
+        }
+        if(!StringUtils.isNotBlank(color)){
+            result.setMessage("颜色不能为空");
+            return result;
+        }
+        if(!StringUtils.isNotBlank(planCode)){
+            result.setMessage("计划号不能为空");
+            return result;
+        }
+        QueryWrapper<ProductionSchedule> queryWrapper = new QueryWrapper<>();
+
+        queryWrapper.eq("len(f.cInvCCode)",6);
+        queryWrapper.eq("a.cSOCode",soCode);
+        queryWrapper.eq("b.cInvCode",marCode);
+        queryWrapper.eq("b.cDefine22",itemNumber);
+        queryWrapper.eq("b.cFree1",color);
+        queryWrapper.eq("p.PlanCode",planCode);
+
+        ProductionSchedule entity = new ProductionSchedule();
+        List<ProductionSchedule> list = productionScheduleService.selectByView(queryWrapper); // 详情数据
+        if(list.size() > 0){
+            entity = list.get(0);
+        }
+
+        //根据计划号 查询采购订单
+        List<ProductionScheduleCaiGou> selectCaiGou = productionScheduleService.selectCaiGou(planCode);
+        entity.setProductionScheduleCaiGou(selectCaiGou);
+        //根据计划号查询委外订单
+        List<ProductionScheduleWeiWai> selectWeiWai = productionScheduleService.selectWeiWai(planCode);
+        entity.setProductionScheduleWeiWai(selectWeiWai);
+
+        result.setResult(entity);
+
+        result.setSuccess(true);
+        return result;
+    }
+
+
+
     @AutoLog(value = "生产进度报表-查看图片")
     @ApiOperation(value="生产进度报表-查看图片", notes="生产进度报表-查看图片,根据图片id查询图片流")
     @GetMapping(value = "/selectPicture")

+ 7 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/modules/productionScheduleReport/entity/ProductionSchedule.java

@@ -3,8 +3,10 @@ package org.jeecg.modules.productionScheduleReport.entity;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
+import java.util.List;
+
 /**
- * 生产进度报表
+ * 生产进度报表(汇总数据)
  */
 @Data
 public class ProductionSchedule {
@@ -54,4 +56,8 @@ public class ProductionSchedule {
     private String pictureId;//图片id
     @ApiModelProperty(value = "图片流")
     private byte[] picture;//图片流
+    @ApiModelProperty(value = "生产进度报表(委外订单数据)")
+    private List<ProductionScheduleWeiWai> productionScheduleWeiWai;
+    @ApiModelProperty(value = "生产进度报表(采购订单数据)")
+    private List<ProductionScheduleCaiGou> ProductionScheduleCaiGou;
 }

+ 29 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/productionScheduleReport/entity/ProductionScheduleCaiGou.java

@@ -0,0 +1,29 @@
+package org.jeecg.modules.productionScheduleReport.entity;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+ * 生产进度报表(详情采购订单)
+ */
+@Data
+public class ProductionScheduleCaiGou {
+    @ApiModelProperty(value = "采购订单号")
+    private String cPOID;// 采购订单号
+    @ApiModelProperty(value = "供应商名称")
+    private String cVenName;// ;// 供应商名称
+    @ApiModelProperty(value = "存货编码")
+    private String cInvCode ;// 存货编码
+    @ApiModelProperty(value = "存货名称")
+    private String cInvName ;// 存货名称
+    @ApiModelProperty(value = "本币单价")
+    private String iNatUnitPrice ;// 本币单价
+    @ApiModelProperty(value = "计划数量(lrp)")
+    private String iQuantityLrp;// 计划数量(lrp)
+    @ApiModelProperty(value = "数量")
+    private String iQuantity ;//数量
+    @ApiModelProperty(value = "使用数量")
+    private String iReceivedQTY ;// 使用数量
+    @ApiModelProperty(value = "余料")
+    private String surplusQty ;// 余料
+}

+ 57 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/productionScheduleReport/entity/ProductionScheduleWeiWai.java

@@ -0,0 +1,57 @@
+package org.jeecg.modules.productionScheduleReport.entity;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+ * 生产进度报表(委外订单数据)
+ */
+@Data
+public class ProductionScheduleWeiWai {
+
+    @ApiModelProperty(value = "委外订单号")
+    private String cCode;
+    @ApiModelProperty(value = "供应商名称")
+    private String cVenName;
+    @ApiModelProperty(value = "物料编码")
+    private String cInvCode;
+    @ApiModelProperty(value = "存货名称")
+    private String cInvName;
+    @ApiModelProperty(value = "颜色")
+    private String color;
+    @ApiModelProperty(value = "门幅")
+    private String cFree4;
+    @ApiModelProperty(value = "原币单价")
+    private String iUnitPrice;
+    @ApiModelProperty(value = "本币单价")
+    private String iNatUnitPrice;
+    @ApiModelProperty(value = "计划数量")
+    private String iQuantityLrp;
+    @ApiModelProperty(value = "数量")
+    private String iQuantity;
+    @ApiModelProperty(value = "累计入库数量")
+    private String iReceivedQTY;
+    @ApiModelProperty(value = "累计开票数量")
+    private String iInvQTY;
+    @ApiModelProperty(value = "累计开票金额")
+    private String iInvMoney;
+    @ApiModelProperty(value = "下游订单")
+    private String csocode;
+    @ApiModelProperty(value = "使用数量")
+    private String iMaterialSendQty;
+    @ApiModelProperty(value = "余料")
+    private String surplusQty;
+    @ApiModelProperty(value = "子件编码")
+    private String cInvCodeZi;
+    @ApiModelProperty(value = "子件名称")
+    private String cInvNameZi;
+    @ApiModelProperty(value = "子件应领数量")
+    private String iQuantityZi;
+    @ApiModelProperty(value = "子件已领数量")
+    private String iSendQTY;
+    @ApiModelProperty(value = "成本")
+    private String costZi;
+    @ApiModelProperty(value = "采购订单号")
+    private String purchaseCode;
+
+}

+ 9 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/productionScheduleReport/mapper/ProductionScheduleMapper.java

@@ -5,6 +5,8 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import org.apache.ibatis.annotations.Param;
 import org.jeecg.modules.productionScheduleReport.entity.ProductionSchedule;
+import org.jeecg.modules.productionScheduleReport.entity.ProductionScheduleCaiGou;
+import org.jeecg.modules.productionScheduleReport.entity.ProductionScheduleWeiWai;
 
 import java.util.List;
 
@@ -18,5 +20,12 @@ public interface ProductionScheduleMapper extends BaseMapper<ProductionSchedule>
 
     IPage<ProductionSchedule> selectByPage(IPage<ProductionSchedule> page, @Param("ew") QueryWrapper<ProductionSchedule> queryWrapper);
 
+    List<ProductionSchedule> selectByPage(@Param("ew") QueryWrapper<ProductionSchedule> queryWrapper);
+
     List<ProductionSchedule> selectPicture(String pictureId);
+
+    List<ProductionScheduleCaiGou> selectCaiGou(String planNumber);
+
+    List<ProductionScheduleWeiWai> selectWeiWai(String planNumber);
+
 }

+ 111 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/productionScheduleReport/mapper/xml/ProductionScheduleMapper.xml

@@ -3,6 +3,56 @@
 <mapper namespace="org.jeecg.modules.productionScheduleReport.mapper.ProductionScheduleMapper">
 
     <select id="selectByPage" resultType="org.jeecg.modules.productionScheduleReport.entity.ProductionSchedule">
+        select -- top 100
+              c.cDepName -- 部门
+             ,d.cPersonName -- 业务员
+             ,a.cSOCode -- 销售订单号
+             ,p.PlanCode planCode-- 计划单号
+             ,e.cCusName -- 客户
+             ,a.cDefine12 -- 成衣加工厂
+             ,b.cInvCode -- 存货编码
+             ,f.cInvName -- 存货名称
+             ,b.cDefine22 itemNumber -- 款号
+             ,b.cFree1 color-- 颜色
+             ,min(a.dPreDateBT) dPreDateBT -- 交期
+             ,sum(b.iQuantity) iQuantity --订单数量
+             ,sum(b.iTaxUnitPrice) iTaxUnitPrice -- 原币含税单价
+             ,sum(b.iSum) total_sum -- 总额(原币)
+             ,sum(b.iNatSum/b.iQuantity) bb_price -- 单价(本币)
+             ,sum(b.iNatSum) iNatSum -- 总额(本币)
+             ,sum(b.icostsum) icostsum -- 实际发票成本
+             ,sum(b.foutquantity) foutquantity --已出库数量
+             ,sum(b.iKPQuantity) iKPQuantity --累计开票数量
+             ,sum(b.iKPMoney) iKPMoney -- 累计开票金额
+             ,f.pictureGUid pictureId -- 图片id
+             ,min(a.dDate) dDate -- 单据日期
+        from SO_SOMain a
+                 left join SO_SODetails b on a.id = b.id
+
+                 left join mps_netdemand m on a.cSOCode = m.SoCode and m.OrgDemSeq = b.iRowNo
+                 left join mps_plancode p on m.ProjectId = p.plancodeid
+
+                 left join Department c on c.cDepCode = a.cDepCode
+                 left join person d on d.cPersonCode = a.cPersonCode
+                 left join Customer e on e.cCusCode = a.cCusCode
+                 left join Inventory f on f.cInvCode = b.cInvCode
+
+            ${ew.customSqlSegment} and p.plancode is not null
+
+        group by
+            c.cDepName -- 部门
+               ,d.cPersonName -- 业务员
+               ,a.cSOCode -- 销售订单号
+               ,e.cCusName -- 客户
+               ,a.cDefine12 -- 成衣加工厂
+               ,b.cInvCode -- 存货编码
+               ,f.cInvName -- 存货名称
+               ,b.cDefine22 -- 款号
+               ,b.cFree1-- 颜色
+               ,f.pictureGUid -- 图片id
+                ,p.PlanCode
+    </select>
+   <select id="selectByPageXXXXX" resultType="org.jeecg.modules.productionScheduleReport.entity.ProductionSchedule">
 
         select --top 100
             c.cDepName -- 部门
@@ -40,4 +90,65 @@
     <select id="selectPicture" resultType="org.jeecg.modules.productionScheduleReport.entity.ProductionSchedule">
         select picture,cPicturetype from aa_picture where cGUid = #{pictureId}
     </select>
+
+    <select id="selectCaiGou" resultType="org.jeecg.modules.productionScheduleReport.entity.ProductionScheduleCaiGou">
+        select
+             '903' accId -- 账套信息
+             ,a.cPOID -- 采购订单号
+			 ,c.cVenName -- 供应商名称
+             ,b.cInvCode -- 存货编码
+             ,b.iNatUnitPrice -- 本币单价
+             ,d.cInvName -- 存货名称
+             ,b.iQuantity iQuantityLrp -- 计划数量(lrp)
+             ,b.iQuantity -- 数量
+             ,b.iReceivedQTY -- 累计入库数量
+             ,b.iInvQTY -- 累计开票数量
+             ,b.iInvMoney -- 累计开票金额
+             ,b.csocode -- 下游订单
+             ,b.iReceivedQTY  -- 使用数量
+             ,b.iQuantity - b.iReceivedQTY as surplusQty -- 余料
+
+        from PO_Pomain a
+                 left join PO_Podetails b on a.POID = b.POID
+                 left join Vendor c on a.cVenCode = c.cVenCode
+                 left join Inventory d on d.cInvCode = b.cInvCode
+        where b.planlotnumber = #{planNumber}
+    </select>
+
+
+    <select id="selectWeiWai" resultType="org.jeecg.modules.productionScheduleReport.entity.ProductionScheduleWeiWai">
+        select
+               '903' accId -- 账套信息
+             ,a.cCode -- 委外订单号
+			 ,c.cVenName -- 供应商名称
+             ,b.cInvCode -- 物料编码
+             ,d.cInvName -- 存货名称
+             ,b.cFree1 color -- 颜色
+             ,b.cFree4 -- 门幅
+             ,b.iUnitPrice -- 原币单价
+             ,b.iNatUnitPrice -- 本币单价
+             ,b.iQuantity iQuantityLrp -- 计划数量
+             ,b.iQuantity -- 数量
+             ,b.iReceivedQTY -- 累计入库数量
+             ,b.iInvQTY -- 累计开票数量
+             ,b.iInvMoney -- 累计开票金额
+             ,b.csocode -- 下游订单
+             ,b.iMaterialSendQty   -- 使用数量
+             ,b.iQuantity - b.iMaterialSendQty as surplusQty -- 余料
+             ,e.cInvCode cInvCodeZi --子件编码
+             ,f.cInvName cInvNameZi -- 子件名称
+             ,e.iQuantity iQuantityZi -- 子件应领数量
+             ,e.iSendQTY -- 子件已领数量
+             ,0 costZi -- 成本
+             ,0 purchaseCode -- 采购订单号
+        from OM_MOMain a
+                 left join OM_MODetails b on a.MOID = b.MOID
+                 left join Vendor c on a.cVenCode = c.cVenCode
+                 left join Inventory d on d.cInvCode = b.cInvCode
+                 left join OM_MOMaterials e on e.MoDetailsID = b.MoDetailsID
+                 left join Inventory f on f.cInvCode = e.cInvCode
+        where b.cPlanLotNumber = #{planNumber}
+    </select>
+
+
 </mapper>

+ 11 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/productionScheduleReport/service/ProductionScheduleService.java

@@ -5,6 +5,8 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.service.IService;
 import org.jeecg.modules.productionScheduleReport.entity.ProductionSchedule;
+import org.jeecg.modules.productionScheduleReport.entity.ProductionScheduleCaiGou;
+import org.jeecg.modules.productionScheduleReport.entity.ProductionScheduleWeiWai;
 
 import java.util.List;
 
@@ -13,5 +15,14 @@ public interface ProductionScheduleService extends IService<ProductionSchedule>
     @DS("multi-three")
     public IPage<ProductionSchedule> selectByPage(IPage<ProductionSchedule> page, QueryWrapper<ProductionSchedule> queryWrapper);
     @DS("multi-three")
+    public List<ProductionSchedule> selectByView(QueryWrapper<ProductionSchedule> queryWrapper);
+    @DS("multi-three")
     public List<ProductionSchedule> selectPicture(String pictureId);
+
+    @DS("multi-three")
+    public List<ProductionScheduleCaiGou> selectCaiGou(String planNumber);
+
+    @DS("multi-three")
+    public List<ProductionScheduleWeiWai> selectWeiWai(String planNumber);
+
 }

+ 21 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/productionScheduleReport/service/impl/ProductionScheduleImpl.java

@@ -5,6 +5,8 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.jeecg.modules.productionScheduleReport.entity.ProductionSchedule;
+import org.jeecg.modules.productionScheduleReport.entity.ProductionScheduleCaiGou;
+import org.jeecg.modules.productionScheduleReport.entity.ProductionScheduleWeiWai;
 import org.jeecg.modules.productionScheduleReport.mapper.ProductionScheduleMapper;
 import org.jeecg.modules.productionScheduleReport.service.ProductionScheduleService;
 import org.springframework.stereotype.Service;
@@ -24,9 +26,28 @@ public class ProductionScheduleImpl extends ServiceImpl<ProductionScheduleMapper
         return productionScheduleMapper.selectByPage(page, queryWrapper);
     }
 
+    @Override
+    @DS("multi-three")
+    public List<ProductionSchedule> selectByView(QueryWrapper<ProductionSchedule> queryWrapper){
+        return productionScheduleMapper.selectByPage(queryWrapper);
+    }
+
     @Override
     @DS("multi-three")
     public List<ProductionSchedule> selectPicture(String pictureId){
         return productionScheduleMapper.selectPicture(pictureId);
     }
+
+    @Override
+    @DS("multi-three")
+    public List<ProductionScheduleCaiGou> selectCaiGou(String planNumber){
+        return productionScheduleMapper.selectCaiGou(planNumber);
+    }
+
+    @Override
+    @DS("multi-three")
+    public List<ProductionScheduleWeiWai> selectWeiWai(String planNumber){
+        return productionScheduleMapper.selectWeiWai(planNumber);
+    }
+
 }

+ 11 - 0
jeecg-boot-module-system/src/main/resources/application-cuidian.yml

@@ -141,6 +141,17 @@ spring:
           username: cuidian
           password: cuidianUFdata
           driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
+        multi-two:
+          url: jdbc:sqlserver://106.15.32.1:1433;SelectMethod=cursor;DatabaseName=UFDATA
+          username: cuidian
+          password: cuidianUFdata
+          driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
+        multi-three:
+          url: jdbc:sqlserver://106.15.32.1:1433;SelectMethod=cursor;DatabaseName=UFDATA
+          username: cuidian
+          password: cuidianUFdata
+          driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
+
   #redis 配置
   redis:
     database: 0