Browse Source

科德系统修改公司管理开发

anderx 3 years ago
parent
commit
37746dc6b4

+ 8 - 5
src/main/java/com/goafanti/admin/service/impl/NewAdminServiceImpl.java

@@ -126,10 +126,12 @@ public class NewAdminServiceImpl extends BaseMybatisDao<AdminMapper> implements
 
 	private void pushAdminRole(String id,List<String>roleIds, Set<String> useRole) {
 		boolean flag=false;
-		for (String s : useRole) {
-			if (AFTConstants.COMPANY_MANAGER.equals(s)){
-				flag=true;
-				break;
+		if (useRole!=null){
+			for (String s : useRole) {
+				if (AFTConstants.COMPANY_MANAGER.equals(s)){
+					flag=true;
+					break;
+				}
 			}
 		}
 		List<Role> roleList = roleMapper.selectByIdList(roleIds);
@@ -261,7 +263,7 @@ public class NewAdminServiceImpl extends BaseMybatisDao<AdminMapper> implements
 
 	@Override
 	public int insertNewAdmin(Admin ad ,List<String> roleIds) {
-		ad.setStatus("1");
+		ad.setStatus("0");
 		ad.setId(UUID.randomUUID().toString());
 		ad.setType(sumType(roleIds));
 
@@ -278,6 +280,7 @@ public class NewAdminServiceImpl extends BaseMybatisDao<AdminMapper> implements
 		}
 		if(ad.getAmbId()!=null)pushAmbRole(ad);
 		adminMapper.insertSelective(ad);
+		pushAdminRole(ad.getId(),roleIds,null);
 		return 1;
 	}
 

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

@@ -611,11 +611,11 @@ where a.status=2 and a.order_no=  #{orderNo,jdbcType=VARCHAR}
       and c.id= #{aid}
   </update>
   <update id="updateListExamineName">
-    update t_order_invoice t0,(select a.id , ifnull(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 ('9993'))x on b.order_dep =x.department_id
-        where a.`type` =1 and a.status =1 and a.approval =1 and b.order_dep= #{depId} )t1
+    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 ('9993'))x on b.order_dep =x.department_id where a.`type` =1 and a.status =1
+        and a.approval =1 and b.order_dep= #{depId}  group by a.id)t1
     set t0.examine_name =t1.name
     where t0.id=t1.id
   </update>