Merge remote-tracking branch 'origin/master'

master
mengjiao 10 months ago
commit ef694dcc8f

@ -17,7 +17,7 @@ public class SysNoticeGroup extends BaseEntity {
/** /**
* ID * ID
*/ */
private Long id; private String id;
/** /**
* *
@ -46,11 +46,11 @@ public class SysNoticeGroup extends BaseEntity {
private String[] groupNames; private String[] groupNames;
public void setId(Long id) { public void setId(String id) {
this.id = id; this.id = id;
} }
public Long getId() { public String getId() {
return id; return id;
} }

@ -61,10 +61,10 @@ public class SysNoticeGroupController extends BaseController {
/** /**
* - * -
*/ */
@RequiresPermissions("noticeGroup:noticeGroup:query")
@GetMapping(value = "/{id}") @GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) { public TableDataInfo getInfo(@PathVariable("id") String id) {
return success(sysNoticeGroupService.selectSysNoticeGroupById(id)); List<SysNoticeGroup> list = sysNoticeGroupService.selectByNoticeId(id);
return getDataTable(list);
} }
/** /**
@ -90,11 +90,10 @@ public class SysNoticeGroupController extends BaseController {
/** /**
* - * -
*/ */
@RequiresPermissions("noticeGroup:noticeGroup:remove")
@Log(title = "通知公告-班组", businessType = BusinessType.DELETE) @PostMapping("/delNoticeGroup")
@DeleteMapping("/{ids}") public AjaxResult delNoticeGroup(@RequestBody SysNoticeGroup sysNoticeGroup) {
public AjaxResult remove(@PathVariable Long[] ids) { return toAjax(sysNoticeGroupService.deleteByNoticeId(sysNoticeGroup));
return toAjax(sysNoticeGroupService.deleteSysNoticeGroupByIds(ids));
} }
@PostMapping("/teamBind") @PostMapping("/teamBind")

@ -19,7 +19,7 @@ public interface SysNoticeGroupMapper {
* @param id - * @param id -
* @return - * @return -
*/ */
public SysNoticeGroup selectSysNoticeGroupById(Long id); public List<SysNoticeGroup> selectByNoticeId(String id);
/** /**
* - * -
@ -62,4 +62,8 @@ public interface SysNoticeGroupMapper {
public int deleteSysNoticeGroupByIds(Long[] ids); public int deleteSysNoticeGroupByIds(Long[] ids);
public int getSerialNumber(); public int getSerialNumber();
public List<SysNoticeGroup> validData(SysNoticeGroup sysNoticeGroup);
public int deleteByNotice(SysNoticeGroup sysNoticeGroup);
} }

@ -17,7 +17,7 @@ public interface ISysNoticeGroupService {
* @param id - * @param id -
* @return - * @return -
*/ */
public SysNoticeGroup selectSysNoticeGroupById(Long id); public List<SysNoticeGroup> selectByNoticeId(String id);
/** /**
* - * -
@ -59,4 +59,7 @@ public interface ISysNoticeGroupService {
*/ */
public int deleteSysNoticeGroupById(Long id); public int deleteSysNoticeGroupById(Long id);
public List<SysNoticeGroup> validData(SysNoticeGroup sysNoticeGroup);
public int deleteByNoticeId(SysNoticeGroup sysNoticeGroup);
} }

