Explorar el Código

财务审核修改

anderx hace 2 años
padre
commit
bea3061f97

+ 19 - 10
src/main/java/com/goafanti/common/mapper/TOrderTaskMapper.xml

@@ -67,6 +67,7 @@
     <result column="picture_url" jdbcType="VARCHAR" property="pictureUrl" />
     <result column="satisfaction_degree" jdbcType="INTEGER" property="satisfactionDegree" />
     <result column="satisfaction_degree_url" jdbcType="VARCHAR" property="satisfactionDegreeUrl" />
+    <result column="examine_type" jdbcType="INTEGER" property="examineType" />
   </resultMap>
   <sql id="Base_Column_List">
     id, order_no, main, super_id, commodity_id, commodity_name, commodity_quantity, commodity_mode,
@@ -79,7 +80,7 @@
     declaration_batch, cost_reduction, official_cost, set_up_status, set_up_time, spot_check_status,
     high_tech_status, special_comment, if_certification_fee, certification_fee, certification_corporate,
     time_record, if_publicity, check_status, patent_type, pubicity_url, process_status,
-    member_type, picture_url, satisfaction_degree, satisfaction_degree_url
+    member_type, picture_url, satisfaction_degree, satisfaction_degree_url, examine_type
   </sql>
   <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
     select
@@ -113,8 +114,8 @@
       certification_corporate, time_record, if_publicity,
       check_status, patent_type, pubicity_url,
       process_status, member_type, picture_url,
-      satisfaction_degree, satisfaction_degree_url
-      )
+      satisfaction_degree, satisfaction_degree_url,
+      examine_type)
     values (#{orderNo,jdbcType=VARCHAR}, #{main,jdbcType=INTEGER}, #{superId,jdbcType=VARCHAR},
       #{commodityId,jdbcType=VARCHAR}, #{commodityName,jdbcType=VARCHAR}, #{commodityQuantity,jdbcType=INTEGER},
       #{commodityMode,jdbcType=VARCHAR}, #{commodityPrice,jdbcType=DECIMAL}, #{taskStatus,jdbcType=INTEGER},
@@ -136,8 +137,8 @@
       #{certificationCorporate,jdbcType=VARCHAR}, #{timeRecord,jdbcType=VARCHAR}, #{ifPublicity,jdbcType=INTEGER},
       #{checkStatus,jdbcType=INTEGER}, #{patentType,jdbcType=INTEGER}, #{pubicityUrl,jdbcType=VARCHAR},
       #{processStatus,jdbcType=INTEGER}, #{memberType,jdbcType=INTEGER}, #{pictureUrl,jdbcType=VARCHAR},
-      #{satisfactionDegree,jdbcType=INTEGER}, #{satisfactionDegreeUrl,jdbcType=VARCHAR}
-      )
+      #{satisfactionDegree,jdbcType=INTEGER}, #{satisfactionDegreeUrl,jdbcType=VARCHAR},
+      #{examineType,jdbcType=INTEGER})
   </insert>
   <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.TOrderTask" useGeneratedKeys="true">
     insert into t_order_task
@@ -334,6 +335,9 @@
       <if test="satisfactionDegreeUrl != null">
         satisfaction_degree_url,
       </if>
+      <if test="examineType != null">
+        examine_type,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
       <if test="orderNo != null">
@@ -528,6 +532,9 @@
       <if test="satisfactionDegreeUrl != null">
         #{satisfactionDegreeUrl,jdbcType=VARCHAR},
       </if>
+      <if test="examineType != null">
+        #{examineType,jdbcType=INTEGER},
+      </if>
     </trim>
   </insert>
   <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.TOrderTask">
@@ -725,6 +732,9 @@
       <if test="satisfactionDegreeUrl != null">
         satisfaction_degree_url = #{satisfactionDegreeUrl,jdbcType=VARCHAR},
       </if>
