Przeglądaj źródła

营销管理员审核修改

anderx 2 lat temu
rodzic
commit
4658553676

+ 0 - 5
src/main/java/com/goafanti/admin/service/DepartmentService.java

@@ -53,11 +53,6 @@ public interface DepartmentService {
 	 */
 	List<String> comparePermissions(List<String> aDep, String deps);
 
-	/**
-	 * 获取财务管理部门
-	 * @return
-	 */
-	List<String> getFinanceDep(String aid);
 
 
 }

+ 1 - 11
src/main/java/com/goafanti/admin/service/impl/DepartmentServiceImpl.java

@@ -7,6 +7,7 @@ import java.util.List;
 import com.alibaba.fastjson.JSON;
 import com.goafanti.admin.bo.DepartmentComboBox;
 import com.goafanti.common.constant.AFTConstants;
+import com.goafanti.common.dao.AdminMapper;
 import com.goafanti.common.dao.DepartmentMapper;
 import com.goafanti.common.model.Department;
 import com.goafanti.core.shiro.token.TokenManager;
@@ -142,15 +143,4 @@ public class DepartmentServiceImpl extends BaseMybatisDao<WorkingHoursMapper> im
 		return JSON.parseArray(deps,String.class);
 	}
 
-
-	@Override
-	public List<String> getFinanceDep(String aid) {
-		return departmentMapper.getFinanceDep(aid);
-	}
-
-
-
-
-
-
 }

+ 2 - 0
src/main/java/com/goafanti/common/dao/AdminMapper.java

@@ -165,4 +165,6 @@ public interface AdminMapper {
     List<Admin> selectAdminByRoleType(@Param("roleType") String roleType);
 
     List<AdminCustomerBo > selectByDeps(@Param("depIds") List<Department> depIds,@Param("seniorStaff") Integer seniorStaff);
+
+    Admin getAdminByFinanceId(String id);
 }

+ 0 - 1
src/main/java/com/goafanti/common/dao/DepartmentMapper.java

@@ -116,5 +116,4 @@ public interface DepartmentMapper {
 
     Department selectByDepNo(String superId);
 
-    List<String> getFinanceDep(String aid);
 }

+ 26 - 0
src/main/java/com/goafanti/common/dao/TOrderExamineMapper.java

@@ -0,0 +1,26 @@
+package com.goafanti.common.dao;
+
+import com.goafanti.common.model.TOrderExamine;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+public interface TOrderExamineMapper {
+    int deleteByPrimaryKey(Integer id);
+
+    int insert(TOrderExamine record);
+
+    int insertSelective(TOrderExamine record);
+
+    TOrderExamine selectByPrimaryKey(Integer id);
+
+    int updateByPrimaryKeySelective(TOrderExamine record);
+
+    int updateByPrimaryKey(TOrderExamine record);
+
+    List<TOrderExamine> selectByOrderNo(String orderNo);
+
+    void updateStatusByOrderNo(@Param("orderNo") String orderNo,@Param("status") Integer status);
+
+    void insertBatch(@Param("list") List<TOrderExamine> list);
+}

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

@@ -1214,4 +1214,9 @@
       </foreach>
     </if>
   </select>
+  <select id="getAdminByFinanceId" resultType="com.goafanti.common.model.Admin">
+    select b.id ,b.name
+    from department a left join admin b on a.finance_id=b.id
+    where a.id= #{id}
+  </select>
 </mapper>

+ 1 - 4
src/main/java/com/goafanti/common/mapper/DepartmentMapper.xml

@@ -550,9 +550,6 @@
     from department where super_id=  #{superId}
     order by dep_no desc limit 1
   </select>
-    <select id="getFinanceDep" resultType="java.lang.String">
-      select id from department
-      where finance_id = #{aid};
-    </select>
+
 
 </mapper>

+ 122 - 0
src/main/java/com/goafanti/common/mapper/TOrderExamineMapper.xml

