Commit f4a77c42 by mobh

消息模板修改

parent c43f4ff5
......@@ -5,7 +5,9 @@ import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model;
......@@ -58,7 +60,11 @@ public class AdminMsgTemplate extends Model<AdminMsgTemplate> {
@ApiModelProperty(value="生产时间 生产时间",example="101")
private Long addtime;
@ApiModelProperty(value="0 系统默认(公共模板), 1 企业定制",example="0")
private Integer sysDefault;
@TableField(updateStrategy= FieldStrategy.IGNORED)
@ApiModelProperty(value="企业ID 企业ID",example="101")
private Integer orgCode;
......
......@@ -37,7 +37,6 @@ public class AdminAssoTxjlbcontroller {
@PostMapping("/noreading")
@ApiOperation(value = "未读数量", httpMethod = "POST", notes = "接口发布说明")
public Result<Object> noreading(@CurrentUser UserBean userBean, @RequestBody QueryNoReadingDto ws) {
ws.setOrgCode(userBean.getOrgCode());
Integer wds = AdminAssoTxjlb.builder().build()
.selectCount(new QueryWrapper<AdminAssoTxjlb>().lambda().eq(AdminAssoTxjlb::getEmpNum, ws.getEmpNum())
.eq(AdminAssoTxjlb::getOrgCode, ws.getOrgCode()).eq(AdminAssoTxjlb::getTxstate, 0));
......@@ -48,7 +47,6 @@ public class AdminAssoTxjlbcontroller {
@PostMapping("/datanotread")
@ApiOperation(value = "未读数据", httpMethod = "POST", notes = "接口发布说明")
public Result<Object> datanotread(@CurrentUser UserBean userBean, @RequestBody QueryNoReadingDto ws) {
ws.setOrgCode(userBean.getOrgCode());
List<AdminAssoTxjlb> wds = AdminAssoTxjlb.builder().build()
.selectList(new QueryWrapper<AdminAssoTxjlb>().lambda().eq(AdminAssoTxjlb::getEmpNum, ws.getEmpNum())
.eq(AdminAssoTxjlb::getOrgCode, ws.getOrgCode()).eq(AdminAssoTxjlb::getTxstate, 0));
......@@ -77,7 +75,6 @@ public class AdminAssoTxjlbcontroller {
@PostMapping("/pageTxjlb")
@ApiOperation(value = "分页查询消息记录", httpMethod = "POST", notes = "接口发布说明")
public Result<Object> pageTxjlb(@CurrentUser UserBean userBean, @RequestBody QueryNoReadingDto search) {
search.setOrgCode(userBean.getOrgCode());
Page<AdminAssoTxjlb> page = new Page<>(
search.getCurrentPage() == null ? 1 : search.getCurrentPage(),
search.getTotalPage() == null ? 10 : search.getTotalPage());
......
......@@ -30,7 +30,7 @@ public class AdminMsgTemplateController {
private AdminMsgTemplateMapper msgTemplateMapper;
@PostMapping("/listMsgTemplate")
@ApiOperation(value = "列出消息模板", httpMethod = "POST", notes = "接口发布说明")
@ApiOperation(value = "列出企业可选择的消息模板", httpMethod = "POST", notes = "接口发布说明")
public Result<Object> listMsgTemplate(@CurrentUser UserBean userBean, @RequestBody AdminMsgTemplateDto search) {
search.setOrgCode(userBean.getOrgCode());
List<AdminMsgTemplate> list = msgTemplateMapper.listMsgTemplate(search);
......@@ -40,7 +40,6 @@ public class AdminMsgTemplateController {
@PostMapping("/pageMsgTemplate")
@ApiOperation(value = "消息模板分页查询", httpMethod = "POST", notes = "接口发布说明")
public Result<Object> pageMsgTemplate(@CurrentUser UserBean userBean, @RequestBody AdminMsgTemplateDto search) {
search.setOrgCode(userBean.getOrgCode());
Page<FixedSalaryStaffDto> page = new Page<FixedSalaryStaffDto>(
search.getCurrentPage() == null ? 1 : search.getCurrentPage(),
search.getTotalPage() == null ? 10 : search.getTotalPage());
......@@ -67,20 +66,17 @@ public class AdminMsgTemplateController {
@PostMapping("/editMsgTemplate")
@ApiOperation(value = "新增/编辑消息模板", httpMethod = "POST", notes = "接口发布说明")
public Result<Object> editMsgTemplate(@CurrentUser UserBean userBean, @RequestBody AdminMsgTemplate temp) {
AdminMsgTemplate exits = AdminMsgTemplate.builder().build().selectOne(
new LambdaQueryWrapper<AdminMsgTemplate>().eq(AdminMsgTemplate::getOrgCode, userBean.getOrgCode())
.eq(AdminMsgTemplate::getPlatformNum, temp.getPlatformNum())
.eq(AdminMsgTemplate::getPlatformType, temp.getPlatformType())
.eq(AdminMsgTemplate::getState, 0)
);
AdminMsgTemplateDto search = new AdminMsgTemplateDto();
search.setPlatformNum(temp.getPlatformNum());
search.setPlatformType(temp.getPlatformType());
search.setState(0);
AdminMsgTemplate exits = msgTemplateMapper.getByParams(search);
if (Objects.nonNull(exits)) {
if (Objects.isNull(temp.getId()) ||
(Objects.nonNull(temp.getId()) && !temp.getId().equals(exits.getId()))) {
return ResultUtil.error("对应平台编号已经存在!");
}
}
temp.setOrgCode(userBean.getOrgCode());
temp.setAddtime(new Date().getTime());
if (Objects.isNull(temp.getId())) {
msgTemplateMapper.insert(temp);
......
......@@ -246,13 +246,13 @@ public class QyzxController {
*/
/**
* 企业列表
* 当前用户企业列表
*
* @param
* @return
*/
@GetMapping(value = "/entlist")
@ApiOperation(value = "企业列表", httpMethod = "GET", notes = "接口发布说明")
@ApiOperation(value = "当前用户企业列表", httpMethod = "GET", notes = "接口发布说明")
public Result<List<QyzxEntInfoM>> entlist1(@CurrentUser UserBean userBean) {
List<Object> orgCodes = qyzxEmpEntAssoMapper.selectObjs(new QueryWrapper<QyzxEmpEntAsso>().lambda()
......@@ -263,6 +263,20 @@ public class QyzxController {
}
/**
* 所有企业列表
*
* @param
* @return
*/
@GetMapping(value = "/entlistAll")
@ApiOperation(value = "所有企业列表", httpMethod = "GET", notes = "接口发布说明")
public Result<List<QyzxEntInfoM>> entlistAll(@CurrentUser UserBean userBean) {
List<QyzxEntInfoM> qyzxEntInfoMs = new LambdaQueryChainWrapper<QyzxEntInfoM>(qyzxEntInfoMMapper)
.list();
return ResultUtil.data(qyzxEntInfoMs, "获取企业信息成功");
}
/**
* 切换企业
*
* @param org_num
......
......@@ -18,7 +18,13 @@ import java.util.List;
@Repository
public interface AdminMsgTemplateMapper extends BaseMapper<AdminMsgTemplate> {
/**
* 查询模板
* 根据参数获取模板
* @param param
* @return
*/
AdminMsgTemplate getByParams(@Param("param") AdminMsgTemplateDto param);
/**
* 列出企业可选择的消息模板
* @param param
* @return
*/
......
......@@ -28,6 +28,9 @@ public class AdminMsgTemplateDto extends Page implements Serializable {
@ApiModelProperty(value="状态 0 启用 1 停用",example="101")
private Integer state;
@ApiModelProperty(value="0 系统默认(公共模板), 1 企业定制",example="0")
private Integer sysDefault;
@ApiModelProperty(value="企业ID 企业ID",example="101")
private Integer orgCode;
}
......@@ -12,6 +12,7 @@
<result column="msg_type" property="msgType" />
<result column="state" property="state" />
<result column="addtime" property="addtime" />
<result column="sys_default" property="sysDefault" />
<result column="org_code" property="orgCode" />
</resultMap>
......@@ -24,10 +25,11 @@
msg_type,
state,
addtime,
sys_default,
org_code
</sql>
<select id="listMsgTemplate" resultMap="BaseResultMap">
<select id="getByParams" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List" />
FROM admin_msg_template temp
<where>
......@@ -35,7 +37,7 @@
and temp.template_name like CONCAT('%',#{param.templateName},'%')
</if>
<if test="param.platformType != null">
and temp.platform_type = #{param.platformType}
and temp.platform_type = #{param.platformType}
</if>
<if test="param.msgType != null">
and temp.msg_type = #{param.msgType}
......@@ -43,12 +45,42 @@
<if test="param.state != null">
and temp.state = #{param.state}
</if>
<if test="param.sysDefault != null">
and temp.sys_default = #{param.sysDefault}
</if>
<if test="param.orgCode != null">
and temp.org_code = #{param.orgCode}
</if>
</where>
</select>
<!-- 列出企业可选择的消息模板 -->
<sql id="listMsgTemplateCondition">
<if test="param.templateName != null and param.templateName !=''">
and temp.template_name like CONCAT('%',#{param.templateName},'%')
</if>
<if test="param.platformType != null">
and temp.platform_type = #{param.platformType}
</if>
<if test="param.msgType != null">
and temp.msg_type = #{param.msgType}
</if>
<if test="param.state != null">
and temp.state = #{param.state}
</if>
</sql>
<select id="listMsgTemplate" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List" />
FROM admin_msg_template temp
WHERE temp.sys_default = 0
<include refid="listMsgTemplateCondition" />
UNION ALL
SELECT <include refid="Base_Column_List" />
FROM admin_msg_template temp
WHERE temp.sys_default = 1 AND temp.org_code = #{param.orgCode}
<include refid="listMsgTemplateCondition" />
</select>
<!-- 分页查询 -->
<sql id="pageMsgTemplateCondition">
<where>
......@@ -64,6 +96,9 @@
<if test="param.state != null">
and temp.state = #{param.state}
</if>
<if test="param.sysDefault != null">
and temp.sys_default = #{param.sysDefault}
</if>
<if test="param.orgCode != null">
and temp.org_code = #{param.orgCode}
</if>
......
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