zhangyuewww преди 3 години
родител
ревизия
a4d3414f05

+ 2 - 1
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/entity/WeighingManagement.java

@@ -246,7 +246,8 @@ public class WeighingManagement extends BaseModel<WeighingManagement> {
      */
     @TableField(exist = false)
     private QualityInspectionManagement qualityInspectionManagement;
-
+    @TableField(exist = false)
+    private PaymentManagement paymentManagement;
 
     @Override
     protected Serializable pkVal() {

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

@@ -68,6 +68,16 @@ public class IdentityAuthenticationInfoServiceImpl extends ServiceImpl<IdentityA
         }
         Page<IdentityAuthenticationInfo> recommendedIdentityAuthenticationInfoPage = this.selectPage(identityAuthenticationInfo.getQueryPage(), identityAuthenticationInfoWrapper);
         List<IdentityAuthenticationInfo> identityAuthenticationInfoList = recommendedIdentityAuthenticationInfoPage.getRecords();
+        if (CollectionUtils.isNotEmpty(identityAuthenticationInfoList)){
+            for (IdentityAuthenticationInfo identityAuthenticationInfo1:identityAuthenticationInfoList){
+                CommonCompanyIdentity commonCompanyIdentity = iCommonCompanyIdentityService.selectOne(new EntityWrapper<CommonCompanyIdentity>()
+                        .eq("com_id", identityAuthenticationInfo1.getCompId()).eq("identity_id", identityAuthenticationInfo1.getId()));
+                if (commonCompanyIdentity!=null){
+                    identityAuthenticationInfo1.setAuthenticationStatus("已接受");
+                }
+
+            }
+        }
         recommendedIdentityAuthenticationInfoPage.setRecords(identityAuthenticationInfoList);
         return recommendedIdentityAuthenticationInfoPage;
     }

+ 22 - 2
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/PurchasePriceServiceImpl.java

@@ -1,9 +1,14 @@
 package com.yh.saas.plugin.yiliangyiyun.service.impl;
 
 import com.alibaba.fastjson.JSONObject;
+import com.alipay.sofa.runtime.api.annotation.SofaReference;
 import com.baomidou.mybatisplus.mapper.EntityWrapper;
 import com.baomidou.mybatisplus.plugins.Page;
 import com.google.common.collect.Lists;
+import com.winsea.svc.base.base.entity.CommonRoleResource;
+import com.winsea.svc.base.base.service.ICommonRoleResourceService;
+import com.winsea.svc.base.security.entity.User;
+import com.winsea.svc.base.security.util.AuthSecurityUtils;
 import com.winsea.svc.base.workflow.entity.Workflow;
 import com.yh.saas.common.support.util.IdGenerator;
 import com.yh.saas.plugin.yiliangyiyun.constant.StatusEnum;
@@ -19,9 +24,11 @@ import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.CollectionUtils;
 
