Selaa lähdekoodia

科德系统财务、营销管理员更换审核人员开发
科德系统修改审核逻辑去掉董事长与总裁角色人员查询

anderx 3 vuotta sitten
vanhempi
commit
0565f42302

+ 9 - 0
src/main/java/com/goafanti/common/dao/TOrderInvoiceMapper.java

@@ -34,4 +34,13 @@ public interface TOrderInvoiceMapper {
     TOrderInvoiceDetails getInvoiceDetails(String orderNo);
 
     List<OutInvoiceLog>  selectInvoiceLog(Integer id);
+
+    /**
+     * 切换审核人员
+     * @param type 0财务
+     * @param depId 部门编号
+     * @param aid 切换后审核人
+     * @return
+     */
+    int updateexamineName(@Param("type")Integer type, @Param("depId")String depId, @Param("aid")String aid);
 }

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

@@ -357,7 +357,8 @@
     where id = #{id,jdbcType=INTEGER}
   </update>
 
-  <select id="checkApplyAmount" resultType="java.lang.String">
+
+    <select id="checkApplyAmount" resultType="java.lang.String">
   select ifnull(sum(amount),0) from t_order_invoice
 	where order_no= #{orderNo,jdbcType=VARCHAR}  and status !=4
 	<if test="id != null">
@@ -591,4 +592,19 @@ where a.status=2 and a.order_no=  #{orderNo,jdbcType=VARCHAR}
     from invoice_log a left join admin b on a.aid =b.id
     where a.invoice_id =#{id} order by a.create_time
   </select>
+
+  <update id="updateexamineName">
+    update  t_order_invoice a,t_order_new b,admin c
+    set a.examine_name=c.name
+    where 1=1
+    <if test="type==0">
+      and a.type=0 and a.status =1 and a.approval in (0,2)
+    </if>
+    <if test="type==1">
+      and a.type=1 and a.status =1 and a.approval in (0,2)
+    </if>
+      and a.order_no =b.order_no
+      and b.order_dep = #{depId}
+      and c.id= #{aid}
+  </update>
 </mapper>

+ 22 - 8
src/main/java/com/goafanti/common/utils/AsyncUtils.java

@@ -9,9 +9,7 @@ import java.util.UUID;
 import javax.mail.MessagingException;
 
 import com.goafanti.admin.bo.AdminListBo;
-import com.goafanti.common.dao.AdminMapper;
-import com.goafanti.common.dao.NewOrderChangeMapper;
-import com.goafanti.common.dao.TChangeTaskMapper;
+import com.goafanti.common.dao.*;
 import com.goafanti.common.enums.NoticeStatus;
 import com.goafanti.common.model.Admin;
 import com.goafanti.common.model.TChangeTask;
@@ -22,7 +20,6 @@ import org.springframework.scheduling.annotation.Async;
 import org.springframework.stereotype.Component;
 
 import com.goafanti.common.bo.EmailBo;
-import com.goafanti.common.dao.NoticeMapper;
 import com.goafanti.common.enums.NoticeTypes;
 import com.goafanti.common.model.Notice;
 
@@ -34,9 +31,11 @@ public class AsyncUtils {
 	@Autowired
 	private AdminMapper adminMapper;
 	@Autowired
-	private TChangeTaskMapper tChangeTaskMapper;
+	private TOrderNewMapper tOrderNewMapper;
 	@Autowired
 	private NewOrderChangeMapper newOrderChangeMapper;
+	@Autowired
+	private TOrderInvoiceMapper tOrderInvoiceMapper;
 
 
 
@@ -111,7 +110,22 @@ public class AsyncUtils {
     }
 
 
-
-
-
+	/**
+	 * 切换审核人员
+	 * @param type 3财务
+	 * @param depId 部门编号
+	 * @param aid 切换后审核人
+	 * @return
+	 */
+    public void updateexamineName(Integer type, String depId, String aid) {
+    	if (type==3){
+			tOrderNewMapper.updateexamineName(3,depId,aid);
+			newOrderChangeMapper.updateexamineName(5,depId,aid);
+			tOrderInvoiceMapper.updateexamineName(0,depId,aid);
+		}else if (type==1){
+			tOrderNewMapper.updateexamineName(1,depId,aid);
+			newOrderChangeMapper.updateexamineName(1,depId,aid);
+			tOrderInvoiceMapper.updateexamineName(1,depId,aid);
+		}
+	}
 }

+ 5 - 4
src/main/java/com/goafanti/organization/service/impl/OrganizationServiceImpl.java

@@ -6,6 +6,7 @@ import com.goafanti.common.dao.DepartmentMapper;
 import com.goafanti.common.dao.NewOrderChangeMapper;
 import com.goafanti.common.dao.TOrderNewMapper;
 import com.goafanti.common.model.Department;
+import com.goafanti.common.utils.AsyncUtils;
 import com.goafanti.organization.bo.DepOut;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -28,6 +29,8 @@ public class OrganizationServiceImpl extends BaseMybatisDao<DepartmentMapper> im
 	private TOrderNewMapper	tOrderNewMapper;
 	@Autowired
 	private NewOrderChangeMapper newOrderChangeMapper;
+	@Autowired
+	private AsyncUtils asyncUtils;
 
 	@Override
 	public Pagination<OrganizationListOut> listOrganizationManagement(OrganizationListOut olo, Integer pageNo,
@@ -196,12 +199,10 @@ public class OrganizationServiceImpl extends BaseMybatisDao<DepartmentMapper> im
 		Department use = departmentMapper.selectByPrimaryKey(id);
 		if (!use.getFinanceId().equals(financeId)){
 			//切换后更换审核人
-			tOrderNewMapper.updateexamineName(3,id,financeId);
-			newOrderChangeMapper.updateexamineName(5,id,financeId);
+			asyncUtils.updateexamineName(3,id,financeId);
 		}
 		if (!use.getManagerId().equals(managerId)){
-			tOrderNewMapper.updateexamineName(1,id,managerId);
-			newOrderChangeMapper.updateexamineName(1,id,managerId);
+			asyncUtils.updateexamineName(1,id,managerId);
 		}
 		tOrderMidMapper.updateFinanceId(id,financeId);
 		int x=departmentMapper.updateByPrimaryKeySelective(dep);