+      <if test="examineType != null">
+        examine_type = #{examineType,jdbcType=INTEGER},
+      </if>
     </set>
     where id = #{id,jdbcType=INTEGER}
   </update>
@@ -793,14 +803,13 @@
       member_type = #{memberType,jdbcType=INTEGER},
       picture_url = #{pictureUrl,jdbcType=VARCHAR},
       satisfaction_degree = #{satisfactionDegree,jdbcType=INTEGER},
-      satisfaction_degree_url = #{satisfactionDegreeUrl,jdbcType=VARCHAR}
+      satisfaction_degree_url = #{satisfactionDegreeUrl,jdbcType=VARCHAR},
+      examine_type = #{examineType,jdbcType=INTEGER}
     where id = #{id,jdbcType=INTEGER}
   </update>
 
 
 
-
-
   <update id="updateBySuperId">
     update t_order_task
     <set>
@@ -2111,7 +2120,7 @@
   <select id="findMemberList" resultType="com.goafanti.order.bo.OutMemberList">
     select a.id,b.contract_no contractNo,c.buyer_name userName,a.order_no orderNo,b.approval ,c.dep_name depName,
     c.salesman_name salesmanName,c.finance_name financeName,a.commodity_name projectName,a.member_type memberType,
-    b.delete_sign deleteSign ,b.total_amount totalAmount ,b.sales_type salesType ,b.other,
+    b.delete_sign deleteSign ,b.total_amount totalAmount ,b.sales_type salesType ,b.other,a.examine_type examineType,
     a.process_status status,a.commodity_id commodityId,a.commodity_name commodityName,
     a.commodity_quantity commodityQuantity,a.task_comment taskComment,a.picture_url pictureUrl,
     e.service_life serviceLife ,e.service_year serviceYear,e.year_sum yearSum,e.contract_term contractTerm
@@ -2382,7 +2391,7 @@
 
 
 
-    <delete id="deleteBySplitId" parameterType="java.lang.Integer">
+  <delete id="deleteBySplitId" parameterType="java.lang.Integer">
     delete from t_order_task
     where split_super = #{id,jdbcType=INTEGER}
   </delete>

+ 13 - 0
src/main/java/com/goafanti/common/model/TOrderTask.java