@ -4,7 +4,6 @@ import java.util.List;
import com.baomidou.dynamic.datasource.annotation.DS; import com.baomidou.dynamic.datasource.annotation.DS;
import com.op.common.core.utils.DateUtils; import com.op.common.core.utils.DateUtils;
import com.op.common.core.utils.uuid.IdUtils;
import com.op.common.security.utils.SecurityUtils; import com.op.common.security.utils.SecurityUtils;
import com.op.system.api.domain.SysNoticeGroup; import com.op.system.api.domain.SysNoticeGroup;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -32,8 +31,9 @@ public class SysNoticeGroupServiceImpl implements ISysNoticeGroupService {
* @return - * @return -
*/ */
@Override @Override
public SysNoticeGroup selectSysNoticeGroupById(Long id) { @DS("#header.poolName")
return sysNoticeGroupMapper.selectSysNoticeGroupById(id); public List<SysNoticeGroup> selectByNoticeId(String id) {
return sysNoticeGroupMapper.selectByNoticeId(id);
} }
/** /**
@ -57,17 +57,19 @@ public class SysNoticeGroupServiceImpl implements ISysNoticeGroupService {
@DS("#header.poolName") @DS("#header.poolName")
public int insertSysNoticeGroup(SysNoticeGroup sysNoticeGroup) { public int insertSysNoticeGroup(SysNoticeGroup sysNoticeGroup) {
String[] groupCodes = sysNoticeGroup.getGroupCodes(); String[] groupCodes = sysNoticeGroup.getGroupCodes();
if (groupCodes == null){ if (groupCodes == null) {
return 0; return 0;
} }
String[] groupNames = sysNoticeGroup.getGroupNames(); String[] groupNames = sysNoticeGroup.getGroupNames();
Long noticeId = sysNoticeGroup.getNoticeId(); Long noticeId = sysNoticeGroup.getNoticeId();
String username = SecurityUtils.getUsername(); String username = SecurityUtils.getUsername();
// 绑定前先清空旧数据
sysNoticeGroupMapper.deleteByNotice(sysNoticeGroup);
Long serialId = getSerialId(); Long serialId = getSerialId();
int count = 0; int count = 0;
for (int i = 0; i < groupCodes.length; i++) { for (int i = 0; i < groupCodes.length; i++) {
sysNoticeGroup.setId(serialId++); sysNoticeGroup.setId(String.valueOf(serialId++));
sysNoticeGroup.setNoticeId(noticeId); sysNoticeGroup.setNoticeId(noticeId);
sysNoticeGroup.setGroupCode(groupCodes[i]); sysNoticeGroup.setGroupCode(groupCodes[i]);
sysNoticeGroup.setGroupName(groupNames[i]); sysNoticeGroup.setGroupName(groupNames[i]);
@ -112,6 +114,17 @@ public class SysNoticeGroupServiceImpl implements ISysNoticeGroupService {
return sysNoticeGroupMapper.deleteSysNoticeGroupById(id); return sysNoticeGroupMapper.deleteSysNoticeGroupById(id);
} }
@Override
public List<SysNoticeGroup> validData(SysNoticeGroup sysNoticeGroup) {
return sysNoticeGroupMapper.validData(sysNoticeGroup);
}
@Override
@DS("#header.poolName")
public int deleteByNoticeId(SysNoticeGroup sysNoticeGroup) {
return sysNoticeGroupMapper.deleteByNotice(sysNoticeGroup);
}
@DS("#header.poolName") @DS("#header.poolName")
private Long getSerialId() { private Long getSerialId() {
String dateToStr = DateUtils.parseDateToStr(DateUtils.YYYYMMDD, DateUtils.getNowDate()); String dateToStr = DateUtils.parseDateToStr(DateUtils.YYYYMMDD, DateUtils.getNowDate());

@ -36,10 +36,10 @@
</where> </where>
</select> </select>
<select id="selectSysNoticeGroupById" parameterType="Long" <select id="selectByNoticeId" parameterType="String"
resultMap="SysNoticeGroupResult"> resultMap="SysNoticeGroupResult">
<include refid="selectSysNoticeGroupVo"/> <include refid="selectSysNoticeGroupVo"/>
where id = #{id} where del_flag = '0' and notice_id = #{id}
</select> </select>
<insert id="insertSysNoticeGroup" parameterType="SysNoticeGroup"> <insert id="insertSysNoticeGroup" parameterType="SysNoticeGroup">
@ -125,19 +125,31 @@
</update> </update>
<delete id="deleteSysNoticeGroupById" parameterType="Long"> <delete id="deleteSysNoticeGroupById" parameterType="Long">
delete from sys_notice_group where id = #{id} update sys_notice_group set del_flag = '1' where id = #{id}
</delete> </delete>
<delete id="deleteSysNoticeGroupByIds" parameterType="String"> <delete id="deleteSysNoticeGroupByIds" parameterType="String">
delete from sys_notice_group where id in update sys_notice_group set del_flag = "1" where id in
<foreach item="id" collection="array" open="(" separator="," close=")"> <foreach item="id" collection="array" open="(" separator="," close=")">
#{id} #{id}
</foreach> </foreach>
</delete> </delete>
<select id="validData" parameterType="SysNoticeGroup" resultMap="SysNoticeGroupResult">
<include refid="selectSysNoticeGroupVo"/>
WHERE del_flag = 0 and notice_id = #{noticeId} and group_code = #{groupCode}
</select>
<select id="getSerialNumber" resultType="java.lang.Integer"> <select id="getSerialNumber" resultType="java.lang.Integer">
select count(0)+1 select count(0)+1
from sys_notice_group from sys_notice_group
where where
CONVERT(varchar(10),create_time, 120) = CONVERT(varchar(10),GETDATE(), 120) CONVERT(varchar(10),create_time, 120) = CONVERT(varchar(10),GETDATE(), 120)
</select> </select>
<delete id="deleteByNotice" parameterType="String">
update sys_notice_group set del_flag = '1' where notice_id = #{noticeId} and group_code in
<foreach item="groupCode" collection="groupCodes" open="(" separator="," close=")">
#{groupCode}
</foreach>
</delete>
</mapper> </mapper>

@ -56,12 +56,16 @@ public class BaseTeamUser extends BaseEntity {
private String teamUserName; private String teamUserName;
//电话 //电话
@Excel(name = "电话")
private String phonenumber; private String phonenumber;
//微信
@Excel(name = "微信")
private String wxId;
public void setId(String id) { public void setId(String id) {
this.id = id; this.id = id;
} }
public String getId() { public String getId() {
return id; return id;
} }
@ -69,7 +73,6 @@ public class BaseTeamUser extends BaseEntity {
public void setTeamId(String teamId) { public void setTeamId(String teamId) {
this.teamId = teamId; this.teamId = teamId;
} }
public String getTeamId() { public String getTeamId() {
return teamId; return teamId;
} }
@ -77,7 +80,6 @@ public class BaseTeamUser extends BaseEntity {
public void setTeamCode(String teamCode) { public void setTeamCode(String teamCode) {
this.teamCode = teamCode; this.teamCode = teamCode;
} }
public String getTeamCode() { public String getTeamCode() {
return teamCode; return teamCode;
} }
@ -85,7 +87,6 @@ public class BaseTeamUser extends BaseEntity {
public void setUserId(String userId) { public void setUserId(String userId) {
this.userId = userId; this.userId = userId;
} }
public String getUserId() { public String getUserId() {
return userId; return userId;
} }
@ -93,7 +94,6 @@ public class BaseTeamUser extends BaseEntity {
public void setUserName(String userName) { public void setUserName(String userName) {
this.userName = userName; this.userName = userName;
} }
public String getUserName() { public String getUserName() {
return userName; return userName;
} }
@ -101,7 +101,6 @@ public class BaseTeamUser extends BaseEntity {
public String getNickName() { public String getNickName() {
return nickName; return nickName;
} }
public void setNickName(String nickName) { public void setNickName(String nickName) {
this.nickName = nickName; this.nickName = nickName;
} }
@ -109,7 +108,6 @@ public class BaseTeamUser extends BaseEntity {
public String getTeamUserName() { public String getTeamUserName() {
return teamUserName; return teamUserName;
} }
public void setTeamUserName(String teamUserName) { public void setTeamUserName(String teamUserName) {
this.teamUserName = teamUserName; this.teamUserName = teamUserName;
} }
@ -117,11 +115,17 @@ public class BaseTeamUser extends BaseEntity {
public void setPhonenumber(String phonenumber) { public void setPhonenumber(String phonenumber) {
this.phonenumber = phonenumber; this.phonenumber = phonenumber;
} }
public String getPhonenumber() { public String getPhonenumber() {
return phonenumber; return phonenumber;
} }
public void setWxId(String wxId) {
this.wxId = wxId;
}
public String getWxId() {
return wxId;
}
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)

@ -4,6 +4,7 @@ import java.util.List;
import com.baomidou.dynamic.datasource.annotation.DS; import com.baomidou.dynamic.datasource.annotation.DS;
import com.op.wms.domain.BaseTeamUser; import com.op.wms.domain.BaseTeamUser;
import org.apache.ibatis.annotations.Param;
/** /**
* Mapper * Mapper
@ -69,8 +70,8 @@ public interface BaseTeamUserMapper {
//查询人员ID //查询人员ID
public String selectId(BaseTeamUser baseTeamUser); public String selectId(BaseTeamUser baseTeamUser);
@DS("master") @DS("#master")
public String selectUserName(BaseTeamUser baseTeamUser); public BaseTeamUser selectUserDetail(@Param("userId") String userId);
//批量删除 //批量删除
public void deleteBaseTeamUserByTeamId(String teamId); public void deleteBaseTeamUserByTeamId(String teamId);

@ -82,9 +82,11 @@ public class BaseTeamTServiceImpl implements IBaseTeamTService {
list = baseTeamT.getRightData(); list = baseTeamT.getRightData();
String userId = list.get(i); String userId = list.get(i);
baseTeamUser.setUserId(userId); baseTeamUser.setUserId(userId);
String userName = baseTeamUserMapper.selectUserName(baseTeamUser); BaseTeamUser user = baseTeamUserMapper.selectUserDetail(baseTeamUser.getUserId());
//判断班组人员有没有变动 挨个遍历 if(user != null){
baseTeamUser.setUserName(userName); baseTeamUser.setUserName(user.getUserName());
baseTeamUser.setWxId(user.getWxId());
}
baseTeamUserMapper.insertBaseTeamUser(baseTeamUser); baseTeamUserMapper.insertBaseTeamUser(baseTeamUser);
} }
return 1; return 1;
@ -114,19 +116,12 @@ public class BaseTeamTServiceImpl implements IBaseTeamTService {
list = baseTeamT.getRightData(); list = baseTeamT.getRightData();
String userId = list.get(i); String userId = list.get(i);
baseTeamUser.setUserId(userId); baseTeamUser.setUserId(userId);
String userName = baseTeamUserMapper.selectUserName(baseTeamUser); BaseTeamUser user = baseTeamUserMapper.selectUserDetail(userId);
//判断班组人员有没有变动 挨个遍历 if(user != null){
baseTeamUser.setUserName(userName); baseTeamUser.setUserName(user.getUserName());
baseTeamUser.setWxId(user.getWxId());
}
baseTeamUserMapper.insertBaseTeamUser(baseTeamUser); baseTeamUserMapper.insertBaseTeamUser(baseTeamUser);
// BaseTeamUser baseTeamUser1 = new BaseTeamUser();
// List<String> members = baseTeamUserMapper.selectTeamMembersIds(baseTeamUser1);
// boolean bool = members.contains(userId);
//倒查id
// String id = baseTeamUserMapper.selectId(baseTeamUser);
// baseTeamUser.setUpdateTime(DateUtils.getNowDate());
// baseTeamUser.setUpdateBy(SecurityUtils.getUsername());
// baseTeamUserMapper.updateBaseTeamUser(baseTeamUser);
//如果过来的班组成员ID不存在于表中直接新增
} }
return baseTeamTMapper.updateBaseTeamT(baseTeamT); return baseTeamTMapper.updateBaseTeamT(baseTeamT);
} }
@ -158,7 +153,7 @@ public class BaseTeamTServiceImpl implements IBaseTeamTService {
} }
/** /**
* * Code
* *
* @return * @return
*/ */
@ -174,7 +169,7 @@ public class BaseTeamTServiceImpl implements IBaseTeamTService {
} }
/** /**
* *
* *
* @return * @return
*/ */

