diff --git a/src/main/java/com/lz/common/emun/WorkMsgTypeEnum.java b/src/main/java/com/lz/common/emun/WorkMsgTypeEnum.java new file mode 100644 index 00000000..bee48831 --- /dev/null +++ b/src/main/java/com/lz/common/emun/WorkMsgTypeEnum.java @@ -0,0 +1,52 @@ +package com.lz.common.emun; + +import javax.security.auth.message.AuthStatus; + +/** + * 业绩通知相关type + */ +public enum WorkMsgTypeEnum { + //业绩提交审核的通知(自己提交给领导,自己提交给人事,人事提交给老板) + SUBMIT(0, "业绩提交", "去审核", "# 业绩提交\n ## @的业绩已经提交"), + //业绩打回审核的通知 + REJECT(1, "业绩驳回", "去修改", "# 业绩驳回\n ## 你的业绩已经驳回"), + //业绩通过领导审核的通知,这一步提交到HR,提交的type + LEADER_PASS(2, "业绩已打分", "去提交给人事", "# 业绩已打分\n ## 你的业绩已经打分"), + //业绩通过人事,老板审核的最终审核通知 + PASS(3, "业绩通过", "去查看", "# 业绩通过\n ## 你的业绩已经通过"),; + int type; + String title; + String btnText; + String content; + WorkMsgTypeEnum(int type, String title, String btnText, String content){ + this.type = type; + this.title = title; + this.btnText = btnText; + this.content = content; + } + + public static WorkMsgTypeEnum findRoleTypeByCode(int code) { + for (WorkMsgTypeEnum workMsgTypeEnum : WorkMsgTypeEnum.values()) { + if (workMsgTypeEnum.getType() == code) { + return workMsgTypeEnum; + } + } + return null; + } + + public int getType() { + return type; + } + + public String getTitle() { + return title; + } + + public String getBtnText() { + return btnText; + } + + public String getContent() { + return content; + } +} diff --git a/src/main/java/com/lz/common/utils/DingTalkUtil.java b/src/main/java/com/lz/common/utils/DingTalkUtil.java index 75a2c6f9..2825d0ae 100644 --- a/src/main/java/com/lz/common/utils/DingTalkUtil.java +++ b/src/main/java/com/lz/common/utils/DingTalkUtil.java @@ -7,10 +7,13 @@ import com.dingtalk.api.DefaultDingTalkClient; import com.dingtalk.api.DingTalkClient; import com.dingtalk.api.request.*; import com.dingtalk.api.response.*; +import com.lz.modules.app.entity.StaffEntity; import com.lz.modules.job.model.responseBo.DepartmentInfosBo; import com.lz.modules.job.model.responseBo.DepartmentStaffBo; import com.lz.modules.third.entity.ThirdAppConfig; +import com.lz.modules.third.entity.ThirdMsgSendRecord; import com.lz.modules.third.service.ThirdAppConfigService; +import com.lz.modules.third.service.ThirdMsgSendRecordService; import com.lz.modules.third.service.impl.ThirdAppConfigServiceImpl; import com.taobao.api.ApiException; import org.apache.http.HttpEntity; @@ -56,6 +59,9 @@ public class DingTalkUtil { @Autowired ThirdAppConfigService thirdAppConfigService; + @Autowired + ThirdMsgSendRecordService thirdMsgSendRecordService; + CloseableHttpClient getHttpClient(){ @@ -179,13 +185,14 @@ public class DingTalkUtil { departmentStaffBo.setEmail(json.getString("email"));//邮箱,钉钉的企业邮箱才可以,需要单独授权手机权限 departmentStaffBo.setAvatar(json.getString("avatar"));//头像 departmentStaffBo.setPosition(json.getString("position")); - if(json.getBoolean("active")){ + departmentStaffBo.setStatus(0); + /*if(json.getBoolean("active")){ //在职已激活 departmentStaffBo.setStatus(0); }else{ //在职未激活 departmentStaffBo.setStatus(4); - } + }*/ if(json.getBoolean("isLeader")){ departmentStaffBo.setIsLeader(1); @@ -245,5 +252,53 @@ public class DingTalkUtil { } + public String sendSingleActionCardMSG(String appid, StaffEntity staff, String title, String marDown, String singleTitle, String singleUrl, String token) { + String msg = "OK"; + ThirdMsgSendRecord thirdMsgSendRecord = new ThirdMsgSendRecord(); + thirdMsgSendRecord.setMsgType("action_card"); + thirdMsgSendRecord.setStaffId(staff.getId()); + thirdMsgSendRecord.setMsgTitle(singleTitle); + thirdMsgSendRecord.setAppId(Long.parseLong(appid)); + thirdMsgSendRecord.setHeadText(title); + thirdMsgSendRecord.setMsgContent(marDown); + thirdMsgSendRecord.setMsgUrl(singleUrl); + thirdMsgSendRecord.setStatus(0); + try{ + DingTalkClient client = new DefaultDingTalkClient("https://oapi.dingtalk.com/topapi/message/corpconversation/asyncsend_v2"); + OapiMessageCorpconversationAsyncsendV2Request req = new OapiMessageCorpconversationAsyncsendV2Request(); + req.setAgentId(thirdMsgSendRecord.getAppId()); + req.setUseridList(staff.getEmployeeId()); + OapiMessageCorpconversationAsyncsendV2Request.Msg obj1 = new OapiMessageCorpconversationAsyncsendV2Request.Msg(); + obj1.setMsgtype(thirdMsgSendRecord.getMsgType()); + OapiMessageCorpconversationAsyncsendV2Request.ActionCard obj2 = new OapiMessageCorpconversationAsyncsendV2Request.ActionCard(); + obj2.setSingleUrl(thirdMsgSendRecord.getMsgUrl()); + obj2.setSingleTitle(thirdMsgSendRecord.getMsgTitle()); + obj2.setMarkdown(thirdMsgSendRecord.getMsgContent()); + obj2.setTitle(thirdMsgSendRecord.getHeadText()); + obj1.setActionCard(obj2); + req.setMsg(obj1); + OapiMessageCorpconversationAsyncsendV2Response rsp = client.execute(req, token); + //插入数据库 + JSONObject json = JSONObject.parseObject(rsp.getBody()); + if(json.getIntValue("errcode") == 0){ + thirdMsgSendRecord.setTaskId(json.getLong("task_id")); + thirdMsgSendRecord.setStatus(1); + }else{ + thirdMsgSendRecord.setTaskId(0L); + thirdMsgSendRecord.setStatus(6); + thirdMsgSendRecord.setRemark(json.getString("errmsg")); + msg = thirdMsgSendRecord.getRemark(); + } + + }catch (ApiException e) { + e.printStackTrace(); + thirdMsgSendRecord.setStatus(6); + thirdMsgSendRecord.setRemark(e.getErrMsg()); + msg = thirdMsgSendRecord.getRemark(); + + } + thirdMsgSendRecordService.insert(thirdMsgSendRecord); + return msg; + } } diff --git a/src/main/java/com/lz/modules/app/entity/StaffEntity.java b/src/main/java/com/lz/modules/app/entity/StaffEntity.java index c04b2820..9146c6a3 100644 --- a/src/main/java/com/lz/modules/app/entity/StaffEntity.java +++ b/src/main/java/com/lz/modules/app/entity/StaffEntity.java @@ -109,6 +109,10 @@ public class StaffEntity implements Serializable { * 工号 */ private String jobNumber; + /** + * 是否为领导 不存入staff表中 + * */ + private Integer isLeader; //密码 diff --git a/src/main/java/com/lz/modules/app/service/impl/DepartmentsStaffRelateServiceImpl.java b/src/main/java/com/lz/modules/app/service/impl/DepartmentsStaffRelateServiceImpl.java index e726ea4e..14e78b22 100644 --- a/src/main/java/com/lz/modules/app/service/impl/DepartmentsStaffRelateServiceImpl.java +++ b/src/main/java/com/lz/modules/app/service/impl/DepartmentsStaffRelateServiceImpl.java @@ -45,9 +45,9 @@ public class DepartmentsStaffRelateServiceImpl extends ServiceImpl impleme for (DepartmentStaffBo staffBo : staffs) { StaffEntity staffEntity = staffDao.getStaffInfoByOpenId(staffBo.getOpenId()); StaffEntity staff = convertStaffEntity(staffBo); + if (staffEntity != null) { staff.setId(staffEntity.getId()); + staffDao.updateStaff(staff); } else { staffDao.addStaff(staff); @@ -342,6 +344,7 @@ public class StaffServiceImpl extends ServiceImpl impleme staffEntity.setUnionId(staffBo.getUnionId()); staffEntity.setAvatar(staffBo.getAvatar()); staffEntity.setJobNumber(staffBo.getEmployeeNo()); + staffEntity.setIsLeader(staffBo.getIsLeader()); return staffEntity; } diff --git a/src/main/java/com/lz/modules/job/business/DingtalkBusiness.java b/src/main/java/com/lz/modules/job/business/DingtalkBusiness.java index 303d0d14..25c23dfe 100644 --- a/src/main/java/com/lz/modules/job/business/DingtalkBusiness.java +++ b/src/main/java/com/lz/modules/job/business/DingtalkBusiness.java @@ -3,11 +3,15 @@ package com.lz.modules.job.business; import com.dingtalk.api.DefaultDingTalkClient; import com.dingtalk.api.DingTalkClient; import com.dingtalk.api.request.OapiGettokenRequest; +import com.dingtalk.api.request.OapiMessageCorpconversationAsyncsendV2Request; import com.dingtalk.api.response.OapiGettokenResponse; +import com.dingtalk.api.response.OapiMessageCorpconversationAsyncsendV2Response; import com.google.common.collect.Lists; +import com.lz.common.emun.WorkMsgTypeEnum; import com.lz.common.utils.DateUtils; import com.lz.common.utils.DingTalkUtil; import com.lz.modules.app.dao.StaffDao; +import com.lz.modules.app.dto.StaffBaseInfoDto; import com.lz.modules.app.entity.StaffEntity; import com.lz.modules.app.entity.StaffOccupationEntity; import com.lz.modules.app.service.DepartmentsService; @@ -142,6 +146,8 @@ public class DingtalkBusiness { } } + + public void enterStaffOccupationInfos(List staffs) { List StaffOccupations = Lists.newArrayList(); for (DepartmentStaffBo departmentStaffBo : staffs) { @@ -166,4 +172,25 @@ public class DingtalkBusiness { staffOccupationService.saveBatch(StaffOccupations); } } + + public String sendWorkMSG(String appid, Long fromStaffid, long toStaffid, int type) { + //获取Token + StaffEntity toStaffEntity = staffService.selectStaffById(toStaffid); + StaffEntity fromStaffEntity = staffService.selectStaffById(fromStaffid); + if(toStaffEntity != null && fromStaffEntity != null){ + + WorkMsgTypeEnum workMsgTypeEnum = WorkMsgTypeEnum.findRoleTypeByCode(type); + String token = dingTalkUtil.getAccessToken(appid); + if(token != null && token.length() > 0){ + String content = workMsgTypeEnum.getContent().replace("@", fromStaffEntity.getName()); + return dingTalkUtil.sendSingleActionCardMSG(appid, toStaffEntity, workMsgTypeEnum.getTitle(), + content, workMsgTypeEnum.getBtnText(), "https://www.baidu.com?time=" + System.currentTimeMillis(), token); + + }else{ + return "token无效"; + } + } + return "无相关人员信息"; + + } } diff --git a/src/main/java/com/lz/modules/third/controller/ThirdAppConfigController.java b/src/main/java/com/lz/modules/third/controller/ThirdAppConfigController.java index 02ee792c..0c625f88 100644 --- a/src/main/java/com/lz/modules/third/controller/ThirdAppConfigController.java +++ b/src/main/java/com/lz/modules/third/controller/ThirdAppConfigController.java @@ -42,6 +42,8 @@ public class ThirdAppConfigController { } + + @RequestMapping("/getById") public R getById(@RequestBody ThirdAppConfig thirdAppConfig) { thirdAppConfig = thirdAppConfigservice.selectThirdAppConfigById(thirdAppConfig.getId()); diff --git a/src/main/java/com/lz/modules/third/controller/ThirdMsgSendRecordController.java b/src/main/java/com/lz/modules/third/controller/ThirdMsgSendRecordController.java new file mode 100644 index 00000000..d527c7e4 --- /dev/null +++ b/src/main/java/com/lz/modules/third/controller/ThirdMsgSendRecordController.java @@ -0,0 +1,78 @@ +package com.lz.modules.third.controller; + + +import com.alibaba.fastjson.JSONObject; +import com.lz.common.utils.PageUtils; +import com.lz.common.utils.R; +import com.lz.common.utils.StringUtil; +import com.lz.modules.job.business.DingtalkBusiness; +import com.lz.modules.third.entity.ThirdMsgSendRecord; +import com.lz.modules.third.service.ThirdMsgSendRecordService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.HashMap; +import java.util.Map; + +@RestController +@RequestMapping("/thirdMsgSendRecord") +public class ThirdMsgSendRecordController { + + + @Autowired + private ThirdMsgSendRecordService thirdMsgSendRecordservice; + + @Autowired + private DingtalkBusiness dingtalkBusiness; + + static String appid = "856016278"; + + @RequestMapping("/list") + public R list(@RequestBody String body) { + Map params = new HashMap<>(); + if(StringUtil.isNotBlank(body)){ + params = JSONObject.parseObject(body,Map.class); + } + PageUtils page = thirdMsgSendRecordservice.queryPage(params); + return R.ok().put("page", page); + } + + @GetMapping("/asyn/send/work/msg") + public R asynSendWorkMsg(@RequestParam Long fromstaffid, @RequestParam Long tostaffid, @RequestParam int type) { + + String msg = dingtalkBusiness.sendWorkMSG(appid, fromstaffid, tostaffid, type); + if(msg.equals("OK")){ + return R.ok(); + }else{ + return R.error(msg); + } + } + + + @RequestMapping("/getById") + public R getById(@RequestBody ThirdMsgSendRecord thirdMsgSendRecord) { + thirdMsgSendRecord = thirdMsgSendRecordservice.selectThirdMsgSendRecordById(thirdMsgSendRecord.getId()); + return R.ok().put("thirdMsgSendRecord",thirdMsgSendRecord); + } + + + @RequestMapping("/update") + public R update(@RequestBody ThirdMsgSendRecord thirdMsgSendRecord) { + thirdMsgSendRecordservice.updateThirdMsgSendRecordById(thirdMsgSendRecord); + return R.ok(); + } + + + @RequestMapping("/save") + public R save(@RequestBody ThirdMsgSendRecord thirdMsgSendRecord) { + thirdMsgSendRecordservice.insertThirdMsgSendRecord(thirdMsgSendRecord); + return R.ok(); + } + + + @RequestMapping("/delete") + public R list(@RequestBody Long id) { + thirdMsgSendRecordservice.deleteThirdMsgSendRecordById(id); + return R.ok(); + } +} diff --git a/src/main/java/com/lz/modules/third/dao/ThirdMsgSendRecordMapper.java b/src/main/java/com/lz/modules/third/dao/ThirdMsgSendRecordMapper.java new file mode 100644 index 00000000..952f9727 --- /dev/null +++ b/src/main/java/com/lz/modules/third/dao/ThirdMsgSendRecordMapper.java @@ -0,0 +1,33 @@ +package com.lz.modules.third.dao; +/** +*

+* 第三方消息发送记录 服务类 +*

+* +* @author quyixiao +* @since 2020-08-19 +*/ +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.lz.modules.third.entity.ThirdMsgSendRecord; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +@Mapper +public interface ThirdMsgSendRecordMapper extends BaseMapper { + + + ThirdMsgSendRecord selectThirdMsgSendRecordById(@Param("id")Long id); + + + Long insertThirdMsgSendRecord(ThirdMsgSendRecord thirdMsgSendRecord); + + + int updateThirdMsgSendRecordById(ThirdMsgSendRecord thirdMsgSendRecord); + + + int updateCoverThirdMsgSendRecordById(ThirdMsgSendRecord thirdMsgSendRecord); + + + int deleteThirdMsgSendRecordById(@Param("id")Long id); + + +} \ No newline at end of file diff --git a/src/main/java/com/lz/modules/third/entity/ThirdMsgSendRecord.java b/src/main/java/com/lz/modules/third/entity/ThirdMsgSendRecord.java new file mode 100644 index 00000000..249aca2f --- /dev/null +++ b/src/main/java/com/lz/modules/third/entity/ThirdMsgSendRecord.java @@ -0,0 +1,492 @@ +package com.lz.modules.third.entity; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import java.util.Date; +/** +*

+* 菜单权限表 +*

*第三方消息发送记录 +* @author quyixiao +* @since 2020-08-19 +*/ + +@Data +@TableName("third_msg_send_record") +public class ThirdMsgSendRecord implements java.io.Serializable { + // + @TableId(value = "id", type = IdType.AUTO) + private Long id; + // + private Integer isDelete; + // + private Date createTime; + // + private Date updateTime; + //消息类型:text,image,voice,file,link,oa,markdown,action_card + private String msgType; + //消息头背景色 oa消息中才有 + private String headBgcolor; + //消息头部标题,最多10个字符 oa消息中,action_card的title + private String headText; + //消息标题,oa中的消息体的消息头,link,markdown,action_card的single_title + private String msgTitle; + //消息内容,text,link,oa正文,markdown的markdown内容,action_card的markdown内容 + private String msgContent; + //image,voice,file消息的文件附件id + private Long mediaId; + //voice消息的时常信息 不超过60秒 + private String duration; + //link、oa的message_url,action_card的single_url + private String msgUrl; + //link,oa中的图片,如果使用钉钉中的资源ID,请用@资源id的形式 + private String picUrl; + //oa的pc端url + private String pcUrl; + //oa中的消息体,json,Array串[{"key":"说明A","value":"值A"},{"key":"说明B","value":"值B"}],最多显示6个 + private String form; + //oa中的单文本信息的数目 + private String richNum; + //oa中的单文本信息的单位 + private String richUnit; + //oa中显示的附件数目,不做校验只展示 + private String fileCount; + //oa中的自定义作者 + private String author; + //action_card独立跳转是按钮的排列0是竖向排列 1是横向排列 + private String actionCardBtnOrientation; + //action_card独立跳转的jsonarray [{"tilte":"A按钮","action_url":"A按钮链接"},{"tilte":"B按钮","action_url":"B按钮链接"}] + private String actionCardBtnList; + //lz_staff id + private Long staffId; + //发送状态:0新建,1已发送,2处理中,3已送达,4未读,5已读,6发送失败,7撤回 + private Integer status; + //应用ID + private Long appId; + //钉钉返回的任务id + private Long taskId; + //备注,一些说明 + private String remark; + /** + * + * @return + */ + public Long getId() { + return id; + } + /** + * + * @param id + */ + public void setId(Long id) { + this.id = id; + } + + /** + * + * @return + */ + public Integer getIsDelete() { + return isDelete; + } + /** + * + * @param isDelete + */ + public void setIsDelete(Integer isDelete) { + this.isDelete = isDelete; + } + + /** + * + * @return + */ + public Date getCreateTime() { + return createTime; + } + /** + * + * @param createTime + */ + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + /** + * + * @return + */ + public Date getUpdateTime() { + return updateTime; + } + /** + * + * @param updateTime + */ + public void setUpdateTime(Date updateTime) { + this.updateTime = updateTime; + } + + /** + * 消息类型:text,image,voice,file,link,oa,markdown,action_card + * @return + */ + public String getMsgType() { + return msgType; + } + /** + * 消息类型:text,image,voice,file,link,oa,markdown,action_card + * @param msgType + */ + public void setMsgType(String msgType) { + this.msgType = msgType; + } + + /** + * 消息头背景色 oa消息中才有 + * @return + */ + public String getHeadBgcolor() { + return headBgcolor; + } + /** + * 消息头背景色 oa消息中才有 + * @param headBgcolor + */ + public void setHeadBgcolor(String headBgcolor) { + this.headBgcolor = headBgcolor; + } + + /** + * 消息头部标题,最多10个字符 oa消息中,action_card的title + * @return + */ + public String getHeadText() { + return headText; + } + /** + * 消息头部标题,最多10个字符 oa消息中,action_card的title + * @param headText + */ + public void setHeadText(String headText) { + this.headText = headText; + } + + /** + * 消息标题,oa中的消息体的消息头,link,markdown,action_card的single_title + * @return + */ + public String getMsgTitle() { + return msgTitle; + } + /** + * 消息标题,oa中的消息体的消息头,link,markdown,action_card的single_title + * @param msgTitle + */ + public void setMsgTitle(String msgTitle) { + this.msgTitle = msgTitle; + } + + /** + * 消息内容,text,link,oa正文,markdown的markdown内容,action_card的markdown内容 + * @return + */ + public String getMsgContent() { + return msgContent; + } + /** + * 消息内容,text,link,oa正文,markdown的markdown内容,action_card的markdown内容 + * @param msgContent + */ + public void setMsgContent(String msgContent) { + this.msgContent = msgContent; + } + + /** + * image,voice,file消息的文件附件id + * @return + */ + public Long getMediaId() { + return mediaId; + } + /** + * image,voice,file消息的文件附件id + * @param mediaId + */ + public void setMediaId(Long mediaId) { + this.mediaId = mediaId; + } + + /** + * voice消息的时常信息 不超过60秒 + * @return + */ + public String getDuration() { + return duration; + } + /** + * voice消息的时常信息 不超过60秒 + * @param duration + */ + public void setDuration(String duration) { + this.duration = duration; + } + + /** + * link、oa的message_url,action_card的single_url + * @return + */ + public String getMsgUrl() { + return msgUrl; + } + /** + * link、oa的message_url,action_card的single_url + * @param msgUrl + */ + public void setMsgUrl(String msgUrl) { + this.msgUrl = msgUrl; + } + + /** + * link,oa中的图片,如果使用钉钉中的资源ID,请用@资源id的形式 + * @return + */ + public String getPicUrl() { + return picUrl; + } + /** + * link,oa中的图片,如果使用钉钉中的资源ID,请用@资源id的形式 + * @param picUrl + */ + public void setPicUrl(String picUrl) { + this.picUrl = picUrl; + } + + /** + * oa的pc端url + * @return + */ + public String getPcUrl() { + return pcUrl; + } + /** + * oa的pc端url + * @param pcUrl + */ + public void setPcUrl(String pcUrl) { + this.pcUrl = pcUrl; + } + + /** + * oa中的消息体,json,Array串[{"key":"说明A","value":"值A"},{"key":"说明B","value":"值B"}],最多显示6个 + * @return + */ + public String getForm() { + return form; + } + /** + * oa中的消息体,json,Array串[{"key":"说明A","value":"值A"},{"key":"说明B","value":"值B"}],最多显示6个 + * @param form + */ + public void setForm(String form) { + this.form = form; + } + + /** + * oa中的单文本信息的数目 + * @return + */ + public String getRichNum() { + return richNum; + } + /** + * oa中的单文本信息的数目 + * @param richNum + */ + public void setRichNum(String richNum) { + this.richNum = richNum; + } + + /** + * oa中的单文本信息的单位 + * @return + */ + public String getRichUnit() { + return richUnit; + } + /** + * oa中的单文本信息的单位 + * @param richUnit + */ + public void setRichUnit(String richUnit) { + this.richUnit = richUnit; + } + + /** + * oa中显示的附件数目,不做校验只展示 + * @return + */ + public String getFileCount() { + return fileCount; + } + /** + * oa中显示的附件数目,不做校验只展示 + * @param fileCount + */ + public void setFileCount(String fileCount) { + this.fileCount = fileCount; + } + + /** + * oa中的自定义作者 + * @return + */ + public String getAuthor() { + return author; + } + /** + * oa中的自定义作者 + * @param author + */ + public void setAuthor(String author) { + this.author = author; + } + + /** + * action_card独立跳转是按钮的排列0是竖向排列 1是横向排列 + * @return + */ + public String getActionCardBtnOrientation() { + return actionCardBtnOrientation; + } + /** + * action_card独立跳转是按钮的排列0是竖向排列 1是横向排列 + * @param actionCardBtnOrientation + */ + public void setActionCardBtnOrientation(String actionCardBtnOrientation) { + this.actionCardBtnOrientation = actionCardBtnOrientation; + } + + /** + * action_card独立跳转的jsonarray [{"tilte":"A按钮","action_url":"A按钮链接"},{"tilte":"B按钮","action_url":"B按钮链接"}] + * @return + */ + public String getActionCardBtnList() { + return actionCardBtnList; + } + /** + * action_card独立跳转的jsonarray [{"tilte":"A按钮","action_url":"A按钮链接"},{"tilte":"B按钮","action_url":"B按钮链接"}] + * @param actionCardBtnList + */ + public void setActionCardBtnList(String actionCardBtnList) { + this.actionCardBtnList = actionCardBtnList; + } + + /** + * lz_staff id + * @return + */ + public Long getStaffId() { + return staffId; + } + /** + * lz_staff id + * @param staffId + */ + public void setStaffId(Long staffId) { + this.staffId = staffId; + } + + /** + * 发送状态:0新建,1已发送,2处理中,3已送达,4未读,5已读,6发送失败,7撤回 + * @return + */ + public Integer getStatus() { + return status; + } + /** + * 发送状态:0新建,1已发送,2处理中,3已送达,4未读,5已读,6发送失败,7撤回 + * @param status + */ + public void setStatus(Integer status) { + this.status = status; + } + + /** + * 应用ID + * @return + */ + public Long getAppId() { + return appId; + } + /** + * 应用ID + * @param appId + */ + public void setAppId(Long appId) { + this.appId = appId; + } + + /** + * 钉钉返回的任务id + * @return + */ + public Long getTaskId() { + return taskId; + } + /** + * 钉钉返回的任务id + * @param taskId + */ + public void setTaskId(Long taskId) { + this.taskId = taskId; + } + + /** + * 备注,一些说明 + * @return + */ + public String getRemark() { + return remark; + } + /** + * 备注,一些说明 + * @param remark + */ + public void setRemark(String remark) { + this.remark = remark; + } + + @Override + public String toString() { + return "ThirdMsgSendRecord{" + + ",id=" + id + + ",isDelete=" + isDelete + + ",createTime=" + createTime + + ",updateTime=" + updateTime + + ",msgType=" + msgType + + ",headBgcolor=" + headBgcolor + + ",headText=" + headText + + ",msgTitle=" + msgTitle + + ",msgContent=" + msgContent + + ",mediaId=" + mediaId + + ",duration=" + duration + + ",msgUrl=" + msgUrl + + ",picUrl=" + picUrl + + ",pcUrl=" + pcUrl + + ",form=" + form + + ",richNum=" + richNum + + ",richUnit=" + richUnit + + ",fileCount=" + fileCount + + ",author=" + author + + ",actionCardBtnOrientation=" + actionCardBtnOrientation + + ",actionCardBtnList=" + actionCardBtnList + + ",staffId=" + staffId + + ",status=" + status + + ",appId=" + appId + + ",taskId=" + taskId + + ",remark=" + remark + + "}"; + } +} \ No newline at end of file diff --git a/src/main/java/com/lz/modules/third/entity/ThirdMsgSendRecordReq.java b/src/main/java/com/lz/modules/third/entity/ThirdMsgSendRecordReq.java new file mode 100644 index 00000000..08fe6c4f --- /dev/null +++ b/src/main/java/com/lz/modules/third/entity/ThirdMsgSendRecordReq.java @@ -0,0 +1,493 @@ +package com.lz.modules.third.entity; +import lombok.Data; +import java.util.Date; +/** +*

+* 菜单权限表 +*

*第三方消息发送记录 +* @author quyixiao +* @since 2020-08-19 +*/ + + +@Data +public class ThirdMsgSendRecordReq implements java.io.Serializable { + + private int page = 1; + private int rows = 10; + private String sort; + private String order; + // + private Long id; + // + private Integer isDelete; + // + private Date createTime; + // + private Date updateTime; + //消息类型:text,image,voice,file,link,oa,markdown,action_card + private String msgType; + //消息头背景色 oa消息中才有 + private String headBgcolor; + //消息头部标题,最多10个字符 oa消息中,action_card的title + private String headText; + //消息标题,oa中的消息体的消息头,link,markdown,action_card的single_title + private String msgTitle; + //消息内容,text,link,oa正文,markdown的markdown内容,action_card的markdown内容 + private String msgContent; + //image,voice,file消息的文件附件id + private Long mediaId; + //voice消息的时常信息 不超过60秒 + private String duration; + //link、oa的message_url,action_card的single_url + private String msgUrl; + //link,oa中的图片,如果使用钉钉中的资源ID,请用@资源id的形式 + private String picUrl; + //oa的pc端url + private String pcUrl; + //oa中的消息体,json,Array串[{"key":"说明A","value":"值A"},{"key":"说明B","value":"值B"}],最多显示6个 + private String form; + //oa中的单文本信息的数目 + private String richNum; + //oa中的单文本信息的单位 + private String richUnit; + //oa中显示的附件数目,不做校验只展示 + private String fileCount; + //oa中的自定义作者 + private String author; + //action_card独立跳转是按钮的排列0是竖向排列 1是横向排列 + private String actionCardBtnOrientation; + //action_card独立跳转的jsonarray [{"tilte":"A按钮","action_url":"A按钮链接"},{"tilte":"B按钮","action_url":"B按钮链接"}] + private String actionCardBtnList; + //lz_staff id + private Long staffId; + //发送状态:0新建,1已发送,2处理中,3已送达,4未读,5已读,6发送失败,7撤回 + private Integer status; + //应用ID + private Long appId; + //钉钉返回的任务id + private Long taskId; + //备注,一些说明 + private String remark; + /** + * + * @return + */ + public Long getId() { + return id; + } + /** + * + * @param id + */ + public void setId(Long id) { + this.id = id; + } + + /** + * + * @return + */ + public Integer getIsDelete() { + return isDelete; + } + /** + * + * @param isDelete + */ + public void setIsDelete(Integer isDelete) { + this.isDelete = isDelete; + } + + /** + * + * @return + */ + public Date getCreateTime() { + return createTime; + } + /** + * + * @param createTime + */ + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + /** + * + * @return + */ + public Date getUpdateTime() { + return updateTime; + } + /** + * + * @param updateTime + */ + public void setUpdateTime(Date updateTime) { + this.updateTime = updateTime; + } + + /** + * 消息类型:text,image,voice,file,link,oa,markdown,action_card + * @return + */ + public String getMsgType() { + return msgType; + } + /** + * 消息类型:text,image,voice,file,link,oa,markdown,action_card + * @param msgType + */ + public void setMsgType(String msgType) { + this.msgType = msgType; + } + + /** + * 消息头背景色 oa消息中才有 + * @return + */ + public String getHeadBgcolor() { + return headBgcolor; + } + /** + * 消息头背景色 oa消息中才有 + * @param headBgcolor + */ + public void setHeadBgcolor(String headBgcolor) { + this.headBgcolor = headBgcolor; + } + + /** + * 消息头部标题,最多10个字符 oa消息中,action_card的title + * @return + */ + public String getHeadText() { + return headText; + } + /** + * 消息头部标题,最多10个字符 oa消息中,action_card的title + * @param headText + */ + public void setHeadText(String headText) { + this.headText = headText; + } + + /** + * 消息标题,oa中的消息体的消息头,link,markdown,action_card的single_title + * @return + */ + public String getMsgTitle() { + return msgTitle; + } + /** + * 消息标题,oa中的消息体的消息头,link,markdown,action_card的single_title + * @param msgTitle + */ + public void setMsgTitle(String msgTitle) { + this.msgTitle = msgTitle; + } + + /** + * 消息内容,text,link,oa正文,markdown的markdown内容,action_card的markdown内容 + * @return + */ + public String getMsgContent() { + return msgContent; + } + /** + * 消息内容,text,link,oa正文,markdown的markdown内容,action_card的markdown内容 + * @param msgContent + */ + public void setMsgContent(String msgContent) { + this.msgContent = msgContent; + } + + /** + * image,voice,file消息的文件附件id + * @return + */ + public Long getMediaId() { + return mediaId; + } + /** + * image,voice,file消息的文件附件id + * @param mediaId + */ + public void setMediaId(Long mediaId) { + this.mediaId = mediaId; + } + + /** + * voice消息的时常信息 不超过60秒 + * @return + */ + public String getDuration() { + return duration; + } + /** + * voice消息的时常信息 不超过60秒 + * @param duration + */ + public void setDuration(String duration) { + this.duration = duration; + } + + /** + * link、oa的message_url,action_card的single_url + * @return + */ + public String getMsgUrl() { + return msgUrl; + } + /** + * link、oa的message_url,action_card的single_url + * @param msgUrl + */ + public void setMsgUrl(String msgUrl) { + this.msgUrl = msgUrl; + } + + /** + * link,oa中的图片,如果使用钉钉中的资源ID,请用@资源id的形式 + * @return + */ + public String getPicUrl() { + return picUrl; + } + /** + * link,oa中的图片,如果使用钉钉中的资源ID,请用@资源id的形式 + * @param picUrl + */ + public void setPicUrl(String picUrl) { + this.picUrl = picUrl; + } + + /** + * oa的pc端url + * @return + */ + public String getPcUrl() { + return pcUrl; + } + /** + * oa的pc端url + * @param pcUrl + */ + public void setPcUrl(String pcUrl) { + this.pcUrl = pcUrl; + } + + /** + * oa中的消息体,json,Array串[{"key":"说明A","value":"值A"},{"key":"说明B","value":"值B"}],最多显示6个 + * @return + */ + public String getForm() { + return form; + } + /** + * oa中的消息体,json,Array串[{"key":"说明A","value":"值A"},{"key":"说明B","value":"值B"}],最多显示6个 + * @param form + */ + public void setForm(String form) { + this.form = form; + } + + /** + * oa中的单文本信息的数目 + * @return + */ + public String getRichNum() { + return richNum; + } + /** + * oa中的单文本信息的数目 + * @param richNum + */ + public void setRichNum(String richNum) { + this.richNum = richNum; + } + + /** + * oa中的单文本信息的单位 + * @return + */ + public String getRichUnit() { + return richUnit; + } + /** + * oa中的单文本信息的单位 + * @param richUnit + */ + public void setRichUnit(String richUnit) { + this.richUnit = richUnit; + } + + /** + * oa中显示的附件数目,不做校验只展示 + * @return + */ + public String getFileCount() { + return fileCount; + } + /** + * oa中显示的附件数目,不做校验只展示 + * @param fileCount + */ + public void setFileCount(String fileCount) { + this.fileCount = fileCount; + } + + /** + * oa中的自定义作者 + * @return + */ + public String getAuthor() { + return author; + } + /** + * oa中的自定义作者 + * @param author + */ + public void setAuthor(String author) { + this.author = author; + } + + /** + * action_card独立跳转是按钮的排列0是竖向排列 1是横向排列 + * @return + */ + public String getActionCardBtnOrientation() { + return actionCardBtnOrientation; + } + /** + * action_card独立跳转是按钮的排列0是竖向排列 1是横向排列 + * @param actionCardBtnOrientation + */ + public void setActionCardBtnOrientation(String actionCardBtnOrientation) { + this.actionCardBtnOrientation = actionCardBtnOrientation; + } + + /** + * action_card独立跳转的jsonarray [{"tilte":"A按钮","action_url":"A按钮链接"},{"tilte":"B按钮","action_url":"B按钮链接"}] + * @return + */ + public String getActionCardBtnList() { + return actionCardBtnList; + } + /** + * action_card独立跳转的jsonarray [{"tilte":"A按钮","action_url":"A按钮链接"},{"tilte":"B按钮","action_url":"B按钮链接"}] + * @param actionCardBtnList + */ + public void setActionCardBtnList(String actionCardBtnList) { + this.actionCardBtnList = actionCardBtnList; + } + + /** + * lz_staff id + * @return + */ + public Long getStaffId() { + return staffId; + } + /** + * lz_staff id + * @param staffId + */ + public void setStaffId(Long staffId) { + this.staffId = staffId; + } + + /** + * 发送状态:0新建,1已发送,2处理中,3已送达,4未读,5已读,6发送失败,7撤回 + * @return + */ + public Integer getStatus() { + return status; + } + /** + * 发送状态:0新建,1已发送,2处理中,3已送达,4未读,5已读,6发送失败,7撤回 + * @param status + */ + public void setStatus(Integer status) { + this.status = status; + } + + /** + * 应用ID + * @return + */ + public Long getAppId() { + return appId; + } + /** + * 应用ID + * @param appId + */ + public void setAppId(Long appId) { + this.appId = appId; + } + + /** + * 钉钉返回的任务id + * @return + */ + public Long getTaskId() { + return taskId; + } + /** + * 钉钉返回的任务id + * @param taskId + */ + public void setTaskId(Long taskId) { + this.taskId = taskId; + } + + /** + * 备注,一些说明 + * @return + */ + public String getRemark() { + return remark; + } + /** + * 备注,一些说明 + * @param remark + */ + public void setRemark(String remark) { + this.remark = remark; + } + + @Override + public String toString() { + return "ThirdMsgSendRecord{" + + ",id=" + id + + ",isDelete=" + isDelete + + ",createTime=" + createTime + + ",updateTime=" + updateTime + + ",msgType=" + msgType + + ",headBgcolor=" + headBgcolor + + ",headText=" + headText + + ",msgTitle=" + msgTitle + + ",msgContent=" + msgContent + + ",mediaId=" + mediaId + + ",duration=" + duration + + ",msgUrl=" + msgUrl + + ",picUrl=" + picUrl + + ",pcUrl=" + pcUrl + + ",form=" + form + + ",richNum=" + richNum + + ",richUnit=" + richUnit + + ",fileCount=" + fileCount + + ",author=" + author + + ",actionCardBtnOrientation=" + actionCardBtnOrientation + + ",actionCardBtnList=" + actionCardBtnList + + ",staffId=" + staffId + + ",status=" + status + + ",appId=" + appId + + ",taskId=" + taskId + + ",remark=" + remark + + "}"; + } +} \ No newline at end of file diff --git a/src/main/java/com/lz/modules/third/service/ThirdAppConfigService.java b/src/main/java/com/lz/modules/third/service/ThirdAppConfigService.java index 957760b7..dfdc40ae 100644 --- a/src/main/java/com/lz/modules/third/service/ThirdAppConfigService.java +++ b/src/main/java/com/lz/modules/third/service/ThirdAppConfigService.java @@ -3,6 +3,7 @@ package com.lz.modules.third.service; import com.baomidou.mybatisplus.extension.service.IService; import com.lz.common.utils.PageUtils; import com.lz.modules.third.entity.ThirdAppConfig; +import com.lz.modules.third.entity.ThirdMsgSendRecord; import java.util.Map; @@ -36,4 +37,5 @@ public interface ThirdAppConfigService extends IService { PageUtils queryPage(Map params); ThirdAppConfig getByAppId(String appid); + } \ No newline at end of file diff --git a/src/main/java/com/lz/modules/third/service/ThirdMsgSendRecordService.java b/src/main/java/com/lz/modules/third/service/ThirdMsgSendRecordService.java new file mode 100644 index 00000000..5312c70d --- /dev/null +++ b/src/main/java/com/lz/modules/third/service/ThirdMsgSendRecordService.java @@ -0,0 +1,39 @@ +package com.lz.modules.third.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.lz.common.utils.PageUtils; +import com.lz.modules.third.entity.ThirdMsgSendRecord; + +import java.util.Map; + +/** +*

+* 第三方消息发送记录 服务类 +*

+* +* @author quyixiao +* @since 2020-08-19 +*/ +public interface ThirdMsgSendRecordService extends IService { + + + + ThirdMsgSendRecord selectThirdMsgSendRecordById(Long id); + + + Long insertThirdMsgSendRecord(ThirdMsgSendRecord thirdMsgSendRecord); + + + int updateThirdMsgSendRecordById(ThirdMsgSendRecord thirdMsgSendRecord); + + + int updateCoverThirdMsgSendRecordById(ThirdMsgSendRecord thirdMsgSendRecord); + + + int deleteThirdMsgSendRecordById(Long id); + + + PageUtils queryPage(Map params); + + void insert(ThirdMsgSendRecord thirdMsgSendRecord); +} \ No newline at end of file diff --git a/src/main/java/com/lz/modules/third/service/impl/ThirdAppConfigServiceImpl.java b/src/main/java/com/lz/modules/third/service/impl/ThirdAppConfigServiceImpl.java index 304b54f0..25743a6c 100644 --- a/src/main/java/com/lz/modules/third/service/impl/ThirdAppConfigServiceImpl.java +++ b/src/main/java/com/lz/modules/third/service/impl/ThirdAppConfigServiceImpl.java @@ -8,6 +8,8 @@ import com.lz.common.utils.Query; import com.lz.modules.sys.entity.SysRoleEntity; import com.lz.modules.third.dao.ThirdAppConfigMapper; import com.lz.modules.third.entity.ThirdAppConfig; +import com.lz.modules.third.entity.ThirdMsgSendRecord; +import com.lz.modules.third.service.ThirdAppConfigService; import org.apache.commons.lang.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -24,7 +26,7 @@ import java.util.Map; */ @Service -public class ThirdAppConfigServiceImpl extends ServiceImpl implements com.lz.modules.third.service.ThirdAppConfigService { +public class ThirdAppConfigServiceImpl extends ServiceImpl implements ThirdAppConfigService { @Autowired diff --git a/src/main/java/com/lz/modules/third/service/impl/ThirdMsgSendRecordServiceImpl.java b/src/main/java/com/lz/modules/third/service/impl/ThirdMsgSendRecordServiceImpl.java new file mode 100644 index 00000000..76400066 --- /dev/null +++ b/src/main/java/com/lz/modules/third/service/impl/ThirdMsgSendRecordServiceImpl.java @@ -0,0 +1,91 @@ +package com.lz.modules.third.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.lz.common.utils.PageUtils; +import com.lz.common.utils.Query; +import com.lz.modules.third.dao.ThirdMsgSendRecordMapper; +import com.lz.modules.third.entity.ThirdAppConfig; +import com.lz.modules.third.entity.ThirdMsgSendRecord; +import com.lz.modules.third.service.ThirdMsgSendRecordService; +import org.apache.commons.lang.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.Collection; +import java.util.Map; + +/** +*

+* 第三方消息发送记录 服务类 +*

+* +* @author quyixiao +* @since 2020-08-19 +*/ + +@Service +public class ThirdMsgSendRecordServiceImpl extends ServiceImpl implements ThirdMsgSendRecordService { + + + @Resource + private ThirdMsgSendRecordMapper thirdMsgSendRecordMapper; + + + + @Override + public ThirdMsgSendRecord selectThirdMsgSendRecordById(Long id){ + return thirdMsgSendRecordMapper.selectThirdMsgSendRecordById(id); + } + + + + @Override + public Long insertThirdMsgSendRecord(ThirdMsgSendRecord thirdMsgSendRecord){ + return thirdMsgSendRecordMapper.insertThirdMsgSendRecord(thirdMsgSendRecord); + } + + + + @Override + public int updateThirdMsgSendRecordById(ThirdMsgSendRecord thirdMsgSendRecord){ + return thirdMsgSendRecordMapper.updateThirdMsgSendRecordById(thirdMsgSendRecord); + } + + + + @Override + public int updateCoverThirdMsgSendRecordById(ThirdMsgSendRecord thirdMsgSendRecord){ + return thirdMsgSendRecordMapper.updateCoverThirdMsgSendRecordById(thirdMsgSendRecord); + } + + + + @Override + public int deleteThirdMsgSendRecordById(Long id){ + return thirdMsgSendRecordMapper.deleteThirdMsgSendRecordById(id); + } + + @Override + public PageUtils queryPage(Map params){ + String roleName = (String)params.get("app_name"); + Long createUserId = (Long)params.get("app_key"); + + IPage page = this.page( + new Query().getPage(params), + new QueryWrapper() + .like(StringUtils.isNotBlank(roleName),"app_name", roleName) + .eq(createUserId != null,"app_key", createUserId) + ); + + return new PageUtils(page); + } + + @Override + public void insert(ThirdMsgSendRecord thirdMsgSendRecord){ + thirdMsgSendRecordMapper.insert(thirdMsgSendRecord); + } + +} diff --git a/src/main/resources/mapper/generator/StaffDao.xml b/src/main/resources/mapper/generator/StaffDao.xml index ad79749b..5db531ea 100644 --- a/src/main/resources/mapper/generator/StaffDao.xml +++ b/src/main/resources/mapper/generator/StaffDao.xml @@ -250,7 +250,7 @@ + select * from third_msg_send_record where id=#{id} and is_delete = 0 limit 1 + + + + + insert into third_msg_send_record( + create_time, + update_time, + msg_type, + head_bgcolor, + head_text, + msg_title, + msg_content, + media_id, + duration, + msg_url, + pic_url, + pc_url, + form, + rich_num, + rich_unit, + file_count, + author, + action_card_btn_orientation, + action_card_btn_list, + staff_id, + status, + app_id, + task_id, + remark, + is_delete, + gmt_create, + gmt_modified + )values( + #{ createTime}, + #{ updateTime}, + #{ msgType}, + #{ headBgcolor}, + #{ headText}, + #{ msgTitle}, + #{ msgContent}, + #{ mediaId}, + #{ duration}, + #{ msgUrl}, + #{ picUrl}, + #{ pcUrl}, + #{ form}, + #{ richNum}, + #{ richUnit}, + #{ fileCount}, + #{ author}, + #{ actionCardBtnOrientation}, + #{ actionCardBtnList}, + #{ staffId}, + #{ status}, + #{ appId}, + #{ taskId}, + #{ remark}, + 0, + now(), + now() + ) + + + + + update + third_msg_send_record + + is_delete = #{isDelete}, + create_time = #{createTime}, + update_time = #{updateTime}, + msg_type = #{msgType}, + head_bgcolor = #{headBgcolor}, + head_text = #{headText}, + msg_title = #{msgTitle}, + msg_content = #{msgContent}, + media_id = #{mediaId}, + duration = #{duration}, + msg_url = #{msgUrl}, + pic_url = #{picUrl}, + pc_url = #{pcUrl}, + form = #{form}, + rich_num = #{richNum}, + rich_unit = #{richUnit}, + file_count = #{fileCount}, + author = #{author}, + action_card_btn_orientation = #{actionCardBtnOrientation}, + action_card_btn_list = #{actionCardBtnList}, + staff_id = #{staffId}, + status = #{status}, + app_id = #{appId}, + task_id = #{taskId}, + remark = #{remark} + + ,gmt_modified = now() + where id = #{id} + + + + + update + third_msg_send_record + set + is_delete = #{isDelete}, + create_time = #{createTime}, + update_time = #{updateTime}, + msg_type = #{msgType}, + head_bgcolor = #{headBgcolor}, + head_text = #{headText}, + msg_title = #{msgTitle}, + msg_content = #{msgContent}, + media_id = #{mediaId}, + duration = #{duration}, + msg_url = #{msgUrl}, + pic_url = #{picUrl}, + pc_url = #{pcUrl}, + form = #{form}, + rich_num = #{richNum}, + rich_unit = #{richUnit}, + file_count = #{fileCount}, + author = #{author}, + action_card_btn_orientation = #{actionCardBtnOrientation}, + action_card_btn_list = #{actionCardBtnList}, + staff_id = #{staffId}, + status = #{status}, + app_id = #{appId}, + task_id = #{taskId}, + remark = #{remark} + ,gmt_modified = now() + where id = #{id} + + + + + update third_msg_send_record set is_delete = 1 where id=#{id} limit 1 + + + + diff --git a/src/test/java/com/lz/mysql/MysqlMain.java b/src/test/java/com/lz/mysql/MysqlMain.java index 94a0e25d..15abafc2 100644 --- a/src/test/java/com/lz/mysql/MysqlMain.java +++ b/src/test/java/com/lz/mysql/MysqlMain.java @@ -61,7 +61,7 @@ public class MysqlMain { } List list = new ArrayList(); - list.add(new TablesBean("sys_user_token")); + list.add(new TablesBean("third_msg_send_record")); List list2 = new ArrayList(); Map map = MysqlUtil2ShowCreateTable.getComments(); diff --git a/src/test/java/com/lz/mysql/MysqlUtilTable2Contoller.java b/src/test/java/com/lz/mysql/MysqlUtilTable2Contoller.java index 4f694bec..da0d251f 100644 --- a/src/test/java/com/lz/mysql/MysqlUtilTable2Contoller.java +++ b/src/test/java/com/lz/mysql/MysqlUtilTable2Contoller.java @@ -37,7 +37,7 @@ public class MysqlUtilTable2Contoller { content.append("\n"); content.append("\n"); content.append(" @Autowired\n"); - content.append(" private " + tableBean.getSpaceName() + "service " + tableBean.getJavaName() + "service;\n"); + content.append(" private " + tableBean.getSpaceName() + "Service " + tableBean.getJavaName() + "Service;\n"); content.append("\n"); content.append("\n"); content.append(" @RequestMapping(\"/list\")\n");