Commit 7a66f1b0 by mobh

Merge branch 'dev-mobh' into develop

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