ccjgmwz 3 years ago
parent
commit
21f1a382cb

+ 4 - 4
pom.xml

@@ -184,9 +184,7 @@
             <properties>
                 <env>local</env>
             </properties>
-            <activation>
-                <activeByDefault>true</activeByDefault>
-            </activation>
+
         </profile>
         <profile>
             <id>dev</id>
@@ -205,7 +203,9 @@
             <properties>
                 <env>prod</env>
             </properties>
-
+            <activation>
+                <activeByDefault>true</activeByDefault>
+            </activation>
         </profile>
     </profiles>
     <build>

+ 2 - 2
winsea-haixin-platform-backend/src/main/resources/application-prod.yml

@@ -1,5 +1,5 @@
 server:
-  port: 8090
+  port: 9100
 
 spring:
   application:
@@ -7,7 +7,7 @@ spring:
   datasource:
     driver-class-name: com.mysql.jdbc.Driver
     password: Ccj841968545
-    url: jdbc:mysql://47.100.3.209:3306/yiliangyiyun_test?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&useSSL=false&serverTimezone=Asia/Shanghai
+    url: jdbc:mysql://47.100.3.209:3306/ylyy?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&useSSL=false&serverTimezone=Asia/Shanghai
     username: root
   redis:
     database: 0

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

@@ -31,6 +31,11 @@ public class WarehouseBaseInfo extends BaseModel<WarehouseBaseInfo> {
 
     private static final long serialVersionUID = 1L;
 
+    /**
+     * 仓位列表
+     */
+    @TableField(exist = false)
+    private List<WarehousePositionInfo> positionInfos;
     /**
      * 主键
      */

+ 25 - 5
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/CommonUserServiceImpl.java

@@ -6,12 +6,10 @@ import com.baomidou.mybatisplus.mapper.EntityWrapper;
 import com.baomidou.mybatisplus.plugins.Page;
 import com.google.common.collect.Lists;
 import com.google.common.collect.Sets;
+import com.winsea.svc.base.base.entity.CommonCompany;
 import com.winsea.svc.base.base.entity.CommonDepartment;
 import com.winsea.svc.base.base.entity.CommonStaff;
-import com.winsea.svc.base.base.service.ICommonDepartmentService;
-import com.winsea.svc.base.base.service.ICommonRoleService;
-import com.winsea.svc.base.base.service.ICommonStaffService;
-import com.winsea.svc.base.base.service.ICommonTenantService;
+import com.winsea.svc.base.base.service.*;
 import com.winsea.svc.base.security.config.SecurityProperties;
 import com.winsea.svc.base.security.config.shiro.ShiroRealm;
 import com.winsea.svc.base.security.entity.Account;
@@ -88,6 +86,8 @@ public class CommonUserServiceImpl extends ServiceImpl<CommonUserMapper, CommonU
 
     @Autowired
     private ICommonStaffService commonStaffService;
+    @Autowired
+    private ICommonCompanyService commonCompanyService;
 
     @Autowired
     private INoticeBusinessConstantService businessConstantService;
@@ -166,6 +166,13 @@ public class CommonUserServiceImpl extends ServiceImpl<CommonUserMapper, CommonU
         if (commonStaff != null) {
             user.setRoleIds(commonStaff.getMajorRoleId());
             user.setId(commonStaff.getStaffId());
+            CommonCompany commonCompany = commonCompanyService.selectById(commonStaff.getCompId());
+            if(commonCompany != null){
+                user.setUserName(commonCompany.getCompName() + "-" +commonStaff.getStaffName());
+            }
+        }
+        else{
+            user.setUserName("用户"+commonUser.getPhone().substring(0, 3) + "****" + commonUser.getPhone().substring(7));
         }
         user.setPassword(Md5Crypt.md5Crypt(commonUser.getPassword().getBytes(), "$1$" + commonUser.getPhone().substring(0, 7)));
         this.insert(user);
@@ -309,7 +316,20 @@ public class CommonUserServiceImpl extends ServiceImpl<CommonUserMapper, CommonU
         CommonUser userDO = new CommonUser();
 
         if (CollectionUtils.isEmpty(targetUserList)) {
-            userDO.setUserName("临时用户");
+            //  查询pc 是否有账号
+            CommonStaff commonStaff = commonStaffService.selectOne(new EntityWrapper<CommonStaff>()
+                    .eq("staff_mobile_phone", commonUser.getPhone()).eq("enabled", "1"));
+            if (commonStaff != null) {
+                userDO.setRoleIds(commonStaff.getMajorRoleId());
+                userDO.setId(commonStaff.getStaffId());
+                CommonCompany commonCompany = commonCompanyService.selectById(commonStaff.getCompId());
+                if(commonCompany != null){
+                    userDO.setUserName(commonCompany.getCompName() + "-" +commonStaff.getStaffName());
+                }
+            }
+            else{
+                userDO.setUserName("用户"+commonUser.getPhone().substring(0, 3) + "****" + commonUser.getPhone().substring(7));
+            }
             userDO.setPhone(commonUser.getPhone());
             userDO.setCid(commonUser.getCid());
             userDO.setPassword(Md5Crypt.md5Crypt(password.getBytes(), "$1$" + commonUser.getPhone().substring(0, 7)));

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

@@ -84,17 +84,13 @@ public class WarehouseBaseInfoServiceImpl extends ServiceImpl<WarehouseBaseInfoM
 
         List<WarehouseView> warehouseViews = new ArrayList<>();
         Wrapper<WarehouseBaseInfo> warehouseBaseInfoWrapper = new EntityWrapper<>();
-        Wrapper<WarehouseBaseInfo> wrapper = new EntityWrapper<>();
         warehouseBaseInfoWrapper.eq(WarehouseBaseInfo.QueryFiles.COMP_ID, compId)
                 .eq(WarehouseBaseInfo.QueryFiles.DELETE_FLAG, NumberConstant.CONSTANT0)
                 .eq(WarehouseBaseInfo.QueryFiles.SHOW_FLAG, NumberConstant.CONSTANT1);
-        wrapper.eq(WarehouseBaseInfo.QueryFiles.COMP_ID, compId)
-                .eq(WarehouseBaseInfo.QueryFiles.DELETE_FLAG, NumberConstant.CONSTANT0)
-                .eq(WarehouseBaseInfo.QueryFiles.SHOW_FLAG, NumberConstant.CONSTANT1);
         if (!StringUtils.isEmpty(warehouseName)) {
             warehouseBaseInfoWrapper.like(WarehouseBaseInfo.QueryFiles.WAREHOUSE_NAME, "%" + warehouseName + "%");
-            wrapper.like(WarehouseBaseInfo.QueryFiles.WAREHOUSE_NAME, "%" + warehouseName + "%");
         }
+        //PC端用
         if(!StringUtils.isEmpty(warehouseType)){
             if(!personCharge.equals("13333333333")){
                 warehouseBaseInfoWrapper.andNew().eq("person_phone", personCharge).or()
@@ -304,217 +300,6 @@ public class WarehouseBaseInfoServiceImpl extends ServiceImpl<WarehouseBaseInfoM
 
             }
         }
-        else{
-            if(!personCharge.equals("13333333333")){
-                warehouseBaseInfoWrapper.andNew().eq("person_phone", personCharge).or()
-                        .like("other_person_charge", personCharge);
-                wrapper.andNew().eq("person_phone", personCharge).or()
-                        .like("other_person_charge", personCharge);
-            }
-            warehouseBaseInfoWrapper.eq(WarehouseBaseInfo.QueryFiles.WAREHOUSE_TYPE, "1");
-            // 查出常用仓库
-            List<WarehouseBaseInfo> warehouseBaseInfoList = this.selectList(warehouseBaseInfoWrapper);
-            if (!CollectionUtils.isEmpty(warehouseBaseInfoList)) {
-                for (WarehouseBaseInfo warehouseBaseInfo : warehouseBaseInfoList) {
-                    // 以库位为维度查询
-                    List<WarehousePositionInfo> warehousePositionInfos = warehousePositionInfoService.selectList(new EntityWrapper<WarehousePositionInfo>()
-                            .eq("base_id", warehouseBaseInfo.getId()));
-                    if (!CollectionUtils.isEmpty(warehousePositionInfos)) {
-                        for (WarehousePositionInfo warehousePositionInfo : warehousePositionInfos) {
-                            WarehouseView warehouseView = new WarehouseView();
-                            warehouseView.setWarehouseId(warehouseBaseInfo.getId());
-                            warehouseView.setWarehouseName(warehouseBaseInfo.getWarehouseName());
-                            warehouseView.setBinNumberId(warehousePositionInfo.getId());
-                            warehouseView.setBinNumber(warehousePositionInfo.getBinNumber());
-                            warehouseView.setCapacity(String.valueOf(warehousePositionInfo.getMaxStorage()));
-                            warehouseView.setRemark(warehousePositionInfo.getRemark());
-                            // 定义待完成数量
-                            int count = 0;
-                            // 定义应余量
-                            String storage = "";
-                            //定义入库
-                            String inNetWeight = "";
-                            // 子集合
-                            List<WarehouseNumView> warehouseNumViewList = new ArrayList<>();
-                            // 查询入库数量
-                            List<WarehouseInOutInfo> warehouseInOutInfoList = warehouseInOutInfoService.selectList(new EntityWrapper<WarehouseInOutInfo>()
-                                    .eq("position_id", warehousePositionInfo.getId()).eq("status_flag", "3").eq("in_out_flag", "2").groupBy("goods_name_key").orderBy("goods_name_key"));
-                            if (!CollectionUtils.isEmpty(warehouseInOutInfoList)) {
-                                for (WarehouseInOutInfo warehouseInOutInfo : warehouseInOutInfoList) {
-                                    WarehouseNumView warehouseNumView = new WarehouseNumView();
-                                    // 查询入库数量
-                                    List<WarehouseInOutInfo> warehouseInOutInfoAllList = warehouseInOutInfoService.selectList(new EntityWrapper<WarehouseInOutInfo>()
-                                            .eq("position_id", warehousePositionInfo.getId()).eq("in_out_flag", "2")
-                                            .eq("status_flag", "3").eq("goods_name_key", warehouseInOutInfo.getGoodsNameKey()));
-
-                                    if (!CollectionUtils.isEmpty(warehouseInOutInfoAllList)) {
-                                        Float netWeight = 0f;
-                                        for (WarehouseInOutInfo warehouse : warehouseInOutInfoAllList) {
-                                            netWeight = netWeight + warehouse.getNetWeight();
-                                        }
-                                        warehouseNumView.setGoodsName(warehouseInOutInfoAllList.get(0).getGoodsName());
-                                        warehouseNumView.setInNetWeight(String.valueOf(netWeight));
-                                        if (StringUtils.isEmpty(inNetWeight)) {
-                                            inNetWeight = "0";
-                                        }
-                                        inNetWeight = String.valueOf(Float.valueOf(inNetWeight) + netWeight);
-                                    }
-                                    // 查询应余量
-                                    WarehousePositionStorageInfo warehousePositionStorageInfo = warehousePositionStorageInfoService.selectOne(new EntityWrapper<WarehousePositionStorageInfo>()
-                                            .eq("position_id", warehouseInOutInfo.getPositionId()).eq("goods_name_key", warehouseInOutInfo.getGoodsNameKey()));
-                                    if (warehousePositionStorageInfo != null) {
-                                        storage = String.valueOf(warehousePositionStorageInfo.getStorage());
-                                    } else {
-                                        storage = "";
-                                    }
-                                    warehouseNumView.setStorage(storage);
-                                    warehouseNumViewList.add(warehouseNumView);
-                                }
-
-                            }
-
-                            //定义出库
-                            String outNetWeight = "";
-                            // 查询出库数量
-                            List<WarehouseInOutInfo> warehouseInOutInfos = warehouseInOutInfoService.selectList(new EntityWrapper<WarehouseInOutInfo>()
-                                    .eq("position_id", warehousePositionInfo.getId()).eq("status_flag", "3").eq("in_out_flag", "1").groupBy("goods_name_key").orderBy("goods_name_key"));
-                            if (!CollectionUtils.isEmpty(warehouseInOutInfos)) {
-                                for (WarehouseInOutInfo warehouseInOutInfo : warehouseInOutInfos) {
-                                    Float netWeight = 0f;
-                                    outNetWeight = "0";
-                                    List<WarehouseInOutInfo> warehouseInOutInfoAllList = warehouseInOutInfoService.selectList(new EntityWrapper<WarehouseInOutInfo>()
-                                            .eq("status_flag", "3").eq("position_id", warehousePositionInfo.getId()).eq("in_out_flag", "1").eq("goods_name_key", warehouseInOutInfo.getGoodsNameKey()));
-                                    if (!CollectionUtils.isEmpty(warehouseInOutInfoAllList)) {
-                                        for (WarehouseInOutInfo warehouse : warehouseInOutInfoAllList) {
-                                            netWeight = netWeight + warehouse.getNetWeight();
-                                        }
-                                        if (StringUtils.isEmpty(outNetWeight)) {
-                                            outNetWeight = "0";
-                                        }
-                                        outNetWeight = String.valueOf(Float.valueOf(outNetWeight) + netWeight);
-                                    }
-                                    for (WarehouseNumView warehouseNumView : warehouseNumViewList) {
-                                        if (warehouseNumView.getGoodsName().equals(warehouseInOutInfo.getGoodsName())) {
-                                            warehouseNumView.setOutNetWeight(outNetWeight);
-                                        }
-
-                                    }
-                                }
-
-                            }
-                            // 查询入库数量
-                            count = warehouseInOutInfoService.selectCount(new EntityWrapper<WarehouseInOutInfo>()
-                                    .eq("position_id", warehousePositionInfo.getId())
-                                    .eq("status_flag", "1"));
-                            warehouseView.setNumber(count);
-                            warehouseView.setWarehouseNumViewList(warehouseNumViewList);
-                            warehouseViews.add(warehouseView);
-
-                        }
-                    }
-                }
-
-            }
-            // 查出临时仓库
-            wrapper.eq(WarehouseBaseInfo.QueryFiles.WAREHOUSE_TYPE, "2");
-            warehouseBaseInfoList = this.selectList(wrapper);
-            if (!CollectionUtils.isEmpty(warehouseBaseInfoList)) {
-                for (WarehouseBaseInfo warehouseBaseInfo : warehouseBaseInfoList) {
-                    WarehouseView warehouseView = new WarehouseView();
-                    warehouseView.setWarehouseId(warehouseBaseInfo.getId());
-                    warehouseView.setCreateType(warehouseBaseInfo.getCreateType());
-                    warehouseView.setClearStatus(warehouseBaseInfo.getClearStatus());
-                    warehouseView.setClearStatusFlag(warehouseBaseInfo.getClearStatusFlag());
-                    warehouseView.setWarehouseName(warehouseBaseInfo.getWarehouseName());
-                    warehouseView.setUpdateDate(warehouseBaseInfo.getUpdateDate());
-                    warehouseView.setAddress(warehouseBaseInfo.getWarehousePrivate() + warehouseBaseInfo.getWarehouseCity() + warehouseBaseInfo.getWarehouseArea() + warehouseBaseInfo.getDetailedAddress());
-                    // 定义待完成数量
-                    int count = 0;
-                    //定义入库
-                    String inNetWeight = "";
-                    // 子集合
-                    List<WarehouseNumView> warehouseNumViewList = new ArrayList<>();
-                    // 查询入库数量
-                    List<WarehouseInOutInfo> warehouseInOutInfoList = warehouseInOutInfoService.selectList(new EntityWrapper<WarehouseInOutInfo>()
-                            .eq("base_id", warehouseBaseInfo.getId()).eq("status_flag", "3").eq("in_out_flag", "2").groupBy("goods_name_key").orderBy("goods_name_key"));
-                    if (!CollectionUtils.isEmpty(warehouseInOutInfoList)) {
-                        for (WarehouseInOutInfo warehouseInOutInfo : warehouseInOutInfoList) {
-                            WarehouseNumView warehouseNumView = new WarehouseNumView();
-                            // 查询入库数量
-                            List<WarehouseInOutInfo> warehouseInOutInfoAllList = warehouseInOutInfoService.selectList(new EntityWrapper<WarehouseInOutInfo>()
-                                    .eq("base_id", warehouseBaseInfo.getId()).eq("in_out_flag", "2")
-                                    .eq("status_flag", "3").eq("goods_name_key", warehouseInOutInfo.getGoodsNameKey()));
-
-                            if (!CollectionUtils.isEmpty(warehouseInOutInfoAllList)) {
-                                Float netWeight = 0f;
-                                for (WarehouseInOutInfo warehouse : warehouseInOutInfoAllList) {
-                                    netWeight = netWeight + warehouse.getNetWeight();
-                                }
-                                warehouseNumView.setGoodsName(warehouseInOutInfoAllList.get(0).getGoodsName());
-                                warehouseNumView.setInNetWeight(String.valueOf(netWeight));
-                                if (StringUtils.isEmpty(inNetWeight)) {
-                                    inNetWeight = "0";
-                                }
-                                inNetWeight = String.valueOf(Float.valueOf(inNetWeight) + netWeight);
-                            }
-                            warehouseNumViewList.add(warehouseNumView);
-                        }
-
-                    }
-
-                    //定义出库
-                    String outNetWeight = "";
-                    // 查询出库数量
-                    List<WarehouseInOutInfo> warehouseInOutInfos = warehouseInOutInfoService.selectList(new EntityWrapper<WarehouseInOutInfo>()
-                            .eq("base_id", warehouseBaseInfo.getId()).eq("status_flag", "3").eq("in_out_flag", "1").groupBy("goods_name_key").orderBy("goods_name_key"));
-                    if (!CollectionUtils.isEmpty(warehouseInOutInfos)) {
-                        for (WarehouseInOutInfo warehouseInOutInfo : warehouseInOutInfos) {
-                            Float netWeight = 0f;
-                            outNetWeight = "0";
-                            List<WarehouseInOutInfo> warehouseInOutInfoAllList = warehouseInOutInfoService.selectList(new EntityWrapper<WarehouseInOutInfo>()
-                                    .eq("status_flag", "3").eq("base_id", warehouseBaseInfo.getId()).eq("in_out_flag", "1").eq("goods_name_key", warehouseInOutInfo.getGoodsNameKey()));
-                            if (!CollectionUtils.isEmpty(warehouseInOutInfoAllList)) {
-                                for (WarehouseInOutInfo warehouse : warehouseInOutInfoAllList) {
-                                    netWeight = netWeight + warehouse.getNetWeight();
-                                }
-                                if (StringUtils.isEmpty(outNetWeight)) {
-                                    outNetWeight = "0";
-                                }
-                                outNetWeight = String.valueOf(Float.valueOf(outNetWeight) + netWeight);
-                            }
-                            for (WarehouseNumView warehouseNumView : warehouseNumViewList) {
-                                if (warehouseNumView.getGoodsName().equals(warehouseInOutInfo.getGoodsName())) {
-                                    warehouseNumView.setOutNetWeight(outNetWeight);
-                                }
-
-                            }
-                        }
-
-                    }
-                    // 查询入库数量
-                    count = warehouseInOutInfoService.selectCount(new EntityWrapper<WarehouseInOutInfo>()
-                            .eq("base_id", warehouseBaseInfo.getId())
-                            .eq("status_flag", "1"));
-                    warehouseView.setNumber(count);
-                    // 定义待完成数量
-                    int outCount = 0;
-                    outCount = warehouseInOutInfoService.selectCount(new EntityWrapper<WarehouseInOutInfo>()
-                            .eq("base_id", warehouseBaseInfo.getId())
-                            .eq("in_out_flag", "1")
-                            .eq("status_flag", "1"));
-                    warehouseView.setOutNumber(outCount);
-                    warehouseView.setWarehouseNumViewList(warehouseNumViewList);
-                    warehouseViews.add(warehouseView);
-                    // 排序
-//                    Comparator<WarehouseView> byClearStatusFlag = Comparator.comparing(WarehouseView::getClearStatusFlag);
-//                    Comparator<WarehouseView> byUpdateDate = Comparator.comparing(WarehouseView::getUpdateDate);
-//                    warehouseViews.sort(byUpdateDate);
-                }
-            }
-        }
-
-
-
         return warehouseViews;
     }
 
@@ -1042,6 +827,17 @@ public class WarehouseBaseInfoServiceImpl extends ServiceImpl<WarehouseBaseInfoM
                 }
             }
         }
+        if (!CollectionUtils.isEmpty(warehouseBaseInfoList)) {
+            for (WarehouseBaseInfo warehouseBaseInfo : warehouseBaseInfoList) {
+                // 以库位为维度查询
+                List<WarehousePositionInfo> warehousePositionInfos = warehousePositionInfoService.selectList(new EntityWrapper<WarehousePositionInfo>()
+                        .eq("base_id", warehouseBaseInfo.getId()));
+                if (!CollectionUtils.isEmpty(warehousePositionInfos)) {
+                    warehouseBaseInfo.setPositionInfos(warehousePositionInfos);
+                }
+            }
+
+        }
         return warehouseBaseInfoList;
     }
 }