zhangyuewww 2 år sedan
förälder
incheckning
ca0655b57e

+ 6 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/entity/SpeedGoodsInfo.java

@@ -2,6 +2,7 @@ package com.yh.saas.plugin.yiliangyiyun.entity;
 
 import java.io.Serializable;
 
+import com.baomidou.mybatisplus.annotations.TableField;
 import com.baomidou.mybatisplus.annotations.TableId;
 
 import com.baomidou.mybatisplus.annotations.TableName;
@@ -52,6 +53,11 @@ public class SpeedGoodsInfo extends BaseModel<SpeedGoodsInfo> {
      * 加权成本(元/吨)
      */
     private Double weightedCost;
+    /**
+     * 设为默认标识
+     */
+    @TableField(exist = false)
+    private String flag;
 
 
     @Override

+ 13 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/SpeedGoodsInfoServiceImpl.java

@@ -7,6 +7,7 @@ import com.yh.saas.plugin.yiliangyiyun.mapper.SpeedGoodsInfoMapper;
 import com.yh.saas.plugin.yiliangyiyun.service.ISpeedGoodsInfoService;
 import com.baomidou.mybatisplus.service.impl.ServiceImpl;
 import org.springframework.stereotype.Service;
+import org.springframework.util.CollectionUtils;
 
 import java.util.List;
 
@@ -44,6 +45,18 @@ public class SpeedGoodsInfoServiceImpl extends ServiceImpl<SpeedGoodsInfoMapper,
 
     @Override
     public String editInfo(SpeedGoodsInfo speedGoodsInfo) {
+        if ("1".equals(speedGoodsInfo.getFlag())){
+            SpeedGoodsInfo speedGoodsInfo1=this.selectById(speedGoodsInfo.getId());
+            List<SpeedGoodsInfo> speedGoodsInfoList=this.selectList(new EntityWrapper<SpeedGoodsInfo>()
+                    .eq("comp_id",speedGoodsInfo1.getCompId()));
+            if (!CollectionUtils.isEmpty(speedGoodsInfoList)){
+                for (SpeedGoodsInfo speedGoodsInfo2:speedGoodsInfoList){
+                    speedGoodsInfo2.setSetDefault("0");
+                    this.updateById(speedGoodsInfo2);
+                }
+            }
+            speedGoodsInfo.setSetDefault("1");
+        }
         this.updateById(speedGoodsInfo);
         return "ok";
     }

+ 10 - 1
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/SpeedWarehouseInOutInfoServiceImpl.java

@@ -105,8 +105,10 @@ public class SpeedWarehouseInOutInfoServiceImpl extends ServiceImpl<SpeedWarehou
                 no = "RK" + df.format(new Date()) + newNo;
             } else if ("PY".equals(speedWarehouseInOutInfo.getNoFlag())){
                 no = "PY" + df.format(new Date()) + newNo;
+                speedWarehouseInOutInfo.setCarNumber("盘盈");
             }else{
                 no = "PK" + df.format(new Date()) + newNo;
+                speedWarehouseInOutInfo.setCarNumber("盘亏");
             }
             speedWarehouseInOutInfo.setBusinessNo(no);
             //出库
@@ -644,7 +646,14 @@ public class SpeedWarehouseInOutInfoServiceImpl extends ServiceImpl<SpeedWarehou
                 cell.setCellValue(editString(speedWarehouseInOutInfo1.getPositionNo()));
                 cell.setCellStyle(styleDetail);
                 cell = rowx.createCell(3);
-                cell.setCellValue(editString(speedWarehouseInOutInfo1.getInOutFlag()));
+                String inOutFlag="";
+                if ("1".equals(speedWarehouseInOutInfo1.getInOutFlag())){
+                    inOutFlag="出库";
+                }
+                else{
+                    inOutFlag="入库";
+                }
+                cell.setCellValue(editString(inOutFlag));
                 cell.setCellStyle(styleDetail);
                 cell = rowx.createCell(4);
                 cell.setCellValue(editString(speedWarehouseInOutInfo1.getCarNumber()));

+ 16 - 1
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/WarehouseBaseInfoServiceImpl.java

@@ -878,7 +878,7 @@ public class WarehouseBaseInfoServiceImpl extends ServiceImpl<WarehouseBaseInfoM
             cacheComponent.putRaw(Const.ADMIN_CONTRACTINFO + compId + flag, JSONObject.toJSONString(temp), 60 * 60 * 24);
             return temp;
         }
-        //查销售合同编号
+        //查销售合同编号、代储合同
         else if (flag == 1) {
 
             List<ContractManagementInfo> contractManagementInfoList = contractManagementInfoService.selectList(new EntityWrapper<ContractManagementInfo>()
@@ -895,6 +895,21 @@ public class WarehouseBaseInfoServiceImpl extends ServiceImpl<WarehouseBaseInfoM
                 contractManagementInfo.setGoodsNameKey(contractGoodsInfo.getGoodsNameKey());
                 temp.add(contractManagementInfo);
             }
+            List<ContractManagementInfo> contractManagementInfoList1 = contractManagementInfoService.selectList(new EntityWrapper<ContractManagementInfo>()
+                    .eq("comp_id", compId)
+                    .eq("contract_type", "2")
+                    .eq("agreement_type", "代储合同")
+                    .eq("status_flag", "1")
+                    .eq("delete_flag", "0")
+                    .orderBy("update_date", false));
+
+            for (ContractManagementInfo contractManagementInfo : contractManagementInfoList1) {
+                ContractGoodsInfo contractGoodsInfo = contractGoodsInfoService.selectOne(new EntityWrapper<ContractGoodsInfo>()
+                        .eq("contract_id", contractManagementInfo.getId()));
+                contractManagementInfo.setGoodsName(contractGoodsInfo.getGoodsName());
+                contractManagementInfo.setGoodsNameKey(contractGoodsInfo.getGoodsNameKey());
+                temp.add(contractManagementInfo);
+            }
             cacheComponent.putRaw(Const.ADMIN_CONTRACTINFO + compId + flag, JSONObject.toJSONString(temp), 60 * 60 * 24);
             return temp;
         }

+ 13 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/SpeedWarehouseInOutInfoMapper.xml

@@ -23,6 +23,12 @@
             <if test="searchType == 2">
                 AND in_out_flag ='1'
             </if>
+            <if test="searchType == 3">
+                AND( in_out_flag ='2' and car_number!='盘盈')
+            </if>
+            <if test="searchType == 4">
+                AND( in_out_flag ='1' and car_number!='盘亏')
+            </if>
         </if>
         <if test="startDate != null">
             AND (DATE_FORMAT(create_date ,"%Y%m%d") >=
@@ -80,6 +86,12 @@
             <if test="searchType == 2">
                 AND in_out_flag ='1'
             </if>
+            <if test="searchType == 3">
+                AND( in_out_flag ='2' and car_number!='盘盈')
+            </if>
+            <if test="searchType == 4">
+                AND( in_out_flag ='1' and car_number!='盘亏')
+            </if>
         </if>
         <if test="startDate != null">
             AND (DATE_FORMAT(create_date ,"%Y%m%d") >=
@@ -89,6 +101,7 @@
             AND (DATE_FORMAT(create_date ,"%Y%m%d") &lt;=
             DATE_FORMAT(#{endDate},"%Y%m%d"))
         </if>
+        ORDER BY create_date DESC
     </select>
     <select id="getTodayCount" parameterType="Map" resultType="java.lang.Integer">
         SELECT