Commit 906784c3 by mobh

合同证件管理功能

parent 9267dab9
......@@ -96,10 +96,6 @@ public class HtzzAdminZzda extends Model<HtzzAdminZzda> {
@TableField(exist = false)
private List<NotifyPersonDto> ids;
// @Transient
// @TableField(exist = false)
// private List<HtzzAssoZztx> Zztx;
@Transient
@TableField(exist = false)
private HtzzAssoZztx zztx;
......
package cn.timer.api.controller.admin;
import cn.timer.api.bean.admin.AdminMsgTemplate;
import cn.timer.api.bean.yggl.YgglMainEmp;
import cn.timer.api.config.annotation.CurrentUser;
import cn.timer.api.config.annotation.UserBean;
import cn.timer.api.dao.admin.AdminMsgTemplateMapper;
import cn.timer.api.dto.admin.AdminMsgTemplateDto;
import cn.timer.api.utils.Result;
import cn.timer.api.utils.ResultUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import javax.transaction.Transactional;
import java.util.List;
@Api(tags = "消息模板管理")
@RestController
@Transactional
@RequestMapping(value = "/msg")
public class AdminMsgTemplateController {
@Resource
private AdminMsgTemplateMapper msgTemplateMapper;
@PostMapping("/listMsgTemplate")
@ApiOperation(value = "列出消息模板", httpMethod = "POST", notes = "接口发布说明")
public Result<Object> listMsgTemplate(@CurrentUser UserBean userBean, @RequestBody AdminMsgTemplateDto dto) {
dto.setOrgCode(userBean.getOrgCode());
List<AdminMsgTemplate> list = msgTemplateMapper.listMsgTemplate(dto);
return ResultUtil.data(list);
}
}
......@@ -4,6 +4,7 @@ import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import com.google.common.collect.Lists;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.transaction.annotation.Transactional;
......@@ -81,8 +82,9 @@ public class HtzzController {
Logoutput("企业 " + orgCode + " :短信套餐已过期");
return ResultUtil.error("短信套餐已到期!");
}
zzda.setTxkgType(1);//
if (zzda.getId() == null) {
zzda.setTxkgType(1);//默认开启提醒
}
zzda.setLrrid(userBean.getEmpNum());
zzda.setLrsjTime(new Date());
zzda.setOrgCode(orgCode);
......@@ -95,17 +97,11 @@ public class HtzzController {
/**
* 新增通知关系表,每人一个
*/
// YgglMainEmp emp = null;
List<NotifyPersonDto> ids = zzda.getIds();//通知人 用户id+手机号码
List<HtzzAssoHtgx> htgxs = new ArrayList<HtzzAssoHtgx>(ids.size());
List<HtzzAssoHtgx> htgxs = Lists.newArrayList();
for (NotifyPersonDto pre : ids) {
HtzzAssoHtgx.builder().build().delete(new QueryWrapper<HtzzAssoHtgx>().lambda().eq(HtzzAssoHtgx::getOrgCode, orgCode).eq(HtzzAssoHtgx::getTzrid, pre.getEmpNum())
.eq(HtzzAssoHtgx::getPhone, pre.getPhone()));
// QueryWrapper<YgglMainEmp> queryWrapper = new QueryWrapper<>();
// queryWrapper.select("name", "phone", "emp_num").eq("emp_num", pre.getUserids()).eq("org_code", orgCode);
// emp = YgglMainEmp.builder().build().selectOne(queryWrapper);
HtzzAssoHtgx htgx = HtzzAssoHtgx.builder().build();
htgx.setHtid(zzda.getId());
......@@ -116,22 +112,28 @@ public class HtzzController {
htgx.insert();
htgxs.add(htgx);
}
HtzzAssoZztx zztx = zzda.getZztx();
zztx.setZzdaId(zzda.getId());
zztx.setOrgCode(orgCode);
zztx.setLrrid(userBean.getEmpNum());
zztx.setLrsjTime(new Date());
zztx.insertOrUpdate();
return ResultUtil.datas(zzda, htgxs, "新增证件成功!");
}
@GetMapping("/modifytx/id")
@GetMapping("/modifytx/{id}")
@ApiOperation(value = "修改提醒数据", httpMethod = "GET", notes = "接口发布说明")
public Result<Object> modifytx(@CurrentUser UserBean userBean, @PathVariable Integer id) {
List<NotifyPersonDto> tzids = new ArrayList<NotifyPersonDto>();
List<HtzzAssoHtgx> httxs = HtzzAssoHtgx.builder().build().selectList(new QueryWrapper<HtzzAssoHtgx>().lambda().eq(HtzzAssoHtgx::getHtid, id));
List<HtzzAssoHtgx> httxs = HtzzAssoHtgx.builder().build().selectList(new QueryWrapper<HtzzAssoHtgx>().lambda().eq(HtzzAssoHtgx::getHtid, id));
for(HtzzAssoHtgx gx : httxs) {
NotifyPersonDto predto = NotifyPersonDto.builder().build();
BeanUtil.copyProperties(gx, predto);
predto.setEmpName(gx.getName());
predto.setEmpNum(gx.getTzrid());
predto.setPhone(gx.getPhone());
tzids.add(predto);
}
......
package cn.timer.api.dao.admin;
import cn.timer.api.dto.admin.AdminMsgTemplateDto;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import cn.timer.api.bean.admin.AdminMsgTemplate;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;
/**
* 消息模板
......@@ -13,5 +18,10 @@ import cn.timer.api.bean.admin.AdminMsgTemplate;
*/
@Repository
public interface AdminMsgTemplateMapper extends BaseMapper<AdminMsgTemplate> {
/**
* 查询模板
* @param params
* @return
*/
List<AdminMsgTemplate> listMsgTemplate(@Param("params") AdminMsgTemplateDto params);
}
package cn.timer.api.dto.admin;
import cn.timer.api.utils.Page;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
@Data
@AllArgsConstructor
@NoArgsConstructor
public class AdminMsgTemplateDto extends Page implements Serializable {
@ApiModelProperty(value="模板编号 ",example="模板ID")
private String templateNum;
@ApiModelProperty(value="模板名称 ",example="模板名称")
private String templateName;
@ApiModelProperty(value="对应平台模板编号 ",example="对应平台模板编号")
private String platformNum;
@ApiModelProperty(value="平台类型 1 阿里云",example="101")
private Integer platformType;
@ApiModelProperty(value="类型 1 证照到期提醒",example="101")
private Integer msgType;
@ApiModelProperty(value="状态 0 启用 1 停用",example="101")
private Integer state;
@ApiModelProperty(value="企业ID 企业ID",example="101")
private Integer orgCode;
}
......@@ -28,4 +28,26 @@
addtime,
org_code
</sql>
<select id="listMsgTemplate" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List" />
FROM admin_msg_template temp
<where>
<if test="params.templateName != null and params.templateName !=''">
and temp.template_name like CONCAT('%',#{params.templateName},'%')
</if>
<if test="params.platformType != null">
and temp.platform_type = #{params.platformType}
</if>
<if test="params.msgType != null">
and temp.msg_type = #{params.msgType}
</if>
<if test="params.state != null">
and temp.state = #{params.state}
</if>
<if test="params.orgCode != null">
and temp.org_code = #{params.orgCode}
</if>
</where>
</select>
</mapper>
\ No newline at end of file
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