fzzy-igdss-core/src/main/java/com/fzzy/igds/mapper/DepotConfMapper.java
@@ -1,8 +1,13 @@ package com.fzzy.igds.mapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.fzzy.igds.domain.DepotConf; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Select; import java.util.List; /** * @Description @@ -12,4 +17,15 @@ @Mapper public interface DepotConfMapper extends BaseMapper<DepotConf> { /** * 自定义关联查询SQL * 关联合同表,根据银行id查询库区配置列表 * @param queryWrapper 查询条件 * @return 库区配置列表 */ @Select("SELECT DISTINCT d.* FROM d_pledge_contract c LEFT JOIN d_depot_conf d ON d.dept_id = c.pledge_dept ${ew.customSqlSegment}") List<DepotConf> selectByBank(@Param("ew") QueryWrapper<DepotConf> queryWrapper); } fzzy-igdss-core/src/main/java/com/fzzy/igds/service/CoreDeptService.java
@@ -48,12 +48,12 @@ } if (Constant.USER_TYPE_20.equals(user.getUserType())) { //银行用户,根据合同查询银行下所有库区 return this.getDeptByContract(user.getUserData()); return this.getDeptByBank(user.getUserData()); } if (Constant.USER_TYPE_30.equals(user.getUserType())) { //库区用户 String deptId = user.getDeptId() + ""; if(deptId.length() > 7){ if(ContextUtil.isDepotUser(deptId)){ //查询用户所属库区 return this.listDept(deptId,null,null); }else { @@ -66,15 +66,13 @@ /** * 根据银行id,关联合同表查询库区列表 * @param bankId * @param bankId 银行号 * @return */ public List<Dept> getDeptByContract(String bankId) { public List<Dept> getDeptByBank(String bankId) { if (StringUtils.isBlank(bankId)){ return null; } QueryWrapper<PledgeContract> queryWrapper = new QueryWrapper<>(); queryWrapper.eq("c.pledge_bank", bankId); fzzy-igdss-core/src/main/java/com/fzzy/igds/service/DepotConfService.java
@@ -4,7 +4,6 @@ import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.fzzy.igds.constant.Constant; import com.fzzy.igds.constant.RedisConst; import com.fzzy.igds.domain.Depot; import com.fzzy.igds.domain.DepotConf; import com.fzzy.igds.mapper.DepotConfMapper; import com.fzzy.igds.utils.ContextUtil; @@ -13,6 +12,7 @@ import com.ruoyi.common.utils.StringUtils; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; import javax.annotation.Resource; import java.util.ArrayList; import java.util.Collection; @@ -31,8 +31,6 @@ @Resource private DepotConfMapper depotConfMapper; @Resource private DepotService depotService; @Resource private RedisCache redisCache; @@ -66,30 +64,36 @@ SysUser user = ContextUtil.getLoginUser(); QueryWrapper<DepotConf> queryWrapper = new QueryWrapper<>(); queryWrapper.eq("company_id", user.getCompanyId()); //监管用户-默认查看所有信息不增加条件 if (Constant.USER_TYPE_10.equals(user.getUserType())) { queryWrapper.eq("company_id", user.getCompanyId()); //不增加条件 } //库区用户,如果是公司用户可以查看公司下属所有库区,如果为当前库区只查询当前库区 if (Constant.USER_TYPE_30.equals(user.getUserType())) { queryWrapper.eq("company_id", user.getCompanyId()); if (ContextUtil.isDepotUser(user.getDeptId() + "")) { queryWrapper.eq("dept_id", user.getDeptId() + ""); } else { queryWrapper.likeRight("dept_id", user.getDeptId() + ""); } } //银行用户,根据合同查询银行下所有库区 if (Constant.USER_TYPE_20.equals(user.getUserType())) { return this.getDeptByContract(user.getUserData()); if(StringUtils.isBlank(user.getUserData())) return null; queryWrapper.eq("d.company_id", user.getCompanyId()); queryWrapper.eq("c.pledge_bank", user.getUserData()); return depotConfMapper.selectByBank(queryWrapper); } return null; } private List<DepotConf> getDeptByContract(String userData) { //TODO return null; return depotConfMapper.selectList(queryWrapper); } /** fzzy-igdss-core/src/main/java/com/fzzy/igds/utils/ContextUtil.java
@@ -180,6 +180,18 @@ } /** * 如果用户是库区用户,判断是否数据公司级别 * * @param userDeptId 当前用户部门ID * @return 如果部门ID大于长度7说明是库区,否则就是公司级别 */ public static boolean isDepotUser(String userDeptId) { if(StringUtils.isBlank(userDeptId)) return false; return userDeptId.length() > 7; } public static void main(String[] args) { for (int i = 0; i < 10; i++){ String id = generateId(); fzzy-igdss-view/src/main/java/com/fzzy/igds/ConfByDept.view.xml
@@ -132,11 +132,7 @@ </DataType> </Model> <View layout="padding:10"> <ClientEvent name="onReady"> /**
 * 出入库配置
 */
 <ClientEvent name="onReady">//出入库配置
 inoutConf = function(){
 var cur = view.get("#dgMain").get("selection");
 if(cur){
 @@ -147,10 +143,8 @@ $notify("请先选择库区……");
 } };
 /**
 * 抓拍配置
 */
 
 // 抓拍配置
 snapConf = function(){
 var cur = view.get("#dgMain").get("selection");
 if(cur){
 @@ -163,9 +157,7 @@ } };
 /**
 * 巡检配置
 */
 //巡检配置
 patrolConf = function(){
 var cur = view.get("#dgMain").get("selection");
 if(cur){
 @@ -175,11 +167,9 @@ }else{
 $notify("请先选择库区……");
 } }; };
 /** * 工单配置 */ //工单配置 workOrderConf = function(){ var cur = view.get("#dgMain").get("selection"); if(cur){ @@ -191,9 +181,7 @@ } };
 /**
 * 流媒体配置
 */
 //流媒体配置
 cameraMediaConf = function(){
 var cur = view.get("#dgMain").get("selection");
 if(cur){
 @@ -204,7 +192,6 @@ $notify("请先选择库区……");
 } }; //操作
 renderCell1 = function(arg,self){
 var data = arg.data;
 fzzy-igdss-view/src/main/java/com/fzzy/igds/DepotPR.java
@@ -48,6 +48,8 @@ } /** * * TODO 当前方法取消,逻辑调整为在提交时候验证是否是银行监管仓,默认获取相应的列表 * depotPR#getDataByBankId * * @return fzzy-igdss-view/src/main/java/com/fzzy/igds/InoutNoticeIn.view.xml
@@ -222,12 +222,6 @@ <Property name="loadMode">manual</Property> <Property name="dataType">dtNoticeParam</Property> </DataSet> <DataSet id="dsDepotList"> <Property name="dataProvider">depotPR#getDataByBankId</Property> <Property name="userData">仓库列表下拉框</Property> <Property name="loadMode">manual</Property> <Property name="dataType">[dtDepot]</Property> </DataSet> <Container> <Property name="className">c-param</Property> <AutoForm> fzzy-igdss-view/src/main/java/com/fzzy/igds/InoutNoticeOut.view.xml
@@ -9,18 +9,19 @@ <Property></Property> <Property name="label">通知单号</Property> </PropertyDef> <PropertyDef name="companyId"> <Property></Property> <Property name="label">组织编码</Property> </PropertyDef> <PropertyDef name="deptId"> <Property></Property> <Property name="label">所属分库</Property> <Property name="mapping"> <Property name="keyProperty">id</Property> <Property name="mapValues">${dorado.getDataProvider("deptPR#getAllData").getResult()}</Property> <Property name="mapValues">${dorado.getDataProvider("deptPR#getDeptByUserType").getResult()}</Property> <Property name="valueProperty">kqmc</Property> </Property> <Property name="required">true</Property> </PropertyDef> <PropertyDef name="companyId"> <Property></Property> <Property name="label">组织编码</Property> </PropertyDef> <PropertyDef name="name"> <Property></Property> @@ -57,7 +58,7 @@ <Property></Property> <Property name="label">出库仓库</Property> <Property name="mapping"> <Property name="mapValues">${dorado.getDataProvider("depotPR#getAllCache").getResult()}</Property> <Property name="mapValues">${dorado.getDataProvider("deptPR#getDeptByUserType").getResult()}</Property> <Property name="keyProperty">id</Property> <Property name="valueProperty">name</Property> </Property> @@ -72,11 +73,6 @@ <Property></Property> <Property name="label">发货单位</Property> <Property name="required">false</Property> <Property name="mapping"> <Property name="mapValues">${dorado.getDataProvider("deptPR#getAllData").getResult()}</Property> <Property name="keyProperty">id</Property> <Property name="valueProperty">kqmc</Property> </Property> </PropertyDef> <PropertyDef name="foodVariety"> <Property></Property> @@ -90,7 +86,7 @@ </PropertyDef> <PropertyDef name="year"> <Property></Property> <Property name="label">年份</Property> <Property name="label">粮食年份</Property> </PropertyDef> <PropertyDef name="targetNumber"> <Property name="dataType">double</Property> @@ -329,7 +325,7 @@ <Fill/> </ToolBar> <DataGrid id="dataGridMain" layoutConstraint="padding:8"> <ClientEvent name="onDataRowDoubleClick">view.get("#dataGridMain").set("selection",arg.data);</ClientEvent> <ClientEvent name="onDataRowClick">self.set("selection",arg.data);</ClientEvent> <Property name="dataSet">dsMain</Property> <Property name="readOnly">true</Property> <Property name="selectionMode">singleRow</Property> @@ -475,6 +471,11 @@ <Editor/> </AutoFormElement> <AutoFormElement> <Property name="name">deptId</Property> <Property name="property">deptId</Property> <Editor/> </AutoFormElement> <AutoFormElement> <Property name="name">depotId</Property> <Property name="property">depotId</Property> <Editor/> @@ -490,7 +491,7 @@ <Property name="trigger">defaultYearDropDown</Property> <Editor/> </AutoFormElement> <AutoFormElement layoutConstraint="colSpan:2"> <AutoFormElement> <Property name="name">customerName</Property> <Property name="property">customerName</Property> <Editor/>