@@ -334,6 +334,11 @@ public class TOrderTask implements Serializable {
      */
     private String satisfactionDegreeUrl;
 
+    /**
+     * 0=全部 ,1=财务审核,2=财务复审,3=已审核
+     */
+    private Integer examineType;
+
     private static final long serialVersionUID = 1L;
 
     public Integer getId() {
@@ -855,4 +860,12 @@ public class TOrderTask implements Serializable {
     public void setSatisfactionDegreeUrl(String satisfactionDegreeUrl) {
         this.satisfactionDegreeUrl = satisfactionDegreeUrl;
     }
+
+    public Integer getExamineType() {
+        return examineType;
+    }
+
+    public void setExamineType(Integer examineType) {
+        this.examineType = examineType;
+    }
 }

+ 9 - 0
src/main/java/com/goafanti/order/bo/OutMemberList.java

@@ -55,6 +55,15 @@ public class OutMemberList {
     private String contractTerm;
 
     private Integer myExamine;
+    private Integer examineType;
+
+    public Integer getExamineType() {
+        return examineType;
+    }
+
+    public void setExamineType(Integer examineType) {
+        this.examineType = examineType;
+    }
 
     public Integer getMyExamine() {
         return myExamine;

+ 30 - 12
src/main/java/com/goafanti/order/service/impl/OrderProjectServiceImpl.java

@@ -1224,7 +1224,7 @@ public class OrderProjectServiceImpl extends BaseMybatisDao<TOrderTaskMapper> im
 		addParam(in, map);
 		Pagination<OutMemberList> page = (Pagination<OutMemberList>) findPage("findMemberList", "findMemberCount", map, in.getPageNo(), in.getPageSize());
 		List<OutMemberList> list = (List<OutMemberList>) page.getList();
-		pushMyExamine(list);
+		if (!list.isEmpty())pushMyExamine(list);
 		return page;
 	}
 
@@ -1317,18 +1317,24 @@ public class OrderProjectServiceImpl extends BaseMybatisDao<TOrderTaskMapper> im
 			if (in.getType()==0){
 				if(task.getProcessStatus()!=1)throw  new BusinessException("审核状态错误");
 				List<TOrderExamine> list = tOrderExamineMapper.selectByTid(task.getId());
-				int count =0;
-				for (TOrderExamine e : list) {
-					//当前未审核修改为审核
-					if (e.getStatus()==0&&e.getAid().equals(TokenManager.getAdminId())){
-						e.setStatus(1);
-						tOrderExamineMapper.updateByPrimaryKey(e);
-						count++;
-					}else if (e.getStatus()==1){
-						count++;
+				OrganizationListOut dep = tOrderNewMapper.selectOrderFinance(task.getOrderNo());
+				int examineType =task.getExamineType();
+				String aid=TokenManager.getAdminId();
+				if (aid.equals(dep.getFinanceId())){
+					if (examineType==3){
+						examineType=2;
+					} else if (examineType==1) {
+						examineType=4;
+					}
+				}else if (aid.equals(dep.getRetrialFinanceId())){
+					if (examineType==3){
+						examineType=1;
+					}else if (examineType==2){
+						examineType=4;
 					}
 				}
-				if(count==list.size()){
+				nt.setExamineType(examineType);
+				if(examineType==4){
 					flag=true;
 				}
 				if (task.getMemberType()==1||task.getMemberType()==2){
@@ -1373,8 +1379,8 @@ public class OrderProjectServiceImpl extends BaseMybatisDao<TOrderTaskMapper> im
 		}
 		if (flag){
 			addNoticMember(notice, ono, in.getType(),result);
-			tOrderTaskMapper.updateByPrimaryKeySelective(nt);
 		}
+		tOrderTaskMapper.updateByPrimaryKeySelective(nt);
 		return 1;
 	}
 
@@ -1457,6 +1463,7 @@ public class OrderProjectServiceImpl extends BaseMybatisDao<TOrderTaskMapper> im
 		tOrderTask.setMain(0);
 		tOrderTask.setCommodityPrice(new BigDecimal(0));
 		tOrderTaskMapper.insertSelective(tOrderTask);
+
 		TTaskMember t = tTaskMemberMapper.selectByTid(tid);
 		TOrderTaskBo tb=new TOrderTaskBo();
 		BeanUtils.copyProperties(tOrderTask,tb);
@@ -1488,14 +1495,25 @@ public class OrderProjectServiceImpl extends BaseMybatisDao<TOrderTaskMapper> im
 	private void addMemberExamine(TOrderTask t) {
 		OrganizationListOut dep = tOrderNewMapper.selectOrderFinance(t.getOrderNo());
 		List<TOrderExamine> list=new ArrayList<>();
+		TOrderTask tOrderTask= new TOrderTask();
 		if(!Objects.isNull(dep)){
+			int examineType=0;
 			if (!Objects.isNull(dep.getFinanceId())){
 				list.add(new TOrderExamine(t.getOrderNo(),1,t.getId(),dep.getFinanceId(),dep.getFinanceName()));
+				examineType=1;
 			}
 			if (!Objects.isNull(dep.getRetrialFinanceId())){
 				list.add(new TOrderExamine(t.getOrderNo(),1,t.getId(),dep.getRetrialFinanceId(),dep.getRetrialFinanceName()));
+				if(examineType==1){
+					examineType=3;
+				}else {
+					examineType=2;
+				}
 			}
+			tOrderTask.setExamineType(examineType);
 		}
+		tOrderTask.setId(t.getId());
+		tOrderTaskMapper.updateByPrimaryKeySelective(tOrderTask);
 		tOrderExamineMapper.insertBatch(list);
 	}