@@ -0,0 +1,122 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.goafanti.common.dao.TOrderExamineMapper">
+  <resultMap id="BaseResultMap" type="com.goafanti.common.model.TOrderExamine">
+    <id column="id" jdbcType="INTEGER" property="id" />
+    <result column="order_no" jdbcType="VARCHAR" property="orderNo" />
+    <result column="aid" jdbcType="VARCHAR" property="aid" />
+    <result column="status" jdbcType="INTEGER" property="status" />
+    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
+    <result column="aname" jdbcType="VARCHAR" property="aname" />
+  </resultMap>
+  <sql id="Base_Column_List">
+    id, order_no, aid, `status`, create_time, aname
+  </sql>
+  <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
+    select
+    <include refid="Base_Column_List" />
+    from t_order_examine
+    where id = #{id,jdbcType=INTEGER}
+  </select>
+
+    <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
+    delete from t_order_examine
+    where id = #{id,jdbcType=INTEGER}
+  </delete>
+  <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.TOrderExamine" useGeneratedKeys="true">
+    insert into t_order_examine (order_no, aid, `status`,
+      create_time, aname)
+    values (#{orderNo,jdbcType=VARCHAR}, #{aid,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER},
+      #{createTime,jdbcType=TIMESTAMP}, #{aname,jdbcType=VARCHAR})
+  </insert>
+  <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.TOrderExamine" useGeneratedKeys="true">
+    insert into t_order_examine
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="orderNo != null">
+        order_no,
+      </if>
+      <if test="aid != null">
+        aid,
+      </if>
+      <if test="status != null">
+        `status`,
+      </if>
+      <if test="createTime != null">
+        create_time,
+      </if>
+      <if test="aname != null">
+        aname,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="orderNo != null">
+        #{orderNo,jdbcType=VARCHAR},
+      </if>
+      <if test="aid != null">
+        #{aid,jdbcType=VARCHAR},
+      </if>
+      <if test="status != null">
+        #{status,jdbcType=INTEGER},
+      </if>
+      <if test="createTime != null">
+        #{createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="aname != null">
+        #{aname,jdbcType=VARCHAR},
+      </if>
+    </trim>
+  </insert>
+
+  <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.TOrderExamine">
+    update t_order_examine
+    <set>
+      <if test="orderNo != null">
+        order_no = #{orderNo,jdbcType=VARCHAR},
+      </if>
+      <if test="aid != null">
+        aid = #{aid,jdbcType=VARCHAR},
+      </if>
+      <if test="status != null">
+        `status` = #{status,jdbcType=INTEGER},
+      </if>
+      <if test="createTime != null">
+        create_time = #{createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="aname != null">
+        aname = #{aname,jdbcType=VARCHAR},
+      </if>
+    </set>
+    where id = #{id,jdbcType=INTEGER}
+  </update>
+  <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.TOrderExamine">
+    update t_order_examine
+    set order_no = #{orderNo,jdbcType=VARCHAR},
+      aid = #{aid,jdbcType=VARCHAR},
+      `status` = #{status,jdbcType=INTEGER},
+      create_time = #{createTime,jdbcType=TIMESTAMP},
+      aname = #{aname,jdbcType=VARCHAR}
+    where id = #{id,jdbcType=INTEGER}
+  </update>
+
+
+  <select id="selectByOrderNo" resultMap="BaseResultMap">
+    select
+    <include refid="Base_Column_List" />
+    from t_order_examine
+    where order_no = #{orderNo,jdbcType=VARCHAR}
+  </select>
+
+  <update id="updateStatusByOrderNo">
+    update t_order_examine
+    set status= #{status}
+    where order_no = #{orderNo,jdbcType=VARCHAR}
+  </update>
+  <insert id="insertBatch">
+    insert into t_order_examine (order_no, aid, `status`, aname)
+    values
+    <foreach item="item" index="index" collection="list" separator=",">
+      (#{item.orderNo,jdbcType=VARCHAR}, #{item.aid,jdbcType=VARCHAR}, #{item.status,jdbcType=INTEGER},
+       #{item.aname,jdbcType=VARCHAR})
+    </foreach>
+  </insert>
+</mapper>

+ 97 - 0
src/main/java/com/goafanti/common/model/TOrderExamine.java

@@ -0,0 +1,97 @@
+package com.goafanti.common.model;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * t_order_examine
+ * @author
+ */
+public class TOrderExamine implements Serializable {
+    private Integer id;
+
+    /**
+     * 订单编号
+     */
+    private String orderNo;
+
+    /**
+     * 审核人编号
+     */
+    private String aid;
+
+    /**
+     * 0未审核 ,1已审核
+     */
+    private Integer status;
+
+    /**
+     * 创建时间
+     */
+    private Date createTime;
+
+    /**
+     * 审核人名称
+     */
+    private String aname;
+
+    private static final long serialVersionUID = 1L;
+
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    public String getOrderNo() {
+        return orderNo;
+    }
+
+    public void setOrderNo(String orderNo) {
+        this.orderNo = orderNo;
+    }
+
+    public String getAid() {
+        return aid;
+    }
+
+    public void setAid(String aid) {
+        this.aid = aid;
+    }
+
+    public Integer getStatus() {
+        return status;
+    }
+
+    public void setStatus(Integer status) {
+        this.status = status;
+    }
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    public String getAname() {
+        return aname;
+    }
+
+    public void setAname(String aname) {
+        this.aname = aname;
+    }
+
+    public TOrderExamine() {
+    }
+
+    public TOrderExamine(String orderNo, String aid,String aname) {
+        this.orderNo = orderNo;
+        this.aid = aid;
+        this.aname=aname;
+        this.status=0;
+    }
+}

+ 2 - 2
src/main/java/com/goafanti/order/enums/ProcessStatus.java

@@ -15,8 +15,8 @@ public enum ProcessStatus {
 	YPYXJL(1,"已派营经理"),
 	/** 已派营销管理员 **/
 	YPYXGLY(2,"已派营销管理员"),
-	/** 已派财务专员 **/
-	YPCWZY(3,"已派财务专员"),
+	/** 已派财务与技术总监**/
+	YPCWZY(3,"已派财务与技术总监"),
 	/** 已派特批审核 **/
 	YPTPSH(4,"已派特批审核"),
 	/** 已派咨询师管理员 **/

+ 1 - 1
src/main/java/com/goafanti/order/service/impl/OrderInvoiceServiceImpl.java

@@ -175,7 +175,7 @@ public class OrderInvoiceServiceImpl extends BaseMybatisDao<TOrderInvoiceMapper>
 		List<String> aDep=new ArrayList<>();
 		//财务专员查看自己的
 		if (TokenManager.hasRole(AFTConstants.FINANCE)) {
-			aDep.addAll(departmentService.getFinanceDep(TokenManager.getAdminId()));
+			aDep.addAll(adminMapper.getFinanceDep(TokenManager.getAdminId()));
 		}
 		//财务经理
 		if (TokenManager.hasRole(AFTConstants.FINANCE_MANAGER)) {

+ 28 - 8
src/main/java/com/goafanti/order/service/impl/OrderNewServiceImpl.java

@@ -86,7 +86,7 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 	@Autowired
 	private TOrderLogMapper tOrderLogMapper;
 	@Autowired
-	private OrderService	orderService;
+	private TOrderExamineMapper	tOrderExamineMapper;
 	@Autowired
 	private IdleContractNoMapper	idleContractNoMapper;
 	@Autowired
@@ -972,7 +972,25 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 			}else if (t2.getProcessStatus()==ProcessStatus.YPYXGLY.getCode()){
 				tl.setProcess(OrderLogProcess.SH.getCode());
 				t.setProcessStatus(ProcessStatus.YPCWZY.getCode());
-				aids.add(departmentMapper.selectByPrimaryKey(t2.getOrderDep()).getFinanceId());
+				//设置财务与技术总监通知
+				List<TOrderExamine> tOrderExamines = tOrderExamineMapper.selectByOrderNo(orderNo);
+				if (tOrderExamines.isEmpty()){
+					OrganizationListOut dep = departmentMapper.selectAllById(t.getOrderDep());
+					List<TOrderExamine> list =new ArrayList<>();
+					list.add(new TOrderExamine(orderNo,dep.getFinanceId(),dep.getFinanceName()));
+					aids.add(dep.getFinanceId());
+					List<Admin> admins = adminMapper.selectAdminByRoleType(AFTConstants.TECH_ADMIN);
+					for (Admin admin : admins) {
+						aids.add(admin.getId());
+						list.add(new TOrderExamine(orderNo,admin.getId(),admin.getName()));
+					}
+					tOrderExamineMapper.insertBatch(list);
+				}else {
+					tOrderExamineMapper.updateStatusByOrderNo(orderNo,0);
+					for (TOrderExamine e : tOrderExamines) {
+						aids.add(e.getAid());
+					}
+				}
 			}
 
 			type=NoticeStatus.ORDER_YES.getCode();
@@ -997,6 +1015,9 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 		pushGeneralSendNoticeAndEmail(aids, type,order, TokenManager.getAdminId(),t2.getApproval());
 		return 1;
 	}
+
+
+
 	@Override
 	public void pushExamineName(TOrderNew t){
 		StringBuffer str =new StringBuffer();
@@ -1015,12 +1036,11 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 		}else if (t.getProcessStatus()==ProcessStatus.YPCWZY.getCode()){
 			if (t.getOrderDep()!=null){
 				OrganizationListOut dep = departmentMapper.selectAllById(t.getOrderDep());
-				t.setExamineName(dep.getFinanceName());
-			}
-		}else if (t.getProcessStatus()==ProcessStatus.YPZXSGLY.getCode()){
-			List<Admin> admins = adminMapper.getAdminRoleTypeList(AFTConstants.TECH_ADMIN);
-			for (Admin e : admins) {
-				str=str.append(e.getName()).append(",");
+				str=str.append(dep.getFinanceName()).append(",");
+				List<Admin> admins = adminMapper.getAdminRoleTypeList(AFTConstants.TECH_ADMIN);
+				for (Admin admin : admins) {
+					str=str.append(admin.getName()).append(",");
+				}
 			}
 		}else if (t.getProcessStatus()==ProcessStatus.YPYXY.getCode()){
 			t.setExamineName("");

+ 5 - 5
src/main/resources/props/config_local.properties

@@ -1,12 +1,12 @@
 dev.name=local
 jdbc.driverClassName=com.mysql.jdbc.Driver
 #jdbc.url=jdbc\:mysql://localhost:3306/aft20221026?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false
-#jdbc.url=jdbc\:mysql://localhost:3306/aft?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false
-#jdbc.username=root
-#jdbc.password=123456
-jdbc.url=jdbc:mysql://101.37.32.31:3306/aft?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false
+jdbc.url=jdbc\:mysql://localhost:3306/aft?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false
 jdbc.username=root
-jdbc.password=aftdev
+jdbc.password=123456
+#jdbc.url=jdbc:mysql://101.37.32.31:3306/aft?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false
+#jdbc.username=root
+#jdbc.password=aftdev
 jdbc.validationQuery=SELECT 'x'
 jdbc.initialSize=3
 jdbc.maxActive=20