Browse Source

用户新增修改权限判断修改

anderx 3 years ago
parent
commit
a312a26691

+ 7 - 1
src/main/java/com/goafanti/common/mapper/TOrderInvoiceMapper.xml

@@ -612,7 +612,13 @@ where a.status=2 and a.order_no=  #{orderNo,jdbcType=VARCHAR}
   </update>
   <update id="updateListExamineName">
     <if test="type==1">
-
+      update t_order_invoice t0,(select a.id , ifnull(GROUP_CONCAT(x.name) ,'暂无人员')name
+      from t_order_invoice a left join t_order_new b on a.order_no =b.order_no left join (select name ,department_id
+      from admin a left join user_role b on a.id =b.uid left join `role` c on b.rid =c.id where a.status ='0'
+      and c.role_type in (#{roleType}))x on b.order_dep =x.department_id where a.`type` =1
+      and a.status =1 and a.approval =0  and b.order_dep= #{depId}  group by a.id)t1
+      set t0.examine_name =t1.name
+      where t0.id=t1.id
     </if>
     <if test="type==2">
       update t_order_invoice t0,(select a.id , ifnull(GROUP_CONCAT(x.name) ,'暂无人员')name

+ 7 - 1
src/main/java/com/goafanti/common/utils/AsyncUtils.java

@@ -137,8 +137,14 @@ public class AsyncUtils {
 	 * @param roleType
 	 */
 	public void updateListExamineName(Integer type, String depId, String roleType) {
-
+		StringBuffer names=new StringBuffer();
 		if (type==1){
+			List<Admin> admins = adminMapper.selectAdminByRoleType(roleType);
+			for (Admin admin : admins) {
+				if (admin.getDepartmentId().equals(depId)){
+					names=names.append(admin.getName()).append(",");
+				}
+			}
 			tOrderInvoiceMapper.updateListExamineName(type,depId,roleType);
 		}else if (type==2){
 			tOrderInvoiceMapper.updateListExamineName(type,depId,roleType);