ソースを参照

数据条目增加删除和详情接口

gao.qiang 2 週間 前
コミット
98d8ae326c

+ 64 - 8
src/main/java/com/bootdo/datas/service/impl/GyDataServiceImpl.java

@@ -85,7 +85,9 @@ public class GyDataServiceImpl implements GyDataService {
                 city = sysCity;
             }
 
-            if(!ObjectUtils.isEmpty(city)){
+            String gyUnitId = currUser.getGyUnitId();
+            map.put("unitId", gyUnitId);
+            if (!ObjectUtils.isEmpty(city)) {
                 map.put("unitCity", city);
                 map.put("auditStage", "1");
             } else {
@@ -116,8 +118,9 @@ public class GyDataServiceImpl implements GyDataService {
             if(StringUtils.isEmpty(city)){
                 city = sysCity;
             }
-
-            if(!ObjectUtils.isEmpty(city)){
+            String gyUnitId = currUser.getGyUnitId();
+            map.put("unitId", gyUnitId);
+            if (!ObjectUtils.isEmpty(city)) {
                 map.put("unitCity", city);
                 map.put("auditStage", "1");
             } else {
@@ -673,8 +676,9 @@ public class GyDataServiceImpl implements GyDataService {
                 city = sysCity;
             }
 
-
-            if(!ObjectUtils.isEmpty(city)){
+            String gyUnitId = currUser.getGyUnitId();
+            map.put("unitId", gyUnitId);
+            if (!ObjectUtils.isEmpty(city)) {
                 map.put("unitCity", city);
                 map.put("auditStage", "1");
             } else {
@@ -703,8 +707,9 @@ public class GyDataServiceImpl implements GyDataService {
             if(StringUtils.isEmpty(city)){
                 city = sysCity;
             }
-
-            if(!ObjectUtils.isEmpty(city)){
+            String gyUnitId = currUser.getGyUnitId();
+            map.put("unitId", gyUnitId);
+            if (!ObjectUtils.isEmpty(city)) {
                 map.put("unitCity", city);
                 map.put("auditStage", "1");
             } else {
@@ -783,11 +788,62 @@ public class GyDataServiceImpl implements GyDataService {
 
     @Override
     public List<GyDataImportDTO> dataEntryList(Map<String, Object> map) {
-          return gyDataDao.list(map);
+        UserDO currUser = ShiroUtils.getUser();
+        log.info("currUser:" + currUser.toString());
+        if (!managerValue.contains(currUser.getDeptId().toString())) {
+            String province = currUser.getProvince();
+            if (StringUtils.isEmpty(province)) {
+                province = sysProvince;
+            }
+            if (!ObjectUtils.isEmpty(province)) {
+                map.put("unitProvince", province);
+            }
+
+            String city = currUser.getCity();
+            if (StringUtils.isEmpty(city)) {
+                city = sysCity;
+            }
+
+            String gyUnitId = currUser.getGyUnitId();
+            map.put("unitId", gyUnitId);
+            if (!ObjectUtils.isEmpty(city)) {
+                map.put("unitCity", city);
+                map.put("auditStage", "1");
+            } else {
+                map.put("auditStage", "2");
+            }
+
+        }
+        return gyDataDao.list(map);
     }
 
     @Override
     public int dataEntryCountTotal(Map<String, Object> map) {
+        UserDO currUser = ShiroUtils.getUser();
+        log.info("currUser:" + currUser.toString());
+        if (!managerValue.contains(currUser.getDeptId().toString())) {
+
+            String province = currUser.getProvince();
+            if (StringUtils.isEmpty(province)) {
+                province = sysProvince;
+            }
+            if (!ObjectUtils.isEmpty(province)) {
+                map.put("unitProvince", province);
+            }
+
+            String city = currUser.getCity();
+            if (StringUtils.isEmpty(city)) {
+                city = sysCity;
+            }
+            String gyUnitId = currUser.getGyUnitId();
+            map.put("unitId", gyUnitId);
+            if (!ObjectUtils.isEmpty(city)) {
+                map.put("unitCity", city);
+                map.put("auditStage", "1");
+            } else {
+                map.put("auditStage", "2");
+            }
+        }
         return gyDataDao.countTotal(map);
     }
 

+ 4 - 2
src/main/java/com/bootdo/datas/service/impl/UnitServiceImpl.java

@@ -59,10 +59,11 @@ public class UnitServiceImpl implements UnitService {
         if(StringUtils.isEmpty(city)){
             city = sysCity;
         }
-
+        String gyUnitId = currUser.getGyUnitId();
         if (!managerValue.contains(currUser.getDeptId().toString())) {
             map.put("unitProvince", province);
             map.put("unitCity", city);
+            map.put("unitId", gyUnitId);
         }
         return unitDao.list(map);
     }
@@ -78,10 +79,11 @@ public class UnitServiceImpl implements UnitService {
         if(StringUtils.isEmpty(city)){
             city = sysCity;
         }
-
+        String gyUnitId = currUser.getGyUnitId();
         if (!managerValue.contains(currUser.getDeptId().toString())) {
             map.put("unitProvince", province);
             map.put("unitCity", city);
+            map.put("unitId", gyUnitId);
         }
         return unitDao.count(map);
     }

+ 11 - 0
src/main/java/com/bootdo/system/domain/UserDO.java

@@ -50,6 +50,8 @@ public class UserDO implements Serializable {
     private String province;
     //所在城市
     private String city;
+    //企业
+    private String gyUnitId;
     //所在地区
     private String district;
     //崗位
@@ -249,6 +251,14 @@ public class UserDO implements Serializable {
         this.duty = duty;
     }
 
+    public String getGyUnitId() {
+        return gyUnitId;
+    }
+
+    public void setGyUnitId(String gyUnitId) {
+        this.gyUnitId = gyUnitId;
+    }
+
     @Override
     public String toString() {
         return "UserDO{" +
@@ -273,6 +283,7 @@ public class UserDO implements Serializable {
                 ", province='" + province + '\'' +
                 ", city='" + city + '\'' +
                 ", district='" + district + '\'' +
+                ", gyUnitId='" + gyUnitId + '\'' +
                 '}';
     }
 }

+ 4 - 2
src/main/resources/mybatis/datas/GyDataMapper.xml

@@ -134,7 +134,7 @@
             </if>
             <if test="nextVerifyDept != null and nextVerifyDept != ''"> and b.next_verify_dept  = #{nextVerifyDept}</if>
             <if test="unitCity != null and unitCity != ''"> and a.UNIT_CITY = #{unitCity}</if>
-
+            <if test="unitId != null and unitId != ''"> and a.CREDIT_CODE = #{unitId}</if>
             <if test="creditCode != null and creditCode != ''"> and a.CREDIT_CODE = #{creditCode}</if>
             <if test="gyUnitId != null and gyUnitId != ''"> and b.GY_NUIT_ID = #{gyUnitId}</if>
             <choose>
@@ -192,7 +192,7 @@
             </if>
             <if test="nextVerifyDept != null and nextVerifyDept != ''"> and b.next_verify_dept  = #{nextVerifyDept}</if>
             <if test="unitCity != null and unitCity != ''"> and a.UNIT_CITY = #{unitCity}</if>
-
+            <if test="unitId != null and unitId != ''"> and a.CREDIT_CODE = #{unitId}</if>
             <if test="creditCode != null and creditCode != ''"> and a.CREDIT_CODE = #{creditCode}</if>
             <if test="gyUnitId != null and gyUnitId != ''"> and b.GY_NUIT_ID = #{gyUnitId}</if>
             <choose>
@@ -239,6 +239,7 @@
             </if>
             <if test="nextVerifyDept != null and nextVerifyDept != ''">and b.next_verify_dept  = #{nextVerifyDept}</if>
             <if test="unitCity != null and unitCity != ''">and (a.UNIT_CITY = #{unitCity})</if>
+            <if test="unitId != null and unitId != ''"> and a.CREDIT_CODE = #{unitId}</if>
             <if test="roleId != null and roleId != ''">and b.role_id = #{roleId}</if>
             <if test="dataStatusArrs != null and dataStatusArrs.size > 0"> and b.DATA_STATUS in
                 <foreach item="id" collection="dataStatusArrs" open="(" separator="," close=")">
@@ -289,6 +290,7 @@
             </if>
             <if test="nextVerifyDept != null and nextVerifyDept != ''">and b.next_verify_dept  = #{nextVerifyDept}</if>
             <if test="unitCity != null and unitCity != ''">and (a.UNIT_CITY = #{unitCity})</if>
+            <if test="unitId != null and unitId != ''"> and a.CREDIT_CODE = #{unitId}</if>
             <if test="roleId != null and roleId != ''">and b.role_id = #{roleId}</if>
             <if test="dataStatusArrs != null and dataStatusArrs.size > 0"> and b.DATA_STATUS in
                 <foreach item="id" collection="dataStatusArrs" open="(" separator="," close=")">

+ 2 - 0
src/main/resources/mybatis/datas/UnitMapper.xml

@@ -74,6 +74,7 @@
             </if>
             <if test="industryTypeOne != null and industryTypeOne != ''">and UNIT_CHARACTER = #{industryTypeOne}</if>
             <if test="unitCity != null and unitCity != ''">and (UNIT_CITY = #{unitCity})</if>
+            <if test="unitId != null and unitId != ''">and (CREDIT_CODE = #{unitId})</if>
             <if test="unitProvince != null and unitProvince != ''">and (UNIT_PROVINCE = #{unitProvince})</if>
             <if test="creditCode != null and creditCode != ''">and (CREDIT_CODE = #{creditCode})</if>
         </where>
@@ -99,6 +100,7 @@
             </if>
             <if test="industryTypeOne != null and industryTypeOne != ''">and UNIT_CHARACTER = #{industryTypeOne}</if>
             <if test="unitCity != null and unitCity != ''">and (UNIT_CITY = #{unitCity})</if>
+            <if test="unitId != gyUnitId and unitId != ''">and (CREDIT_CODE = #{unitId})</if>
             <if test="unitProvince != null and unitProvince != ''">and (UNIT_PROVINCE = #{unitProvince})</if>
             <if test="creditCode != null and creditCode != ''">and (CREDIT_CODE = #{creditCode})</if>
         </where>

+ 4 - 2
src/main/resources/mybatis/system/UserMapper.xml

@@ -9,7 +9,7 @@
 
     <select id="list" resultType="com.bootdo.system.domain.UserDO" >
         select
-        `user_id`,`username`,`name`,`password`,`dept_id`,`email`,`mobile`,`status`,`user_id_create`,`gmt_create`,`gmt_modified`,`sex`,`birth`,`pic_id`,`live_address`,`hobby`,`province`,`city`,`district`,`post`,`duty`
+        `user_id`,`username`,`name`,`password`,`dept_id`,`email`,`mobile`,`status`,`user_id_create`,`gmt_create`,`gmt_modified`,`sex`,`birth`,`pic_id`,`live_address`,`hobby`,`province`,`city`,`district`,`post`,`duty`,gy_unit_id
         from sys_user as us
         <where>
             <if test="userId != null and userId != ''">and us.user_id = #{userId}</if>
@@ -98,7 +98,8 @@
 			`live_address`, 
 			`hobby`, 
 			`province`, 
-			`city`, 
+			`city`,
+		    `unit`,
 			`district`,
             `post`,
             `duty`
@@ -148,6 +149,7 @@
             <if test="hobby != null">`hobby` = #{hobby},</if>
             <if test="province != null">`province` = #{province},</if>
             <if test="city != null">`city` = #{city},</if>
+            <if test="unit != null">`city` = #{unit},</if>
             <if test="district != null">`district` = #{district},</if>
             <if test="post != null">`post` = #{post},</if>
             <if test="duty != null">`duty` = #{duty}</if>