Commit e884e7c1 by qwmqiuwenmin

fix

parent 80a9011b
...@@ -42,6 +42,8 @@ public class DepartmentDTO implements Serializable { ...@@ -42,6 +42,8 @@ public class DepartmentDTO implements Serializable {
private String storeCode; private String storeCode;
private Integer bindFlag; private Integer bindFlag;
private String relatedCode;
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
...@@ -196,6 +198,14 @@ public class DepartmentDTO implements Serializable { ...@@ -196,6 +198,14 @@ public class DepartmentDTO implements Serializable {
public void setBindFlag(Integer bindFlag) { public void setBindFlag(Integer bindFlag) {
this.bindFlag = bindFlag; this.bindFlag = bindFlag;
} }
public String getRelatedCode() {
return relatedCode;
}
public void setRelatedCode(String relatedCode) {
this.relatedCode = relatedCode;
}
......
...@@ -33,6 +33,8 @@ public class TabHaobanDepartment implements Serializable { ...@@ -33,6 +33,8 @@ public class TabHaobanDepartment implements Serializable {
private Integer sort; private Integer sort;
private String wxEnterpriseId; private String wxEnterpriseId;
private String relatedCode;
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
...@@ -155,6 +157,14 @@ public class TabHaobanDepartment implements Serializable { ...@@ -155,6 +157,14 @@ public class TabHaobanDepartment implements Serializable {
public void setChainName(String chainName) { public void setChainName(String chainName) {
this.chainName = chainName; this.chainName = chainName;
} }
public String getRelatedCode() {
return relatedCode;
}
public void setRelatedCode(String relatedCode) {
this.relatedCode = relatedCode;
}
} }
\ No newline at end of file
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
<result column="department_name" property="departmentName" jdbcType="VARCHAR" /> <result column="department_name" property="departmentName" jdbcType="VARCHAR" />
<result column="parent_department_id" property="parentDepartmentId" jdbcType="VARCHAR" /> <result column="parent_department_id" property="parentDepartmentId" jdbcType="VARCHAR" />
<result column="related_id" property="relatedId" jdbcType="VARCHAR" /> <result column="related_id" property="relatedId" jdbcType="VARCHAR" />
<result column="related_code" property="relatedCode" jdbcType="VARCHAR" />
<result column="chain_id" property="chainId" jdbcType="VARCHAR" /> <result column="chain_id" property="chainId" jdbcType="VARCHAR" />
<result column="chain_name" property="chainName" jdbcType="VARCHAR" /> <result column="chain_name" property="chainName" jdbcType="VARCHAR" />
<result column="is_store" property="isStore" jdbcType="INTEGER" /> <result column="is_store" property="isStore" jdbcType="INTEGER" />
...@@ -19,7 +20,7 @@ ...@@ -19,7 +20,7 @@
<result column="level" property="level" jdbcType="INTEGER" /> <result column="level" property="level" jdbcType="INTEGER" />
</resultMap> </resultMap>
<sql id="Base_Column_List" > <sql id="Base_Column_List" >
department_id, department_name, parent_department_id, related_id, chain_id, is_store, department_id, department_name, parent_department_id, related_id, related_code,chain_id, is_store,
status_flag, recycle_flag, create_time, update_time,wx_department_id,sort,level,wx_enterprise_id,chain_name status_flag, recycle_flag, create_time, update_time,wx_department_id,sort,level,wx_enterprise_id,chain_name
</sql> </sql>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" > <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
...@@ -34,11 +35,11 @@ ...@@ -34,11 +35,11 @@
</delete> </delete>
<insert id="insert" parameterType="com.gic.haoban.manage.service.entity.TabHaobanDepartment" > <insert id="insert" parameterType="com.gic.haoban.manage.service.entity.TabHaobanDepartment" >
insert into tab_haoban_department (department_id, department_name, parent_department_id, insert into tab_haoban_department (department_id, department_name, parent_department_id,
related_id, chain_id, is_store, related_id,related_code, chain_id, is_store,
status_flag, recycle_flag, create_time, status_flag, recycle_flag, create_time,
update_time,wx_department_id,sort,level,wx_enterprise_id,chain_name) update_time,wx_department_id,sort,level,wx_enterprise_id,chain_name)
values (#{departmentId,jdbcType=VARCHAR}, #{departmentName,jdbcType=VARCHAR}, #{parentDepartmentId,jdbcType=VARCHAR}, values (#{departmentId,jdbcType=VARCHAR}, #{departmentName,jdbcType=VARCHAR}, #{parentDepartmentId,jdbcType=VARCHAR},
#{relatedId,jdbcType=VARCHAR}, #{chainId,jdbcType=VARCHAR}, #{isStore,jdbcType=INTEGER}, #{relatedId,jdbcType=VARCHAR},#{relatedCode,jdbcType=VARCHAR}, #{chainId,jdbcType=VARCHAR}, #{isStore,jdbcType=INTEGER},
#{statusFlag,jdbcType=INTEGER}, #{recycleFlag,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{statusFlag,jdbcType=INTEGER}, #{recycleFlag,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP},
#{updateTime,jdbcType=TIMESTAMP},#{wxDepartmentId},#{sort},#{level},#{wxEnterpriseId},#{chainName}) #{updateTime,jdbcType=TIMESTAMP},#{wxDepartmentId},#{sort},#{level},#{wxEnterpriseId},#{chainName})
</insert> </insert>
...@@ -57,6 +58,9 @@ ...@@ -57,6 +58,9 @@
<if test="relatedId != null" > <if test="relatedId != null" >
related_id, related_id,
</if> </if>
<if test="relatedCode != null" >
related_code,
</if>
<if test="chainId != null" > <if test="chainId != null" >
chain_id, chain_id,
</if> </if>
...@@ -101,6 +105,9 @@ ...@@ -101,6 +105,9 @@
<if test="relatedId != null" > <if test="relatedId != null" >
#{relatedId,jdbcType=VARCHAR}, #{relatedId,jdbcType=VARCHAR},
</if> </if>
<if test="relatedCode != null" >
#{relatedCode,jdbcType=VARCHAR},
</if>
<if test="chainId != null" > <if test="chainId != null" >
#{chainId,jdbcType=VARCHAR}, #{chainId,jdbcType=VARCHAR},
</if> </if>
...@@ -145,6 +152,9 @@ ...@@ -145,6 +152,9 @@
<if test="relatedId != null" > <if test="relatedId != null" >
related_id = #{relatedId,jdbcType=VARCHAR}, related_id = #{relatedId,jdbcType=VARCHAR},
</if> </if>
<if test="relatedCode != null" >
related_code = #{relatedCode,jdbcType=VARCHAR},
</if>
<if test="chainId != null" > <if test="chainId != null" >
chain_id = #{chainId,jdbcType=VARCHAR}, chain_id = #{chainId,jdbcType=VARCHAR},
</if> </if>
...@@ -186,6 +196,7 @@ ...@@ -186,6 +196,7 @@
set department_name = #{departmentName,jdbcType=VARCHAR}, set department_name = #{departmentName,jdbcType=VARCHAR},
parent_department_id = #{parentDepartmentId,jdbcType=VARCHAR}, parent_department_id = #{parentDepartmentId,jdbcType=VARCHAR},
related_id = #{relatedId,jdbcType=VARCHAR}, related_id = #{relatedId,jdbcType=VARCHAR},
related_code = #{relatedCode,jdbcType=VARCHAR},
chain_id = #{chainId,jdbcType=VARCHAR}, chain_id = #{chainId,jdbcType=VARCHAR},
chain_name = #{chainName,jdbcType=VARCHAR}, chain_name = #{chainName,jdbcType=VARCHAR},
wx_department_id = #{wxDepartmentId,jdbcType=VARCHAR}, wx_department_id = #{wxDepartmentId,jdbcType=VARCHAR},
...@@ -245,7 +256,7 @@ ...@@ -245,7 +256,7 @@
and wx_enterprise_id = #{wxEnterpriseId} and wx_enterprise_id = #{wxEnterpriseId}
</if> </if>
<if test="keyword != null and keyword != ''"> <if test="keyword != null and keyword != ''">
and department_name like CONCAT('%',#{keyword},'%') and (department_name like CONCAT('%',#{keyword},'%') or wx_department_id like CONCAT('%',#{keyword},'%') or related_code like CONCAT('%',#{keyword},'%'))
</if> </if>
<if test="recycleFlag != null"> <if test="recycleFlag != null">
and recycle_flag = #{recycleFlag} and recycle_flag = #{recycleFlag}
......
...@@ -212,8 +212,13 @@ public class DepartmentContoller extends WebBaseController{ ...@@ -212,8 +212,13 @@ public class DepartmentContoller extends WebBaseController{
} }
Integer type = departmentAddQO.getType(); Integer type = departmentAddQO.getType();
Integer isStore = 0; Integer isStore = 0;
String storeCode = "";
if(type != null && type == 3){ if(type != null && type == 3){
isStore = 1; isStore = 1;
StoreDTO store = storeService.getStore(departmentAddQO.getRelatedId());
if(store != null){
storeCode = store.getStoreCode();
}
} }
DepartmentDTO department = new DepartmentDTO(); DepartmentDTO department = new DepartmentDTO();
department.setParentDepartmentId(parentId); department.setParentDepartmentId(parentId);
...@@ -230,6 +235,7 @@ public class DepartmentContoller extends WebBaseController{ ...@@ -230,6 +235,7 @@ public class DepartmentContoller extends WebBaseController{
department.setSort(departmentAddQO.getSort()); department.setSort(departmentAddQO.getSort());
department.setLevel(dto.getLevel() + 1); department.setLevel(dto.getLevel() + 1);
department.setRelatedId(departmentAddQO.getRelatedId()); department.setRelatedId(departmentAddQO.getRelatedId());
department.setStoreCode(storeCode);
HaobanResponse hr = departmentApiService.add(department); HaobanResponse hr = departmentApiService.add(department);
if(hr.getErrorCode() != 1) { if(hr.getErrorCode() != 1) {
continue; continue;
...@@ -386,8 +392,13 @@ public class DepartmentContoller extends WebBaseController{ ...@@ -386,8 +392,13 @@ public class DepartmentContoller extends WebBaseController{
for (DepartmentAddQO departmentAddQO : list) { for (DepartmentAddQO departmentAddQO : list) {
Integer type = departmentAddQO.getType(); Integer type = departmentAddQO.getType();
Integer isStore = 0; Integer isStore = 0;
String storeCode = "";
if(type != null && type == 3){ if(type != null && type == 3){
isStore = 1; isStore = 1;
StoreDTO store = storeService.getStore(departmentAddQO.getRelatedId());
if(store != null){
storeCode = store.getStoreCode();
}
} }
String sonParentId = ""; String sonParentId = "";
DepartmentDTO dto = departmentApiService.selectById(parentId); DepartmentDTO dto = departmentApiService.selectById(parentId);
...@@ -416,6 +427,7 @@ public class DepartmentContoller extends WebBaseController{ ...@@ -416,6 +427,7 @@ public class DepartmentContoller extends WebBaseController{
department.setIsStore(isStore); department.setIsStore(isStore);
} }
department.setRelatedId(departmentAddQO.getRelatedId()); department.setRelatedId(departmentAddQO.getRelatedId());
department.setStoreCode(storeCode);
HaobanResponse hr = departmentApiService.add(department); HaobanResponse hr = departmentApiService.add(department);
if(hr.getErrorCode() != 1) { if(hr.getErrorCode() != 1) {
continue; continue;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment