Commit 75c7552a by 水库浪子

修改个人活码编辑bug

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