+import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.stream.Collectors;
 
 /**
  * <p>
@@ -42,6 +49,8 @@ public class PurchasePriceServiceImpl extends ServiceImpl<PurchasePriceMapper, P
     private IWarehouseBaseInfoService warehouseBaseInfoService;
     @Autowired
     private INewWorkflowService workflowService;
+    @SofaReference
+    private ICommonRoleResourceService roleResourceService;
     @Override
     public Page<PurchasePrice> purchasePriceList(PurchasePrice purchasePrice) {
 
@@ -49,11 +58,17 @@ public class PurchasePriceServiceImpl extends ServiceImpl<PurchasePriceMapper, P
         pageView.put("startRecord", (purchasePrice.getCurrentPage() - 1)
                 * purchasePrice.getPageSize());
         //公司id
+        List<String> statusSet = new ArrayList<>();
+        List<String> resourceIdList = this.getResourceIdList();
+        if (resourceIdList.contains("procurementInReport-Edit")) { // 填写,提交    权限做完以后替换
+            List<String> statusList = Lists.newArrayList(StatusEnum.PUR_RETURN.getFlag());
+            statusSet.addAll(statusList);
+        }
         pageView.put("compId", purchasePrice.getCompId());
         pageView.put("warehouseId", purchasePrice.getWarehouseId());
         pageView.put("pageSize", purchasePrice.getPageSize());
         pageView.put("currentPage", purchasePrice.getCurrentPage());
-
+        pageView.put("statusSet", statusSet);
         List<PurchasePrice> dataList = this.baseMapper.purchasePriceList(pageView);
 
 
@@ -78,6 +93,12 @@ public class PurchasePriceServiceImpl extends ServiceImpl<PurchasePriceMapper, P
         page.setSize(purchasePrice.getPageSize());
         return page;
     }
+    private List<String> getResourceIdList() {
+        User currentUser = AuthSecurityUtils.getCurrentUserInfo();
+        // 当前登录人主要角色
+        return roleResourceService.getBindResourcesByUserId(currentUser.getUserId()).stream()
+                .map(CommonRoleResource::getResourceId).collect(Collectors.toList());
+    }
 
     @Override
     @Transactional(rollbackFor = Exception.class)
@@ -113,7 +134,6 @@ public class PurchasePriceServiceImpl extends ServiceImpl<PurchasePriceMapper, P
                     tmp.setMainId(mainId);
                     this.purchasePriceDetailPrintService.insert(tmp);
                 }
-                return "ok";
             } catch (Exception e) {
                 System.out.println("新增收购价格异常:" + e.toString());
             }

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

@@ -3,6 +3,13 @@ package com.yh.saas.plugin.yiliangyiyun.service.impl;
 import com.baomidou.mybatisplus.mapper.EntityWrapper;
 import com.baomidou.mybatisplus.mapper.Wrapper;
 import com.fasterxml.jackson.databind.BeanProperty;
+import com.winsea.svc.base.base.entity.CommonRole;
+import com.winsea.svc.base.base.entity.CommonStaff;
+import com.winsea.svc.base.base.entity.CommonStaffRole;
+import com.winsea.svc.base.base.service.ICommonRoleService;
+import com.winsea.svc.base.base.service.ICommonStaffRoleService;
+import com.winsea.svc.base.base.service.ICommonStaffService;
+import com.winsea.svc.base.security.util.AuthSecurityUtils;
 import com.yh.saas.common.support.util.IdGenerator;
 import com.yh.saas.common.support.util.StringUtils;
 import com.yh.saas.plugin.yiliangyiyun.constant.NumberConstant;
@@ -54,6 +61,12 @@ public class WarehouseBaseInfoServiceImpl extends ServiceImpl<WarehouseBaseInfoM
     private IPurchasePriceService purchasePriceService;
     @Autowired
     private IContractGoodsInfoService contractGoodsInfoService;
+    @Autowired
+    private ICommonStaffService commonStaffService;
+    @Autowired
+    private ICommonStaffRoleService commonStaffRoleService;
+    @Autowired
+    private ICommonRoleService commonRoleService;
 
     /**
      * 仓库管理页面列表
@@ -735,10 +748,16 @@ public class WarehouseBaseInfoServiceImpl extends ServiceImpl<WarehouseBaseInfoM
      */
     @Override
     public List<WarehouseBaseInfo> selectWarehouseSelf(String compId, String personCharge) {
+        if(compId == null || compId.isEmpty()){
+            compId = AuthSecurityUtils.getStaffById(AuthSecurityUtils.getCurrentUserId()).getCompId();
+        }
+        if(personCharge == null || personCharge.isEmpty()){
+            personCharge = AuthSecurityUtils.getStaffById(AuthSecurityUtils.getCurrentUserId()).getStaffMobilePhone();
+        }
         Wrapper<WarehouseBaseInfo> warehouseBaseInfoWrapper = new EntityWrapper<>();
                 warehouseBaseInfoWrapper.eq("comp_id", compId)
                 .eq("warehouse_type","1").eq("delete_flag", "0");
-        warehouseBaseInfoWrapper.andNew().eq("person_charge", personCharge).or()
+        warehouseBaseInfoWrapper.andNew().eq("person_phone", personCharge).or()
                 .like("other_person_charge", personCharge);
         List<WarehouseBaseInfo> warehouseBaseInfoList=this.selectList(warehouseBaseInfoWrapper);
         if (!CollectionUtils.isEmpty(warehouseBaseInfoList)){
@@ -759,14 +778,25 @@ public class WarehouseBaseInfoServiceImpl extends ServiceImpl<WarehouseBaseInfoM
             }
         }
         else {
-            List<WarehouseBaseInfo> warehouseBaseInfoList1 = this.selectList(new EntityWrapper<WarehouseBaseInfo>()
-                    .eq("comp_id", compId)
-                    .eq("warehouse_type","1")
-                    .eq("delete_flag", "0"));
-            for (WarehouseBaseInfo warehouseBaseInfo:warehouseBaseInfoList1){
-                warehouseBaseInfo.setFlag("全部");
+            String staffId = AuthSecurityUtils.getStaffById(AuthSecurityUtils.getCurrentUserId()).getStaffId();
+            List<CommonStaffRole> staffRoles = commonStaffRoleService.selectList(new EntityWrapper<CommonStaffRole>().eq("staff_id",staffId));
+            List<CommonRole> list = new ArrayList<>();
+            for(CommonStaffRole commonStaffRole : staffRoles){
+                list.add(commonRoleService.selectById(commonStaffRole.getRoleId()));
+            }
+            for(CommonRole commonRole : list){
+                if(commonRole.getRoleName().equals("决策人") || commonRole.getRoleName().equals("系统管理员")|| commonRole.getRoleName().contains("总")){
+                    List<WarehouseBaseInfo> warehouseBaseInfoList1 = this.selectList(new EntityWrapper<WarehouseBaseInfo>()
+                            .eq("comp_id", compId)
+                            .eq("warehouse_type","1")
+                            .eq("delete_flag", "0"));
+                    for (WarehouseBaseInfo warehouseBaseInfo:warehouseBaseInfoList1){
+                        warehouseBaseInfo.setFlag("全部");
+                    }
+                    warehouseBaseInfoList=warehouseBaseInfoList1;
+                    return warehouseBaseInfoList;
+                }
             }
-            warehouseBaseInfoList=warehouseBaseInfoList1;
         }
         return warehouseBaseInfoList;
     }

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

