Browse Source

Merge branch 'test' of jishutao/kede-server into prod

anderx 2 years ago
parent
commit
dfaa919d3a

+ 21 - 9
src/main/java/com/goafanti/admin/controller/AdminDepartmentApiController.java

@@ -2,20 +2,17 @@ package com.goafanti.admin.controller;
 
 
 
-import javax.annotation.Resource;
-
-
-
-import org.springframework.stereotype.Controller;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-
 import com.goafanti.admin.service.DepartmentService;
 import com.goafanti.common.bo.Result;
 import com.goafanti.common.constant.ErrorConstants;
 import com.goafanti.common.controller.CertifyApiController;
 import com.goafanti.common.model.WorkingHours;
 import com.goafanti.common.utils.StringUtils;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+
+import javax.annotation.Resource;
 
 @Controller
 @RequestMapping(value = "/api/admin/department")
@@ -36,7 +33,7 @@ public class AdminDepartmentApiController extends CertifyApiController {
 			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", ""));
 			return res;
 		}
-		if (departmentService.checkWorkingHoursType(in.getType())) {
+		if (departmentService.checkWorkingHoursType(in)) {
 			res.getError().add(buildError(ErrorConstants.PARAM_BEING_ERROR, "", "分类"));
 			return res;
 		}
@@ -44,6 +41,21 @@ public class AdminDepartmentApiController extends CertifyApiController {
 		return res;
 	}
 
+
+	/**
+	 * 新增工作时间
+	 */
+	@RequestMapping(value = "/workingHours/update", method = RequestMethod.POST)
+	public Result update(WorkingHours in) {
+		Result res = new Result();
+		if (departmentService.checkWorkingHoursType(in)) {
+			res.getError().add(buildError(ErrorConstants.PARAM_BEING_ERROR, "", "分类"));
+			return res;
+		}
+		res.setData(departmentService.updateWorkingHours(in));
+		return res;
+	}
+
 	/**
 	 * 删除工作时间
 	 */

+ 2 - 3
src/main/java/com/goafanti/admin/service/DepartmentService.java

@@ -1,6 +1,5 @@
 package com.goafanti.admin.service;
 
-import com.goafanti.admin.bo.DepartmentComboBox;
 import com.goafanti.common.model.Department;
 import com.goafanti.common.model.WorkingHours;
 
@@ -17,7 +16,7 @@ public interface DepartmentService {
 
 	Object getWorkingHours(String depId);
 
-	boolean checkWorkingHoursType(Integer type);
+	boolean checkWorkingHoursType(WorkingHours type);
 
 	boolean checkDepWorkingHouresType(Integer id);
 
@@ -54,5 +53,5 @@ public interface DepartmentService {
 	List<String> comparePermissions(List<String> aDep, String deps);
 
 
-
+	int updateWorkingHours(WorkingHours in);
 }

+ 27 - 16
src/main/java/com/goafanti/admin/service/impl/DepartmentServiceImpl.java

@@ -1,24 +1,18 @@
 package com.goafanti.admin.service.impl;
 
-import java.util.ArrayList;
-import java.util.Arrays;
-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.admin.service.DepartmentService;
 import com.goafanti.common.dao.DepartmentMapper;
+import com.goafanti.common.dao.WorkingHoursMapper;
 import com.goafanti.common.model.Department;
+import com.goafanti.common.model.WorkingHours;
+import com.goafanti.core.mybatis.BaseMybatisDao;
 import com.goafanti.core.shiro.token.TokenManager;
-import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
-import com.goafanti.admin.service.DepartmentService;
-import com.goafanti.common.dao.WorkingHoursMapper;
-import com.goafanti.common.model.WorkingHours;
-import com.goafanti.core.mybatis.BaseMybatisDao;
+import java.util.ArrayList;
+import java.util.List;
 
 @Service
 public class DepartmentServiceImpl extends BaseMybatisDao<WorkingHoursMapper> implements DepartmentService {
@@ -35,6 +29,11 @@ public class DepartmentServiceImpl extends BaseMybatisDao<WorkingHoursMapper> im
 	}
 
 	@Override
+	public int updateWorkingHours(WorkingHours in) {
+		return workingHoursMapper.updateByPrimaryKeySelective(in);
+	}
+
+	@Override
 	public int deleteWorkingHours(Integer id) {
 		return workingHoursMapper.deleteByPrimaryKey(id);
 	}
@@ -50,10 +49,21 @@ public class DepartmentServiceImpl extends BaseMybatisDao<WorkingHoursMapper> im
 	}
 
 	@Override
-	public boolean checkWorkingHoursType(Integer type) {
-		int i=workingHoursMapper.getTypeCount(type);
-		if(i>0) {
-			return true;
+	public boolean checkWorkingHoursType(WorkingHours in) {
+		//如果没有分类,则无法判断数据库,也用于修改
+		if (in.getType()!=null){
+			List<WorkingHours> typeCount = workingHoursMapper.getTypeCount(in.getType());
+			//新增,有则不允许新增
+			if (in.getId()==null) {
+				if(typeCount.size()>0) return true;
+				//修改,判断
+			}else {
+				for (WorkingHours e : typeCount) {
+					if (!e.getId().equals(in.getId())){
+						return true;
+					}
+				}
+			}
 		}
 		return false;
 	}
@@ -123,6 +133,7 @@ public class DepartmentServiceImpl extends BaseMybatisDao<WorkingHoursMapper> im
 
 
 
+
 	public List<String> comparePermissions(List<String> aDep, List<String> input) {
 		List<String> myAll=new ArrayList<>();
 		for (String s : aDep) {

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

@@ -27,4 +27,5 @@ public interface TOrderExamineMapper {
     int selectByOrderNoAndAid(@Param("orderNo")String orderNo,@Param("aid") String aid);
 
 
+    void deleteByOrderNo(String orderNo);
 }

+ 22 - 47
src/main/java/com/goafanti/common/dao/WorkingHoursMapper.java

@@ -1,54 +1,29 @@
 package com.goafanti.common.dao;
 
-import java.util.List;
-
+import com.goafanti.common.model.WorkingHours;
 import org.apache.ibatis.annotations.Param;
 
-import com.goafanti.common.model.WorkingHours;
+import java.util.List;
 
 public interface WorkingHoursMapper {
+    int deleteByPrimaryKey(Integer id);
+
+    int insert(WorkingHours record);
+
+    int insertSelective(WorkingHours record);
+
+    WorkingHours selectByPrimaryKey(Integer id);
+
+    int updateByPrimaryKeySelective(WorkingHours record);
+
+    int updateByPrimaryKey(WorkingHours record);
+
+
+    List<WorkingHours> selectList();
+
+    WorkingHours selectBydepId(@Param("depId")String depId);
+
+    List<WorkingHours> getTypeCount(Integer type);
 
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table working_hours
-	 * @mbg.generated  Fri Jul 09 11:31:02 CST 2021
-	 */
-	int deleteByPrimaryKey(Integer id);
-
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table working_hours
-	 * @mbg.generated  Fri Jul 09 11:31:02 CST 2021
-	 */
-	int insert(WorkingHours record);
-
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table working_hours
-	 * @mbg.generated  Fri Jul 09 11:31:02 CST 2021
-	 */
-	int insertSelective(WorkingHours record);
-
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table working_hours
-	 * @mbg.generated  Fri Jul 09 11:31:02 CST 2021
-	 */
-	WorkingHours selectByPrimaryKey(Integer id);
-
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table working_hours
-	 * @mbg.generated  Fri Jul 09 11:31:02 CST 2021
-	 */
-	int updateByPrimaryKeySelective(WorkingHours record);
-
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table working_hours
-	 * @mbg.generated  Fri Jul 09 11:31:02 CST 2021
-	 */
-	int updateByPrimaryKey(WorkingHours record);
-
-	List<WorkingHours> selectList();
-
-	WorkingHours selectBydepId(@Param("depId")String depId);
-
-	int getTypeCount(Integer type);
-
-	int getDepTypeCount(Integer id);
-}
+    int getDepTypeCount(Integer id);
+}

+ 6 - 2
src/main/java/com/goafanti/common/mapper/TOrderExamineMapper.xml

@@ -23,7 +23,8 @@
     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 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},
@@ -129,6 +130,9 @@
     from t_order_examine where status=0
     and order_no = #{orderNo} and aid= #{aid}
   </select>
-
+  <delete id="deleteByOrderNo">
+    delete from t_order_examine
+    where order_no = #{orderNo}
+  </delete>
 
 </mapper>

+ 33 - 66
src/main/java/com/goafanti/common/mapper/WorkingHoursMapper.xml

@@ -2,11 +2,6 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.goafanti.common.dao.WorkingHoursMapper">
   <resultMap id="BaseResultMap" type="com.goafanti.common.model.WorkingHours">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Fri Jul 09 11:31:02 CST 2021.
-    -->
     <id column="id" jdbcType="INTEGER" property="id" />
     <result column="name" jdbcType="VARCHAR" property="name" />
     <result column="type" jdbcType="INTEGER" property="type" />
@@ -15,59 +10,32 @@
     <result column="rest_end" jdbcType="VARCHAR" property="restEnd" />
     <result column="end" jdbcType="VARCHAR" property="end" />
     <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
+    <result column="min_hours" jdbcType="DOUBLE" property="minHours" />
   </resultMap>
   <sql id="Base_Column_List">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Fri Jul 09 11:31:02 CST 2021.
-    -->
-    id, `name`, `type`, `start`, rest_start, rest_end, `end`, create_time
+    id, `name`, `type`, `start`, rest_start, rest_end, `end`, create_time, min_hours
   </sql>
   <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Fri Jul 09 11:31:02 CST 2021.
-    -->
-    select 
+    select
     <include refid="Base_Column_List" />
     from working_hours
     where id = #{id,jdbcType=INTEGER}
   </select>
   <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Fri Jul 09 11:31:02 CST 2021.
-    -->
     delete from working_hours
     where id = #{id,jdbcType=INTEGER}
   </delete>
-  <insert id="insert" parameterType="com.goafanti.common.model.WorkingHours">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Fri Jul 09 11:31:02 CST 2021.
-    -->
-    insert into working_hours (id, `name`, `type`, 
-      `start`, rest_start, rest_end, 
-      `end`, create_time)
-    values (#{id,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, #{type,jdbcType=INTEGER}, 
-      #{start,jdbcType=VARCHAR}, #{restStart,jdbcType=VARCHAR}, #{restEnd,jdbcType=VARCHAR}, 
-      #{end,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP})
+  <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.WorkingHours" useGeneratedKeys="true">
+    insert into working_hours (`name`, `type`, `start`,
+      rest_start, rest_end, `end`,
+      create_time, min_hours)
+    values (#{name,jdbcType=VARCHAR}, #{type,jdbcType=INTEGER}, #{start,jdbcType=VARCHAR},
+      #{restStart,jdbcType=VARCHAR}, #{restEnd,jdbcType=VARCHAR}, #{end,jdbcType=VARCHAR},
+      #{createTime,jdbcType=TIMESTAMP}, #{minHours,jdbcType=DOUBLE})
   </insert>
-  <insert id="insertSelective" parameterType="com.goafanti.common.model.WorkingHours">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Fri Jul 09 11:31:02 CST 2021.
-    -->
+  <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.WorkingHours" useGeneratedKeys="true">
     insert into working_hours
     <trim prefix="(" suffix=")" suffixOverrides=",">
-      <if test="id != null">
-        id,
-      </if>
       <if test="name != null">
         `name`,
       </if>
@@ -89,11 +57,11 @@
       <if test="createTime != null">
         create_time,
       </if>
+      <if test="minHours != null">
+        min_hours,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
-      <if test="id != null">
-        #{id,jdbcType=INTEGER},
-      </if>
       <if test="name != null">
         #{name,jdbcType=VARCHAR},
       </if>
@@ -115,14 +83,12 @@
       <if test="createTime != null">
         #{createTime,jdbcType=TIMESTAMP},
       </if>
+      <if test="minHours != null">
+        #{minHours,jdbcType=DOUBLE},
+      </if>
     </trim>
   </insert>
   <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.WorkingHours">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Fri Jul 09 11:31:02 CST 2021.
-    -->
     update working_hours
     <set>
       <if test="name != null">
@@ -146,15 +112,13 @@
       <if test="createTime != null">
         create_time = #{createTime,jdbcType=TIMESTAMP},
       </if>
+      <if test="minHours != null">
+        min_hours = #{minHours,jdbcType=DOUBLE},
+      </if>
     </set>
     where id = #{id,jdbcType=INTEGER}
   </update>
   <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.WorkingHours">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Fri Jul 09 11:31:02 CST 2021.
-    -->
     update working_hours
     set `name` = #{name,jdbcType=VARCHAR},
       `type` = #{type,jdbcType=INTEGER},
@@ -162,30 +126,33 @@
       rest_start = #{restStart,jdbcType=VARCHAR},
       rest_end = #{restEnd,jdbcType=VARCHAR},
       `end` = #{end,jdbcType=VARCHAR},
-      create_time = #{createTime,jdbcType=TIMESTAMP}
+      create_time = #{createTime,jdbcType=TIMESTAMP},
+      min_hours = #{minHours,jdbcType=DOUBLE}
     where id = #{id,jdbcType=INTEGER}
   </update>
-  
+
     <select id="selectList" parameterType="java.lang.Integer" resultMap="BaseResultMap">
-    select 
+    select
     <include refid="Base_Column_List" />
     from working_hours
   </select>
-  
+
   <select id="selectBydepId"  resultType="com.goafanti.common.model.WorkingHours">
-    select 
+    select
     a.id,a.name,a.`type`, a.`start`, a.rest_start restStart, a.rest_end restEnd, a.`end`, a.create_time createTime
     from department d  left join working_hours a on d.working_hours_type =a.type
     where d.id = #{depId}
   </select>
-  <select id="getTypeCount" resultType="java.lang.Integer">
-  select count(*) from working_hours where type= #{type}
+  <select id="getTypeCount" resultMap="BaseResultMap">
+    select
+    <include refid="Base_Column_List" />
+  from working_hours where type= #{type}
   </select>
-  
+
   <select id="getDepTypeCount" resultType="java.lang.Integer">
-  select 
+  select
     count(*)
     from department d  left join working_hours a on d.working_hours_type =a.type
     where a.id= #{id}
   </select>
-</mapper>
+</mapper>

+ 119 - 213
src/main/java/com/goafanti/common/model/WorkingHours.java

@@ -3,218 +3,124 @@ package com.goafanti.common.model;
 import java.io.Serializable;
 import java.util.Date;
 
+/**
+ * working_hours
+ * @author 
+ */
 public class WorkingHours implements Serializable {
-
-	/**
-	 * This field was generated by MyBatis Generator. This field corresponds to the database column working_hours.id
-	 * @mbg.generated  Fri Jul 09 11:31:02 CST 2021
-	 */
-	private Integer id;
-	/**
-	 * This field was generated by MyBatis Generator. This field corresponds to the database column working_hours.name
-	 * @mbg.generated  Fri Jul 09 11:31:02 CST 2021
-	 */
-	private String name;
-	/**
-	 * This field was generated by MyBatis Generator. This field corresponds to the database column working_hours.type
-	 * @mbg.generated  Fri Jul 09 11:31:02 CST 2021
-	 */
-	private Integer type;
-	/**
-	 * This field was generated by MyBatis Generator. This field corresponds to the database column working_hours.start
-	 * @mbg.generated  Fri Jul 09 11:31:02 CST 2021
-	 */
-	private String start;
-	/**
-	 * This field was generated by MyBatis Generator. This field corresponds to the database column working_hours.rest_start
-	 * @mbg.generated  Fri Jul 09 11:31:02 CST 2021
-	 */
-	private String restStart;
-	/**
-	 * This field was generated by MyBatis Generator. This field corresponds to the database column working_hours.rest_end
-	 * @mbg.generated  Fri Jul 09 11:31:02 CST 2021
-	 */
-	private String restEnd;
-	/**
-	 * This field was generated by MyBatis Generator. This field corresponds to the database column working_hours.end
-	 * @mbg.generated  Fri Jul 09 11:31:02 CST 2021
-	 */
-	private String end;
-	/**
-	 * This field was generated by MyBatis Generator. This field corresponds to the database column working_hours.create_time
-	 * @mbg.generated  Fri Jul 09 11:31:02 CST 2021
-	 */
-	private Date createTime;
-	/**
-	 * This field was generated by MyBatis Generator. This field corresponds to the database table working_hours
-	 * @mbg.generated  Fri Jul 09 11:31:02 CST 2021
-	 */
-	private static final long serialVersionUID = 1L;
-
-	/**
-	 * This method was generated by MyBatis Generator. This method returns the value of the database column working_hours.id
-	 * @return  the value of working_hours.id
-	 * @mbg.generated  Fri Jul 09 11:31:02 CST 2021
-	 */
-	public Integer getId() {
-		return id;
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method sets the value of the database column working_hours.id
-	 * @param id  the value for working_hours.id
-	 * @mbg.generated  Fri Jul 09 11:31:02 CST 2021
-	 */
-	public void setId(Integer id) {
-		this.id = id;
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method returns the value of the database column working_hours.name
-	 * @return  the value of working_hours.name
-	 * @mbg.generated  Fri Jul 09 11:31:02 CST 2021
-	 */
-	public String getName() {
-		return name;
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method sets the value of the database column working_hours.name
-	 * @param name  the value for working_hours.name
-	 * @mbg.generated  Fri Jul 09 11:31:02 CST 2021
-	 */
-	public void setName(String name) {
-		this.name = name == null ? null : name.trim();
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method returns the value of the database column working_hours.type
-	 * @return  the value of working_hours.type
-	 * @mbg.generated  Fri Jul 09 11:31:02 CST 2021
-	 */
-	public Integer getType() {
-		return type;
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method sets the value of the database column working_hours.type
-	 * @param type  the value for working_hours.type
-	 * @mbg.generated  Fri Jul 09 11:31:02 CST 2021
-	 */
-	public void setType(Integer type) {
-		this.type = type;
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method returns the value of the database column working_hours.start
-	 * @return  the value of working_hours.start
-	 * @mbg.generated  Fri Jul 09 11:31:02 CST 2021
-	 */
-	public String getStart() {
-		return start;
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method sets the value of the database column working_hours.start
-	 * @param start  the value for working_hours.start
-	 * @mbg.generated  Fri Jul 09 11:31:02 CST 2021
-	 */
-	public void setStart(String start) {
-		this.start = start == null ? null : start.trim();
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method returns the value of the database column working_hours.rest_start
-	 * @return  the value of working_hours.rest_start
-	 * @mbg.generated  Fri Jul 09 11:31:02 CST 2021
-	 */
-	public String getRestStart() {
-		return restStart;
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method sets the value of the database column working_hours.rest_start
-	 * @param restStart  the value for working_hours.rest_start
-	 * @mbg.generated  Fri Jul 09 11:31:02 CST 2021
-	 */
-	public void setRestStart(String restStart) {
-		this.restStart = restStart == null ? null : restStart.trim();
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method returns the value of the database column working_hours.rest_end
-	 * @return  the value of working_hours.rest_end
-	 * @mbg.generated  Fri Jul 09 11:31:02 CST 2021
-	 */
-	public String getRestEnd() {
-		return restEnd;
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method sets the value of the database column working_hours.rest_end
-	 * @param restEnd  the value for working_hours.rest_end
-	 * @mbg.generated  Fri Jul 09 11:31:02 CST 2021
-	 */
-	public void setRestEnd(String restEnd) {
-		this.restEnd = restEnd == null ? null : restEnd.trim();
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method returns the value of the database column working_hours.end
-	 * @return  the value of working_hours.end
-	 * @mbg.generated  Fri Jul 09 11:31:02 CST 2021
-	 */
-	public String getEnd() {
-		return end;
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method sets the value of the database column working_hours.end
-	 * @param end  the value for working_hours.end
-	 * @mbg.generated  Fri Jul 09 11:31:02 CST 2021
-	 */
-	public void setEnd(String end) {
-		this.end = end == null ? null : end.trim();
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method returns the value of the database column working_hours.create_time
-	 * @return  the value of working_hours.create_time
-	 * @mbg.generated  Fri Jul 09 11:31:02 CST 2021
-	 */
-	public Date getCreateTime() {
-		return createTime;
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method sets the value of the database column working_hours.create_time
-	 * @param createTime  the value for working_hours.create_time
-	 * @mbg.generated  Fri Jul 09 11:31:02 CST 2021
-	 */
-	public void setCreateTime(Date createTime) {
-		this.createTime = createTime;
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table working_hours
-	 * @mbg.generated  Fri Jul 09 11:31:02 CST 2021
-	 */
-	@Override
-	public String toString() {
-		StringBuilder sb = new StringBuilder();
-		sb.append(getClass().getSimpleName());
-		sb.append(" [");
-		sb.append("Hash = ").append(hashCode());
-		sb.append(", id=").append(id);
-		sb.append(", name=").append(name);
-		sb.append(", type=").append(type);
-		sb.append(", start=").append(start);
-		sb.append(", restStart=").append(restStart);
-		sb.append(", restEnd=").append(restEnd);
-		sb.append(", end=").append(end);
-		sb.append(", createTime=").append(createTime);
-		sb.append(", serialVersionUID=").append(serialVersionUID);
-		sb.append("]");
-		return sb.toString();
-	}
+    private Integer id;
+
+    /**
+     * 名称
+     */
+    private String name;
+
+    /**
+     * 类型
+     */
+    private Integer type;
+
+    /**
+     * 开始时间
+     */
+    private String start;
+
+    /**
+     * 休息开始时间
+     */
+    private String restStart;
+
+    /**
+     * 休息结束时间
+     */
+    private String restEnd;
+
+    /**
+     * 结束时间
+     */
+    private String end;
+
+    /**
+     * 创建时间
+     */
+    private Date createTime;
+
+    /**
+     * 最小公出时长
+     */
+    private Double minHours;
+
+    private static final long serialVersionUID = 1L;
+
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public Integer getType() {
+        return type;
+    }
+
+    public void setType(Integer type) {
+        this.type = type;
+    }
+
+    public String getStart() {
+        return start;
+    }
+
+    public void setStart(String start) {
+        this.start = start;
+    }
+
+    public String getRestStart() {
+        return restStart;
+    }
+
+    public void setRestStart(String restStart) {
+        this.restStart = restStart;
+    }
+
+    public String getRestEnd() {
+        return restEnd;
+    }
+
+    public void setRestEnd(String restEnd) {
+        this.restEnd = restEnd;
+    }
+
+    public String getEnd() {
+        return end;
+    }
+
+    public void setEnd(String end) {
+        this.end = end;
+    }
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    public Double getMinHours() {
+        return minHours;
+    }
+
+    public void setMinHours(Double minHours) {
+        this.minHours = minHours;
+    }
 }

+ 35 - 33
src/main/java/com/goafanti/order/service/impl/OrderNewServiceImpl.java

@@ -1,60 +1,57 @@
 package com.goafanti.order.service.impl;
 
 
-import java.io.IOException;
-import java.io.UnsupportedEncodingException;
-import java.math.BigDecimal;
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
-import java.util.*;
-import java.util.stream.Collectors;
-
-
-import javax.mail.MessagingException;
-
-import com.goafanti.admin.service.DepartmentService;
-import com.goafanti.common.bo.Result;
-import com.goafanti.common.dao.*;
-import com.goafanti.common.model.*;
-import com.goafanti.common.utils.excel.NewExcelUtil;
-import com.goafanti.order.bo.*;
-import com.goafanti.order.enums.*;
-import com.goafanti.order.service.OrderProjectService;
-import com.goafanti.organization.bo.*;
-import com.goafanti.common.utils.StringUtils;
-import groovy.transform.Synchronized;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.BeanUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.cache.annotation.Cacheable;
-import org.springframework.scheduling.annotation.EnableAsync;
-import org.springframework.stereotype.Service;
-
 import com.alibaba.fastjson.JSON;
 import com.goafanti.admin.bo.AdminListBo;
+import com.goafanti.admin.service.DepartmentService;
 import com.goafanti.common.bo.EmailBo;
 import com.goafanti.common.bo.Error;
 import com.goafanti.common.bo.OrderOperator;
+import com.goafanti.common.bo.Result;
 import com.goafanti.common.constant.AFTConstants;
 import com.goafanti.common.constant.ErrorConstants;
+import com.goafanti.common.dao.*;
 import com.goafanti.common.enums.NoticeStatus;
 import com.goafanti.common.enums.OfficialPatentType;
 import com.goafanti.common.enums.OrderLogProcess;
 import com.goafanti.common.error.BusinessException;
+import com.goafanti.common.model.*;
 import com.goafanti.common.utils.AsyncUtils;
 import com.goafanti.common.utils.LoggerUtils;
 import com.goafanti.common.utils.SendEmailUtil;
+import com.goafanti.common.utils.StringUtils;
+import com.goafanti.common.utils.excel.NewExcelUtil;
 import com.goafanti.core.mybatis.BaseMybatisDao;
 import com.goafanti.core.mybatis.JDBCIdGenerator;
 import com.goafanti.core.mybatis.page.Pagination;
 import com.goafanti.core.shiro.token.TokenManager;
 import com.goafanti.customer.bo.LockingReleaseBo;
+import com.goafanti.order.bo.*;
+import com.goafanti.order.enums.*;
 import com.goafanti.order.service.OrderNewService;
+import com.goafanti.order.service.OrderProjectService;
+import com.goafanti.organization.bo.*;
 import com.goafanti.patent.service.PatentNewService;
+import groovy.transform.Synchronized;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.cache.annotation.Cacheable;
+import org.springframework.scheduling.annotation.EnableAsync;
+import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
+import javax.mail.MessagingException;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.math.BigDecimal;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.*;
+import java.util.stream.Collectors;
+
 @Service
 @EnableAsync
 public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> implements OrderNewService {
@@ -189,7 +186,7 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 		if (tOrderExamines.isEmpty()){
 			OrganizationListOut dep = departmentMapper.selectAllById(o.getOrderDep());
 			List<TOrderExamine> list =new ArrayList<>();
-			list.add(new TOrderExamine(o.getOrderNo(),dep.getFinanceId(),dep.getFinanceName()));
+			if (dep!=null&&dep.getFinanceId()!=null)list.add(new TOrderExamine(o.getOrderNo(),dep.getFinanceId(),dep.getFinanceName()));
 			List<Admin> admins = adminMapper.selectAdminByRoleType(AFTConstants.TECH_ADMIN);
 			for (Admin admin : admins) {
 				list.add(new TOrderExamine(o.getOrderNo(),admin.getId(),admin.getName()));
@@ -529,7 +526,12 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 				contractNoReplace(t.getOrderNo(), t2.getContractNo(),t2.getOrderDep());
 				createContractNo(t);
 			}
-			//修改订单中间表信息
+			//如果修改了部门she审核财务也要切换
+			if(!t.getOrderDep().equals(t2.getOrderDep())) {
+				tOrderExamineMapper.deleteByOrderNo(t.getOrderNo());
+				addOrderExamine(t);
+			}
+			// 修改订单中间表信息
 			t.setBuyerId(t2.getBuyerId());
 			updateOrderMid(t);
 			List<String> aids = new ArrayList<>();

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

@@ -52,7 +52,7 @@ yxjl_max=100
 amb.maxLvl=6
 
 avatar.host=//static.jishutao.com
-static.host=//static.jishutao.com/1.2.71
+static.host=//static.jishutao.com/1.2.72
 rd.static.host=//static.jishutao.com/RD/1.0.00
 #avatar.host=//172.16.0.255:3000
 #static.host=//172.16.0.255:3000/1.2.62

+ 1 - 1
src/main/resources/props/config_test.properties

@@ -49,7 +49,7 @@ yxjl_max=100
 
 amb.maxLvl=6
 
-static.host=//static.jishutao.com/1.2.71
+static.host=//static.jishutao.com/1.2.72
 portal.host=//static.jishutao.com/portal/2.0.6
 avatar.host=//static.jishutao.com
 rd.static.host=//static.jishutao.com/RD/1.0.00