Commit 75c7552a by 水库浪子

修改个人活码编辑bug

1 parent 6a8b8f6a
...@@ -27,7 +27,7 @@ public class WeEmpleCodeUseScop ...@@ -27,7 +27,7 @@ public class WeEmpleCodeUseScop
/** $column.columnComment */ /** $column.columnComment */
@TableId @TableId
private Long id = SnowFlakeUtil.nextId(); private Long id;
/** 员工活码id */ /** 员工活码id */
@ApiModelProperty("员工活码id") @ApiModelProperty("员工活码id")
......
...@@ -30,6 +30,7 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -30,6 +30,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import javax.validation.constraints.NotEmpty;
import java.util.*; import java.util.*;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -165,16 +166,25 @@ public class WeEmpleCodeServiceImpl extends ServiceImpl<WeEmpleCodeMapper, WeEmp ...@@ -165,16 +166,25 @@ public class WeEmpleCodeServiceImpl extends ServiceImpl<WeEmpleCodeMapper, WeEmp
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
if (this.baseMapper.updateWeEmpleCode(weEmpleCode) == 1) { try {
if (CollectionUtil.isNotEmpty(weEmpleCode.getWeEmpleCodeUseScops())) {
weEmpleCode.getWeEmpleCodeUseScops().forEach(item -> item.setEmpleCodeId(weEmpleCode.getId())); if (this.baseMapper.updateWeEmpleCode(weEmpleCode) == 1) {
iWeEmpleCodeUseScopService.saveOrUpdateBatch(weEmpleCode.getWeEmpleCodeUseScops()); if (CollectionUtil.isNotEmpty(weEmpleCode.getWeEmpleCodeUseScops())) {
} List<WeEmpleCodeUseScop> weEmpleCodeUseScops = weEmpleCode.getWeEmpleCodeUseScops();
if (CollectionUtil.isNotEmpty(weEmpleCode.getWeEmpleCodeTags())) { weEmpleCode.getWeEmpleCodeUseScops().forEach(item -> item.setEmpleCodeId(weEmpleCode.getId()));
weEmpleCode.getWeEmpleCodeTags().forEach(item -> item.setEmpleCodeId(weEmpleCode.getId())); iWeEmpleCodeUseScopService.saveOrUpdateBatch(weEmpleCode.getWeEmpleCodeUseScops());
weEmpleCodeTagService.saveOrUpdateBatch(weEmpleCode.getWeEmpleCodeTags()); }
if (CollectionUtil.isNotEmpty(weEmpleCode.getWeEmpleCodeTags())) {
weEmpleCode.getWeEmpleCodeTags().forEach(item -> item.setEmpleCodeId(weEmpleCode.getId()));
weEmpleCodeTagService.saveOrUpdateBatch(weEmpleCode.getWeEmpleCodeTags());
}
} }
}catch (Exception e){
e.printStackTrace();
} }
} }
// /** // /**
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
<result property="state" column="state" /> <result property="state" column="state" />
<result property="isJoinConfirmFriends" column="is_join_confirm_friends" /> <result property="isJoinConfirmFriends" column="is_join_confirm_friends" />
<collection property="weEmpleCodeUseScops" ofType="com.linkwechat.wecom.domain.WeEmpleCodeUseScop"> <collection property="weEmpleCodeUseScops" ofType="com.linkwechat.wecom.domain.WeEmpleCodeUseScop">
<result property="id" column="scopeId"/>
<result property="businessId" column="business_id"/> <result property="businessId" column="business_id"/>
<result property="businessName" column="business_name"/> <result property="businessName" column="business_name"/>
<result property="mobile" column="mobile"/> <result property="mobile" column="mobile"/>
...@@ -74,12 +75,13 @@ ...@@ -74,12 +75,13 @@
wecusn.mobile, wecusn.mobile,
wect.tag_id, wect.tag_id,
wect.tag_name, wect.tag_name,
wecode.is_join_confirm_friends wecode.is_join_confirm_friends,
wecusn.id as scopeId
from from
we_emple_code wecode we_emple_code wecode
left join ( left join (
SELECT SELECT
wecus.emple_code_id, wecus.business_id, wecus.business_name,wu.mobile wecus.id, wecus.emple_code_id, wecus.business_id, wecus.business_name,wu.mobile
FROM FROM
we_emple_code_use_scop wecus we_emple_code_use_scop wecus
LEFT JOIN we_user wu ON LEFT JOIN we_user wu ON
...@@ -117,6 +119,7 @@ ...@@ -117,6 +119,7 @@
AND wecusn.business_name like concat('%', #{useUserName}, '%') AND wecusn.business_name like concat('%', #{useUserName}, '%')
</if> </if>
group by wecode.id group by wecode.id
order by wecode.create_time desc
</select> </select>
<select id="selectWeEmpleCodeById" parameterType="Long" resultMap="WeEmpleCodeResult"> <select id="selectWeEmpleCodeById" parameterType="Long" resultMap="WeEmpleCodeResult">
......
...@@ -76,7 +76,9 @@ ...@@ -76,7 +76,9 @@
<if test="endTime != null and endTime != ''"><!-- 结束时间检索 --> <if test="endTime != null and endTime != ''"><!-- 结束时间检索 -->
and date_format(w.create_time,'%y%m%d') &lt;= date_format(#{endTime},'%y%m%d') and date_format(w.create_time,'%y%m%d') &lt;= date_format(#{endTime},'%y%m%d')
</if> </if>
</where> </where>
ORDER BY w.create_time DESC
</select> </select>
<select id="selectWeGroupCodeListByIds" resultMap="WeGroupCodeResult"> <select id="selectWeGroupCodeListByIds" resultMap="WeGroupCodeResult">
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!