@@ -72,6 +72,11 @@ public class WeighingManagementServiceImpl extends ServiceImpl<WeighingManagemen
                 if (commonCompany!=null){
                     weighingManagement1.setCompName(commonCompany.getCompName());
                 }
+                PaymentManagement paymentManagement=paymentManagementService.selectOne(new EntityWrapper<PaymentManagement>()
+                        .eq("relation_id",weighingManagement1.getRelationId()));
+                if(paymentManagement!=null){
+                    weighingManagement1.setPaymentManagement(paymentManagement);
+                }
                 WarehouseBaseInfo warehouseBaseInfo=warehouseBaseInfoService.selectOne(new EntityWrapper<WarehouseBaseInfo>()
                         .eq("comp_id",weighingManagement1.getCompId())
                         .eq("warehouse_name",weighingManagement1.getWarehouseName()));

+ 20 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/PurchasePriceMapper.xml

@@ -27,6 +27,16 @@
         <if test="warehouseId != null and warehouseId != ''">
             AND pp.warehouse_id = #{warehouseId}
         </if>
+        <if test="statusSet != null and statusSet.size > 0">
+            or (
+            <foreach collection="statusSet" item="statusId" separator="or" open="(" close=")">
+                status_flag =
+                <if test="statusId != null">
+                    #{statusId}
+                </if>
+            </foreach>
+            )
+        </if>
         and wbi.delete_flag = '0'
         and pp.delete_flag = '0'
         ORDER BY pp.warehouse_name DESC
@@ -46,6 +56,16 @@
         <if test="warehouseId != null and warehouseId != ''">
             AND pp.warehouse_id = #{warehouseId}
         </if>
+        <if test="statusSet != null and statusSet.size > 0">
+            or (
+            <foreach collection="statusSet" item="statusId" separator="or" open="(" close=")">
+                status_flag =
+                <if test="statusId != null">
+                    #{statusId}
+                </if>
+            </foreach>
+            )
+        </if>
         and wbi.delete_flag = '0'
         and pp.delete_flag = '0'
         ORDER BY pp.warehouse_name DESC