@ -14,10 +14,11 @@
<result property="createTime" column="create_time"/> <result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by"/> <result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/> <result property="updateTime" column="update_time"/>
<result property="wxId" column="wx_id"/>
</resultMap> </resultMap>
<sql id="selectBaseTeamUserVo"> <sql id="selectBaseTeamUserVo">
select id, team_id, team_code, user_id, user_name, create_by, create_time, update_by, update_time from base_team_user select id, team_id, team_code, user_id, user_name, create_by, create_time, update_by, update_time, wx_id from base_team_user
</sql> </sql>
<select id="selectBaseTeamUserList" parameterType="BaseTeamUser" resultMap="BaseTeamUserResult"> <select id="selectBaseTeamUserList" parameterType="BaseTeamUser" resultMap="BaseTeamUserResult">
@ -47,6 +48,7 @@
<if test="createTime != null">create_time,</if> <if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if> <if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if> <if test="updateTime != null">update_time,</if>
<if test="wxId != null">wx_id,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if> <if test="id != null">#{id},</if>
@ -58,6 +60,7 @@
<if test="createTime != null">#{createTime},</if> <if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if> <if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if> <if test="updateTime != null">#{updateTime},</if>
<if test="wxId != null">#{wxId},</if>
</trim> </trim>
</insert> </insert>
@ -72,6 +75,7 @@
<if test="createTime != null">create_time = #{createTime},</if> <if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if> <if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if> <if test="updateTime != null">update_time = #{updateTime},</if>
<if test="wxId != null">wx_id = #{wxId},</if>
</trim> </trim>
where id = #{id} where id = #{id}
</update> </update>
@ -93,10 +97,11 @@
<select id="selectTeamMembers" parameterType="BaseTeamUser" resultMap="BaseTeamUserResult"> <select id="selectTeamMembers" parameterType="BaseTeamUser" resultMap="BaseTeamUserResult">
select select
user_id, user_id,
user_name, user_name,
nick_name, nick_name,
CONCAT(nick_name,user_name) AS teamUserName CONCAT(nick_name,user_name) AS teamUserName,
wx_id
from sys_user from sys_user
</select> </select>
@ -118,8 +123,11 @@
and team_id = #{teamId} and team_id = #{teamId}
</select> </select>
<select id="selectUserName" parameterType="BaseTeamUser" resultType="java.lang.String"> <select id="selectUserDetail" parameterType="String" resultType="com.op.wms.domain.BaseTeamUser">
select user_name select
user_id AS userId ,
user_name AS userName,
wx_id AS wxId
from sys_user from sys_user
where user_id = #{userId} where user_id = #{userId}
</select> </select>

Loading…
Cancel
Save