| | |
| | | } |
| | | |
| | | @ApiOperation("获取验证码") |
| | | @GetMapping("/getVerifyCode") |
| | | @GetMapping("/verify/get") |
| | | @RepeatSubmit |
| | | public AjaxResult getVerifyCode(@RequestParam("phone") String phone) |
| | | { |
| | | return AjaxResult.success(loginService.getVerifyCode(phone)); |
| | | } |
| | | |
| | | @ApiOperation("校验验证码验证码") |
| | | @PostMapping("/verify") |
| | | @ApiOperation("校验验证码") |
| | | @PostMapping("/verify/check") |
| | | @RepeatSubmit |
| | | public AjaxResult verify(@RequestBody UserPhoneLoginBo bo) |
| | | { |
| | | return AjaxResult.success(loginService.verifyPhone(bo.getPhone(), bo.getCode())); |
| | | } |
| | | |
| | | @ApiOperation("手机号验证码登录") |
| | | @PostMapping("/login/phone") |
| | | @ApiOperation("验证码登录") |
| | | @PostMapping("/verify/login") |
| | | @RepeatSubmit |
| | | public AjaxResult phoneLogin(@RequestBody UserPhoneLoginBo bo) |
| | | { |
| | |
| | | } |
| | | |
| | | user.setCreateBy(getUsername()); |
| | | user.setPassword(SecurityUtils.encryptPassword(user.getPassword())); |
| | | user.setRecommendUser(user.getPassword()); |
| | | user.setPassword(SecurityUtils.encryptPassword(user.getPassword())); |
| | | return toAjax(userService.insertUser(user)); |
| | | } |
| | | |
| | |
| | | - /websocket/** |
| | | - /chat/** |
| | | - /system/dict/** |
| | | - /getVerifyCode |
| | | - /login/phone |
| | | - /verify/** |
| | | - /tool/** #临时白名单 |
New file |
| | |
| | | package com.project.common.sms; |
| | | |
| | | import com.project.common.constant.Constants; |
| | | import org.apache.http.HttpEntity; |
| | | import org.apache.http.NameValuePair; |
| | | import org.apache.http.client.entity.UrlEncodedFormEntity; |
| | | import org.apache.http.client.methods.CloseableHttpResponse; |
| | | import org.apache.http.client.methods.HttpPost; |
| | | import org.apache.http.impl.client.CloseableHttpClient; |
| | | import org.apache.http.impl.client.HttpClients; |
| | | import org.apache.http.message.BasicNameValuePair; |
| | | import org.apache.http.util.EntityUtils; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 短信http接口的java代码调用示例 |
| | | * 基于Apache HttpClient 4.3 |
| | | * @author Mr.Zhao |
| | | */ |
| | | |
| | | public class YPSmsApi { |
| | | |
| | | /** |
| | | * 请求地址 |
| | | */ |
| | | private static final String YP_SMS_URI = "http://yunpian.com/v1/sms/send.json"; |
| | | |
| | | /** |
| | | * KEY |
| | | */ |
| | | private static final String API_KEY = "faf531146ca1e38abacd3862fb3fc32b"; |
| | | |
| | | /** |
| | | * 签名 |
| | | */ |
| | | private static final String SIGN = "【金明源】"; |
| | | |
| | | /** |
| | | * 验证码模板 |
| | | */ |
| | | public static final String VERIFY_CODE_TEMPLATE = "您的验证码是{}"; |
| | | |
| | | /** |
| | | * 审批通知模板 |
| | | */ |
| | | public static final String CHECK_NOTICE_TEMPLATE = SIGN + "{}提交了执法申请单,请您及时审批!"; |
| | | |
| | | /** |
| | | * 审批通过模板 |
| | | */ |
| | | public static final String CHECK_PASS_TEMPLATE = SIGN + "您提交的执法申请单已审批通过,请您及时查看!"; |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 发送短信 |
| | | * @param mobile 接受的手机号 |
| | | * @param msg 短信内容 |
| | | */ |
| | | public static String sendSms(String mobile, String msg) |
| | | { |
| | | Map<String, String> params = new HashMap<>(3); |
| | | params.put("apikey", API_KEY); |
| | | params.put("text", msg); |
| | | params.put("mobile", mobile); |
| | | return post(YP_SMS_URI, params); |
| | | } |
| | | |
| | | public static void main(String[] args) { |
| | | sendSms("18537821663", "【金明源】您的验证码是1234"); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 基于HttpClient 4.3的通用POST方法 |
| | | * |
| | | * @param url 提交的URL |
| | | * @param paramsMap 提交<参数,值>Map |
| | | * @return 提交响应 |
| | | */ |
| | | public static String post(String url, Map<String, String> paramsMap) |
| | | { |
| | | CloseableHttpClient client = HttpClients.createDefault(); |
| | | String responseText = ""; |
| | | CloseableHttpResponse response = null; |
| | | try { |
| | | HttpPost method = new HttpPost(url); |
| | | if (paramsMap != null) { |
| | | List<NameValuePair> paramList = new ArrayList<NameValuePair>(); |
| | | for (Map.Entry<String, String> param : paramsMap.entrySet()) { |
| | | NameValuePair pair = new BasicNameValuePair(param.getKey(), param.getValue()); |
| | | paramList.add(pair); |
| | | } |
| | | method.setEntity(new UrlEncodedFormEntity(paramList, Constants.UTF8)); |
| | | } |
| | | response = client.execute(method); |
| | | HttpEntity entity = response.getEntity(); |
| | | if (entity != null) { |
| | | responseText = EntityUtils.toString(entity); |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } finally { |
| | | try { |
| | | if (response != null) { |
| | | response.close(); |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | System.out.println(responseText);//此处打印在console后,会给出一个IP地址 |
| | | return responseText; |
| | | } |
| | | } |
New file |
| | |
| | | package com.project.enforce.domain; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.project.common.core.domain.BaseDomain; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.NoArgsConstructor; |
| | | import lombok.experimental.Accessors; |
| | | /** |
| | | * 投诉记录对象 enforce_complaint_log |
| | | * |
| | | * @author manton |
| | | */ |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @Data |
| | | @NoArgsConstructor |
| | | @Accessors(chain = true) |
| | | @TableName("enforce_complaint_log") |
| | | @ApiModel("投诉记录实体对象") |
| | | public class EnforceComplaintLog extends BaseDomain { |
| | | |
| | | private static final long serialVersionUID=1L; |
| | | |
| | | |
| | | @TableId(value = "id") |
| | | @ApiModelProperty("ID") |
| | | private Long id; |
| | | |
| | | |
| | | @ApiModelProperty("执法单id") |
| | | private String orderId; |
| | | |
| | | |
| | | @ApiModelProperty("执法单号") |
| | | private String orderNo; |
| | | |
| | | |
| | | @ApiModelProperty("执法主题") |
| | | private String enforceReason; |
| | | |
| | | |
| | | @ApiModelProperty("企业ID") |
| | | private Long companyId; |
| | | |
| | | |
| | | @ApiModelProperty("企业名") |
| | | private String companyName; |
| | | |
| | | |
| | | @ApiModelProperty("企业联系人") |
| | | private String companyUser; |
| | | |
| | | |
| | | @ApiModelProperty("企业联系人电话(账号)") |
| | | private String companyPhone; |
| | | |
| | | |
| | | @ApiModelProperty("执行人") |
| | | private Long executeUser; |
| | | |
| | | |
| | | @ApiModelProperty("执行人电话") |
| | | private Long executePhone; |
| | | |
| | | |
| | | @ApiModelProperty("执行人单位") |
| | | private Long executeDeptName; |
| | | |
| | | |
| | | @ApiModelProperty("投诉类型") |
| | | private String complaintType; |
| | | |
| | | |
| | | @ApiModelProperty("投诉内容") |
| | | private String complaintReason; |
| | | |
| | | |
| | | @ApiModelProperty("投诉状态:-1已驳回,0待响应,1处理中,2已办结") |
| | | private Integer complaintStatus; |
| | | |
| | | |
| | | @ApiModelProperty("驳回原因") |
| | | private String returnReason; |
| | | |
| | | |
| | | @ApiModelProperty("处理结果") |
| | | private String complaintResult; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | @ApiModelProperty("是否投诉:0否,1是") |
| | | private Integer isComplaint; |
| | | |
| | | /** 投诉类型 */ |
| | | @ApiModelProperty("投诉类型") |
| | | private String complaintType; |
| | | |
| | | /** 投诉内容 */ |
| | | @ApiModelProperty("投诉内容") |
| | | private String complaintReason; |
New file |
| | |
| | | package com.project.enforce.domain.bo.editBo; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | |
| | | /** |
| | | * 投诉记录编辑对象 enforce_complaint_log |
| | | * |
| | | * @author manton |
| | | */ |
| | | |
| | | @Data |
| | | @ApiModel("投诉记录操作对象") |
| | | public class EnforceComplaintLogBo { |
| | | |
| | | |
| | | /** ID */ |
| | | @ApiModelProperty("ID") |
| | | private Long id; |
| | | |
| | | /** 执法单id */ |
| | | @ApiModelProperty("执法单id") |
| | | private String orderId; |
| | | |
| | | /** 执法单号 */ |
| | | @ApiModelProperty("执法单号") |
| | | private String orderNo; |
| | | |
| | | /** 执法主题 */ |
| | | @ApiModelProperty("执法主题") |
| | | private String enforceReason; |
| | | |
| | | /** 企业ID */ |
| | | @ApiModelProperty("企业ID") |
| | | private Long companyId; |
| | | |
| | | /** 企业名 */ |
| | | @ApiModelProperty("企业名") |
| | | private String companyName; |
| | | |
| | | /** 企业联系人 */ |
| | | @ApiModelProperty("企业联系人") |
| | | private String companyUser; |
| | | |
| | | /** 企业联系人电话(账号) */ |
| | | @ApiModelProperty("企业联系人电话(账号)") |
| | | private String companyPhone; |
| | | |
| | | /** 执行人 */ |
| | | @ApiModelProperty("执行人") |
| | | private Long executeUser; |
| | | |
| | | /** 执行人电话 */ |
| | | @ApiModelProperty("执行人电话") |
| | | private Long executePhone; |
| | | |
| | | /** 执行人单位 */ |
| | | @ApiModelProperty("执行人单位") |
| | | private Long executeDeptName; |
| | | |
| | | /** 投诉类型 */ |
| | | @ApiModelProperty("投诉类型") |
| | | private String complaintType; |
| | | |
| | | /** 投诉内容 */ |
| | | @ApiModelProperty("投诉内容") |
| | | private String complaintReason; |
| | | |
| | | /** 投诉状态:-1已驳回,0待响应,1处理中,2已办结 */ |
| | | @ApiModelProperty("投诉状态:-1已驳回,0待响应,1处理中,2已办结") |
| | | private Integer complaintStatus; |
| | | |
| | | /** 驳回原因 */ |
| | | @ApiModelProperty("驳回原因") |
| | | private String returnReason; |
| | | |
| | | /** 处理结果 */ |
| | | @ApiModelProperty("处理结果") |
| | | private String complaintResult; |
| | | |
| | | /** 更新人 */ |
| | | @ApiModelProperty("更新人") |
| | | private String updateBy; |
| | | |
| | | /** 更新时间 */ |
| | | @ApiModelProperty("更新时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date updateTime; |
| | | |
| | | /** 备注 */ |
| | | @ApiModelProperty("备注") |
| | | private String remark; |
| | | } |
| | |
| | | @ApiModelProperty("是否投诉:0否,1是") |
| | | private Integer isComplaint; |
| | | |
| | | /** 投诉类型 */ |
| | | @ApiModelProperty("投诉类型") |
| | | private String complaintType; |
| | | |
| | | /** 投诉内容 */ |
| | | @ApiModelProperty("投诉内容") |
| | | private String complaintReason; |
New file |
| | |
| | | package com.project.enforce.domain.bo.queryBo; |
| | | |
| | | import com.project.common.core.domain.BaseQuery; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | |
| | | /** |
| | | * 投诉记录分页查询对象 enforce_complaint_log |
| | | * |
| | | * @author manton |
| | | */ |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @Data |
| | | @ApiModel("投诉记录分页查询对象") |
| | | public class EnforceComplaintLogQueryBo extends BaseQuery{ |
| | | |
| | | /** 分页大小 */ |
| | | @ApiModelProperty("分页大小") |
| | | private Integer pageSize; |
| | | /** 当前页数 */ |
| | | @ApiModelProperty("当前页数") |
| | | private Integer pageNum; |
| | | /** 排序列 */ |
| | | @ApiModelProperty("排序列") |
| | | private String orderByColumn; |
| | | /** 排序的方向desc或者asc */ |
| | | @ApiModelProperty(value = "排序的方向", example = "asc,desc") |
| | | private String isAsc; |
| | | |
| | | |
| | | /** 执法单id */ |
| | | @ApiModelProperty("执法单id") |
| | | private String orderId; |
| | | /** 执法单号 */ |
| | | @ApiModelProperty("执法单号") |
| | | private String orderNo; |
| | | /** 执法主题 */ |
| | | @ApiModelProperty("执法主题") |
| | | private String enforceReason; |
| | | /** 企业ID */ |
| | | @ApiModelProperty("企业ID") |
| | | private Long companyId; |
| | | /** 企业名 */ |
| | | @ApiModelProperty("企业名") |
| | | private String companyName; |
| | | /** 企业联系人 */ |
| | | @ApiModelProperty("企业联系人") |
| | | private String companyUser; |
| | | /** 企业联系人电话(账号) */ |
| | | @ApiModelProperty("企业联系人电话(账号)") |
| | | private String companyPhone; |
| | | /** 执行人 */ |
| | | @ApiModelProperty("执行人") |
| | | private Long executeUser; |
| | | /** 执行人电话 */ |
| | | @ApiModelProperty("执行人电话") |
| | | private Long executePhone; |
| | | /** 执行人单位 */ |
| | | @ApiModelProperty("执行人单位") |
| | | private Long executeDeptName; |
| | | /** 投诉类型 */ |
| | | @ApiModelProperty("投诉类型") |
| | | private String complaintType; |
| | | /** 投诉内容 */ |
| | | @ApiModelProperty("投诉内容") |
| | | private String complaintReason; |
| | | /** 投诉状态:-1已驳回,0待响应,1处理中,2已办结 */ |
| | | @ApiModelProperty("投诉状态:-1已驳回,0待响应,1处理中,2已办结") |
| | | private Integer complaintStatus; |
| | | /** 驳回原因 */ |
| | | @ApiModelProperty("驳回原因") |
| | | private String returnReason; |
| | | /** 处理结果 */ |
| | | @ApiModelProperty("处理结果") |
| | | private String complaintResult; |
| | | |
| | | } |
| | |
| | | @ApiModelProperty("投诉内容") |
| | | private String complaintReason; |
| | | |
| | | /** 投诉类型 */ |
| | | @ApiModelProperty("投诉类型") |
| | | private String complaintType; |
| | | |
| | | @ApiModelProperty("申请部门ids") |
| | | private List<Long> applyDeptIds; |
New file |
| | |
| | | package com.project.enforce.domain.vo; |
| | | |
| | | import com.project.common.annotation.Excel; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | |
| | | /** |
| | | * 投诉记录视图对象 mall_package |
| | | * |
| | | * @author manton |
| | | */ |
| | | @Data |
| | | @ApiModel("投诉记录视图对象") |
| | | public class EnforceComplaintLogVo { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** ID */ |
| | | @ApiModelProperty("ID") |
| | | private Long id; |
| | | |
| | | @Excel(name = "执法单id") |
| | | @ApiModelProperty("执法单id") |
| | | private String orderId; |
| | | @Excel(name = "执法单号") |
| | | @ApiModelProperty("执法单号") |
| | | private String orderNo; |
| | | @Excel(name = "执法主题") |
| | | @ApiModelProperty("执法主题") |
| | | private String enforceReason; |
| | | @Excel(name = "企业ID") |
| | | @ApiModelProperty("企业ID") |
| | | private Long companyId; |
| | | @Excel(name = "企业名") |
| | | @ApiModelProperty("企业名") |
| | | private String companyName; |
| | | @Excel(name = "企业联系人") |
| | | @ApiModelProperty("企业联系人") |
| | | private String companyUser; |
| | | @Excel(name = "企业联系人电话" , readConverterExp = "账=号") |
| | | @ApiModelProperty("企业联系人电话(账号)") |
| | | private String companyPhone; |
| | | @Excel(name = "执行人") |
| | | @ApiModelProperty("执行人") |
| | | private Long executeUser; |
| | | @Excel(name = "执行人电话") |
| | | @ApiModelProperty("执行人电话") |
| | | private Long executePhone; |
| | | @Excel(name = "执行人单位") |
| | | @ApiModelProperty("执行人单位") |
| | | private Long executeDeptName; |
| | | @Excel(name = "投诉类型") |
| | | @ApiModelProperty("投诉类型") |
| | | private String complaintType; |
| | | @Excel(name = "投诉内容") |
| | | @ApiModelProperty("投诉内容") |
| | | private String complaintReason; |
| | | @Excel(name = "投诉状态:-1已驳回,0待响应,1处理中,2已办结") |
| | | @ApiModelProperty("投诉状态:-1已驳回,0待响应,1处理中,2已办结") |
| | | private Integer complaintStatus; |
| | | @Excel(name = "驳回原因") |
| | | @ApiModelProperty("驳回原因") |
| | | private String returnReason; |
| | | @Excel(name = "处理结果") |
| | | @ApiModelProperty("处理结果") |
| | | private String complaintResult; |
| | | @Excel(name = "备注") |
| | | @ApiModelProperty("备注") |
| | | private String remark; |
| | | |
| | | } |
| | |
| | | @ApiModelProperty("是否投诉:0否,1是") |
| | | private Integer isComplaint; |
| | | |
| | | /** 投诉类型 */ |
| | | @ApiModelProperty("投诉类型") |
| | | private String complaintType; |
| | | |
| | | /** 投诉内容 */ |
| | | @ApiModelProperty("投诉内容") |
| | | private String complaintReason; |
New file |
| | |
| | | package com.project.enforce.mapper; |
| | | |
| | | import com.project.enforce.domain.EnforceComplaintLog; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | |
| | | /** |
| | | * 投诉记录Mapper接口 |
| | | * |
| | | * @author manton |
| | | */ |
| | | public interface EnforceComplaintLogMapper extends BaseMapper<EnforceComplaintLog> { |
| | | |
| | | } |
New file |
| | |
| | | package com.project.enforce.service; |
| | | |
| | | import com.project.common.mybatis.IBaseService; |
| | | import com.project.enforce.domain.EnforceComplaintLog; |
| | | import com.project.enforce.domain.bo.editBo.EnforceComplaintLogBo; |
| | | import com.project.enforce.domain.bo.queryBo.EnforceComplaintLogQueryBo; |
| | | import com.project.enforce.domain.vo.EnforceComplaintLogVo; |
| | | |
| | | import java.util.Collection; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 投诉记录Service接口 |
| | | * |
| | | * @author manton |
| | | */ |
| | | public interface IEnforceComplaintLogService extends IBaseService<EnforceComplaintLog> { |
| | | |
| | | /** |
| | | * 查询列表 |
| | | */ |
| | | List<EnforceComplaintLogVo> queryList(EnforceComplaintLogQueryBo bo); |
| | | |
| | | /** |
| | | * 查询单个 |
| | | * @return EnforceComplaintLogVo |
| | | */ |
| | | EnforceComplaintLogVo queryById(Long id); |
| | | |
| | | |
| | | /** |
| | | * 根据新增业务对象插入投诉记录 |
| | | * @param bo 投诉记录新增业务对象 |
| | | * @return true成功 false失败 |
| | | */ |
| | | Boolean insertByBo(EnforceComplaintLogBo bo); |
| | | |
| | | /** |
| | | * 根据编辑业务对象修改投诉记录 |
| | | * @param bo 投诉记录编辑业务对象 |
| | | * @return true成功 false失败 |
| | | */ |
| | | Boolean updateByBo(EnforceComplaintLogBo bo); |
| | | |
| | | /** |
| | | * 校验并删除数据 |
| | | * @param ids 主键集合 |
| | | * @return true成功 false失败 |
| | | */ |
| | | Boolean deleteByIds(Collection<Long> ids); |
| | | } |
| | |
| | | import com.project.enforce.service.IEnforceOrderService; |
| | | import com.project.system.domain.SysCompany; |
| | | import com.project.system.domain.bo.editBo.CheckBo; |
| | | import com.project.system.domain.bo.editBo.SysCompanyBo; |
| | | import com.project.system.service.ISysCompanyService; |
| | | import com.project.system.service.ISysUserService; |
| | | import lombok.RequiredArgsConstructor; |
| | |
| | | if (company==null) { |
| | | throw new BaseException("没有找到对应数据,请检查审核类型!"); |
| | | } |
| | | SysCompanyBo companyBo = new SysCompanyBo(); |
| | | companyBo.setCompanyId(company.getCompanyId()); |
| | | if (bo.getCheckStatus()== -1){ |
| | | company.setCheckStatus(-1); |
| | | companyBo.setCompanyStatus(1); |
| | | } else { |
| | | company.setCheckStatus(2); |
| | | companyBo.setCompanyStatus(0); |
| | | } |
| | | addCheckLog(company, bo); |
| | | company.setCheckReason(bo.getCheckReason()); |
| | | companyService.updStatus(companyBo); |
| | | return companyService.updateById(company); |
| | | case 2: |
| | | EnforceOrder order = orderService.getById(bo.getId()); |
New file |
| | |
| | | package com.project.enforce.service.impl; |
| | | |
| | | import cn.hutool.core.convert.Convert; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.project.common.utils.StringUtils; |
| | | import com.project.enforce.domain.EnforceComplaintLog; |
| | | import com.project.enforce.domain.bo.editBo.EnforceComplaintLogBo; |
| | | import com.project.enforce.domain.bo.queryBo.EnforceComplaintLogQueryBo; |
| | | import com.project.enforce.domain.vo.EnforceComplaintLogVo; |
| | | import com.project.enforce.mapper.EnforceComplaintLogMapper; |
| | | import com.project.enforce.service.IEnforceComplaintLogService; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.Collection; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 投诉记录Service业务层处理 |
| | | * |
| | | * @author manton |
| | | */ |
| | | @Service |
| | | @RequiredArgsConstructor(onConstructor_ = @Autowired) |
| | | public class EnforceComplaintLogServiceImpl extends ServiceImpl<EnforceComplaintLogMapper, EnforceComplaintLog> implements IEnforceComplaintLogService { |
| | | |
| | | |
| | | |
| | | @Override//列表查询 |
| | | public List<EnforceComplaintLogVo> queryList(EnforceComplaintLogQueryBo bo) |
| | | { |
| | | QueryWrapper<EnforceComplaintLog> qw = getQw(bo); |
| | | List<EnforceComplaintLog> list = this.list(qw); |
| | | return Convert.toList(EnforceComplaintLogVo.class , list); |
| | | } |
| | | |
| | | @Override//id查询 |
| | | public EnforceComplaintLogVo queryById(Long id) |
| | | { |
| | | EnforceComplaintLog db = this.baseMapper.selectById(id); |
| | | return Convert.convert(EnforceComplaintLogVo.class , db); |
| | | } |
| | | |
| | | |
| | | @Override//添加 |
| | | @Transactional |
| | | public Boolean insertByBo(EnforceComplaintLogBo bo) |
| | | { |
| | | EnforceComplaintLog add = Convert.convert(EnforceComplaintLog.class, bo); |
| | | validEntityBeforeSave(add); |
| | | return this.save(add); |
| | | } |
| | | |
| | | @Override//修改 |
| | | @Transactional |
| | | public Boolean updateByBo(EnforceComplaintLogBo bo) |
| | | { |
| | | EnforceComplaintLog update = Convert.convert(EnforceComplaintLog.class, bo); |
| | | validEntityBeforeSave(update); |
| | | return this.updateById(update); |
| | | } |
| | | |
| | | @Override//删除 |
| | | @Transactional |
| | | public Boolean deleteByIds(Collection<Long> ids) |
| | | { |
| | | |
| | | //做一些业务上的校验,判断是否需要校验 |
| | | |
| | | return this.removeByIds(ids); |
| | | } |
| | | |
| | | |
| | | //------------------------------------------------------------------------------------- |
| | | |
| | | //保存前校验 |
| | | private void validEntityBeforeSave(EnforceComplaintLog entity) |
| | | { |
| | | //做一些数据校验,如唯一约束 |
| | | } |
| | | |
| | | //获取查询参数 |
| | | private QueryWrapper<EnforceComplaintLog> getQw(EnforceComplaintLogQueryBo bo) |
| | | { |
| | | QueryWrapper<EnforceComplaintLog> qw = Wrappers.query(); |
| | | |
| | | qw.eq(StringUtils.isNotEmpty(bo.getOrderId()), "order_id", bo.getOrderId()); |
| | | qw.eq(StringUtils.isNotEmpty(bo.getOrderNo()), "order_no", bo.getOrderNo()); |
| | | qw.eq(StringUtils.isNotEmpty(bo.getEnforceReason()), "enforce_reason", bo.getEnforceReason()); |
| | | qw.eq(bo.getCompanyId() != null, "company_id", bo.getCompanyId()); |
| | | qw.like(StringUtils.isNotEmpty(bo.getCompanyName()), "company_name", bo.getCompanyName()); |
| | | qw.eq(StringUtils.isNotEmpty(bo.getCompanyUser()), "company_user", bo.getCompanyUser()); |
| | | qw.eq(StringUtils.isNotEmpty(bo.getCompanyPhone()), "company_phone", bo.getCompanyPhone()); |
| | | qw.eq(bo.getExecuteUser() != null, "execute_user", bo.getExecuteUser()); |
| | | qw.eq(bo.getExecutePhone() != null, "execute_phone", bo.getExecutePhone()); |
| | | qw.like(bo.getExecuteDeptName() != null, "execute_dept_name", bo.getExecuteDeptName()); |
| | | qw.eq(StringUtils.isNotEmpty(bo.getComplaintType()), "complaint_type", bo.getComplaintType()); |
| | | qw.eq(StringUtils.isNotEmpty(bo.getComplaintReason()), "complaint_reason", bo.getComplaintReason()); |
| | | qw.eq(bo.getComplaintStatus() != null, "complaint_status", bo.getComplaintStatus()); |
| | | qw.eq(StringUtils.isNotEmpty(bo.getReturnReason()), "return_reason", bo.getReturnReason()); |
| | | qw.eq(StringUtils.isNotEmpty(bo.getComplaintResult()), "complaint_result", bo.getComplaintResult()); |
| | | if (StringUtils.isNotEmpty(bo.getIsAsc()) && StringUtils.isNotEmpty(bo.getOrderByColumn())){ |
| | | if ("acs".equals(bo.getIsAsc())) { |
| | | qw.orderByAsc(bo.getOrderByColumn()); |
| | | } else if ("desc".equals(bo.getIsAsc())) { |
| | | qw.orderByDesc(bo.getOrderByColumn()); |
| | | } |
| | | } |
| | | return qw; |
| | | } |
| | | } |
| | |
| | | { |
| | | List<EnforceEvaluateQuestion> questionList = bo.getQuestionList(); |
| | | if (StringUtils.isEmpty(questionList)){ |
| | | throw new BaseException("题目不可为空!"); |
| | | throw new BaseException("评价项不可为空!"); |
| | | } |
| | | for (EnforceEvaluateQuestion question : bo.getQuestionList()) { |
| | | if (question.getQuestionType()==1 && StringUtils.isEmpty(question.getAnswerList())){ |
| | |
| | | int count = questionService.count(questionService.lq() |
| | | .eq(EnforceEvaluateQuestion::getQuestionName, question.getQuestionId())); |
| | | if (count>0) { |
| | | throw new BaseException(StringUtils.format("{},题目重复,请重试!", question.getQuestionName())); |
| | | throw new BaseException(StringUtils.format("{},重复,请重试!", question.getQuestionName())); |
| | | } |
| | | if (StringUtils.isNotEmpty(question.getAnswerList())){ |
| | | EnforceEvaluateQuestion one = questionService.getOne(questionService.lq().eq(EnforceEvaluateQuestion::getQuestionName, question.getQuestionName())); |
| | | question.getAnswerList().forEach(enforceEvaluateAnswer -> { |
| | | enforceEvaluateAnswer.setQuestionId(one.getQuestionId()); |
| | | enforceEvaluateAnswer.setQuestionName(one.getQuestionName()); |
| | | }); |
| | | } |
| | | |
| | | } else { |
| | | int count = questionService.count(questionService.lq(). |
| | | eq(EnforceEvaluateQuestion::getQuestionName, question.getQuestionId()) |
| | |
| | | } |
| | | questionService.saveOrUpdate(question); |
| | | if (StringUtils.isNotEmpty(question.getAnswerList())){ |
| | | EnforceEvaluateQuestion one = questionService.getOne(questionService.lq().eq(EnforceEvaluateQuestion::getQuestionName, question.getQuestionName())); |
| | | question.getAnswerList().forEach(enforceEvaluateAnswer -> { |
| | | enforceEvaluateAnswer.setQuestionId(one.getQuestionId()); |
| | | enforceEvaluateAnswer.setQuestionName(one.getQuestionName()); |
| | | }); |
| | | answerService.saveOrUpdateBatch(question.getAnswerList()); |
| | | } |
| | | } |
| | | |
| | | return null; |
| | | return true; |
| | | } |
| | | |
| | | @Override//评价设置详情 |
| | |
| | | } |
| | | |
| | | bo.setCheckDeptId(deptService.getCheckDeptIdByLoginDeptId(loginUser.getDeptId())); |
| | | |
| | | bo.setApplyDeptIds(deptService.getApplyDeptIdsByLoginUserId(loginUser.getUserId())); |
| | | |
| | | return this.baseMapper.selectCheckList(bo); |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <!DOCTYPE mapper |
| | | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.project.enforce.mapper.EnforceComplaintLogMapper"> |
| | | |
| | | <resultMap type="EnforceComplaintLog" id="EnforceComplaintLogResult"> |
| | | <result property="id" column="id" /> |
| | | <result property="orderId" column="order_id" /> |
| | | <result property="orderNo" column="order_no" /> |
| | | <result property="enforceReason" column="enforce_reason" /> |
| | | <result property="companyId" column="company_id" /> |
| | | <result property="companyName" column="company_name" /> |
| | | <result property="companyUser" column="company_user" /> |
| | | <result property="companyPhone" column="company_phone" /> |
| | | <result property="executeUser" column="execute_user" /> |
| | | <result property="executePhone" column="execute_phone" /> |
| | | <result property="executeDeptName" column="execute_dept_name" /> |
| | | <result property="complaintType" column="complaint_type" /> |
| | | <result property="complaintReason" column="complaint_reason" /> |
| | | <result property="complaintStatus" column="complaint_status" /> |
| | | <result property="returnReason" column="return_reason" /> |
| | | <result property="complaintResult" column="complaint_result" /> |
| | | <result property="createBy" column="create_by" /> |
| | | <result property="createTime" column="create_time" /> |
| | | <result property="updateBy" column="update_by" /> |
| | | <result property="updateTime" column="update_time" /> |
| | | <result property="remark" column="remark" /> |
| | | <result property="delFlag" column="del_flag" /> |
| | | </resultMap> |
| | | |
| | | |
| | | |
| | | </mapper> |
| | |
| | | AND check_level = #{checkLevel} |
| | | </if> |
| | | |
| | | <if test="checkLevel != null "> |
| | | AND apply_dept_id in #{checkLevel} |
| | | <if test="applyDeptIds != null "> |
| | | AND apply_dept_id in |
| | | <foreach collection="applyDeptIds" item="applyDeptId" open="(" separator="," close=")"> |
| | | #{applyDeptId} |
| | | </foreach> |
| | | </if> |
| | | |
| | | |
| | | |
| | | </where> |
| | | </select> |
| | | |
| | |
| | | import com.project.common.exception.user.CaptchaException; |
| | | import com.project.common.exception.user.CaptchaExpireException; |
| | | import com.project.common.exception.user.UserPasswordNotMatchException; |
| | | import com.project.common.sms.YPSmsApi; |
| | | import com.project.common.utils.DateUtils; |
| | | import com.project.common.utils.MessageUtils; |
| | | import com.project.common.utils.ServletUtils; |
| | |
| | | if (user==null){ |
| | | throw new BaseException("您手机号尚未注册!"); |
| | | } |
| | | |
| | | // 生成4位随机数 |
| | | String code = ""; |
| | | Random ran = new Random(); |
| | | int randomNum = ran.nextInt(10000); |
| | | code = String.format("%04d", randomNum); |
| | | log.info("手机号:"+phone+"->验证码:"+code); |
| | | Boolean flag = true; |
| | | boolean send = sendAl(phone, code); |
| | | if (send){ |
| | | redisCache.setCacheObject(getCacheKey(phone), code, Constants.PHONE_EXPIRATION, TimeUnit.MINUTES); |
| | | return true; |
| | | } |
| | | redisCache.setCacheObject(getCacheKey(phone), code, Constants.PHONE_EXPIRATION, TimeUnit.MINUTES); |
| | | return false; |
| | | } |
| | | |
| | | private boolean sendYp(String phone, String code ){ |
| | | String result = YPSmsApi.sendSms(phone, StringUtils.format(YPSmsApi.VERIFY_CODE_TEMPLATE, code, Constants.PHONE_EXPIRATION)); |
| | | if (result.contains("\"code\":0,\"msg\":\"OK\"")){ |
| | | log.info("发送成功 ->验证码:"+code); |
| | | return true; |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | private boolean sendAl(String phone, String code ){ |
| | | DefaultProfile profile = DefaultProfile.getProfile("cn-beijing", AliyunSmsConstants.SMS_APPID, AliyunSmsConstants.SMS_SECRET); |
| | | IAcsClient client = new DefaultAcsClient(profile); |
| | | CommonRequest request = new CommonRequest(); |
| | |
| | | JSONObject jsonObject = JSON.parseObject(response.getData()); |
| | | if ("OK".equals(jsonObject.get("Code"))) { |
| | | log.info("发送成功 ->验证码:"+code); |
| | | redisCache.setCacheObject(getCacheKey(phone), code, Constants.PHONE_EXPIRATION, TimeUnit.MINUTES); |
| | | return true; |
| | | } |
| | | |
| | | } catch (ClientException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | redisCache.setCacheObject(getCacheKey(phone), code, Constants.PHONE_EXPIRATION, TimeUnit.MINUTES); |
| | | return flag; |
| | | return false; |
| | | } |
| | | |
| | | /** |
| | |
| | | package com.project.system.mapper; |
| | | |
| | | import java.util.List; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import com.project.common.core.domain.entity.SysDictData; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 字典表 数据层 |
| | |
| | | public int updateDictDataType(@Param("oldDictType") String oldDictType, @Param("newDictType") String newDictType); |
| | | |
| | | |
| | | /** |
| | | * 根据字典类型查询字典值是否存在 |
| | | * @param dictType 类型 |
| | | * @return 条数 |
| | | */ |
| | | public int countByDictTypeAndValue(@Param("dictType") String dictType, @Param("dictValue") String dictValue, @Param("dictCode") Long dictCode); |
| | | |
| | | /** |
| | | * 根据字典类型查询字典值是否存在 |
| | | * @param dictType 类型 |
| | | * @return 条数 |
| | | */ |
| | | public int countByDictTypeAndLabel(@Param("dictType") String dictType, @Param("dictLabel") String dictLabel, @Param("dictCode") Long dictCode); |
| | | } |
| | |
| | | public Boolean insertByBo(SysCompanyBo bo) |
| | | { |
| | | SysCompany add = Convert.convert(SysCompany.class, bo); |
| | | add.setCompanyStatus(1); |
| | | validEntityBeforeSave(add); |
| | | boolean save = this.save(add); |
| | | addCompanyUser(add, 0); |
| | |
| | | if (!delUser) { |
| | | throw new BaseException("原企业用户清除失败,请联系管理员!"); |
| | | } |
| | | this.addCompanyUser(update, 0); |
| | | this.addCompanyUser(update, update.getCompanyStatus()==0 ? 1 : 0); |
| | | } |
| | | validEntityBeforeSave(update); |
| | | return this.updateById(update); |
| | |
| | | user.setPassword(phone); |
| | | user.setDeptId(one.getCompanyId()); |
| | | user.setUserType("02"); |
| | | user.setRecommendUser(user.getPassword()); |
| | | if (UserConstants.NOT_UNIQUE.equals(userService.checkUserNameUnique(user))) |
| | | { |
| | | return; |
| | |
| | | } |
| | | user.setCreateBy(SecurityUtils.getUsername()); |
| | | user.setPassword(SecurityUtils.encryptPassword(user.getPassword())); |
| | | user.setRecommendUser(user.getPassword()); |
| | | userService.insertUser(user); |
| | | } |
| | | |
| | |
| | | package com.project.system.service.impl; |
| | | |
| | | import java.util.List; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import com.project.common.core.domain.entity.SysDictData; |
| | | import com.project.common.exception.base.BaseException; |
| | | import com.project.common.utils.DictUtils; |
| | | import com.project.system.mapper.SysDictDataMapper; |
| | | import com.project.system.service.ISysDictDataService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 字典 业务层处理 |
| | | * |
| | | * |
| | | * @author project |
| | | */ |
| | | @Service |
| | |
| | | |
| | | /** |
| | | * 根据条件分页查询字典数据 |
| | | * |
| | | * |
| | | * @param dictData 字典数据信息 |
| | | * @return 字典数据集合信息 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 根据字典类型和字典键值查询字典数据信息 |
| | | * |
| | | * |
| | | * @param dictType 字典类型 |
| | | * @param dictValue 字典键值 |
| | | * @return 字典标签 |
| | |
| | | |
| | | /** |
| | | * 根据字典数据ID查询信息 |
| | | * |
| | | * |
| | | * @param dictCode 字典数据ID |
| | | * @return 字典数据 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 批量删除字典数据信息 |
| | | * |
| | | * |
| | | * @param dictCodes 需要删除的字典数据ID |
| | | */ |
| | | @Override |
| | |
| | | |
| | | /** |
| | | * 新增保存字典数据信息 |
| | | * |
| | | * |
| | | * @param data 字典数据信息 |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public int insertDictData(SysDictData data) |
| | | { |
| | | int valueCount = dictDataMapper.countByDictTypeAndValue(data.getDictType(),data.getDictValue(), null); |
| | | if (valueCount>0) { |
| | | throw new BaseException("类型中字典值已存在!"); |
| | | } |
| | | int labelCount = dictDataMapper.countByDictTypeAndLabel(data.getDictType(),data.getDictLabel(), null); |
| | | if (labelCount>0) { |
| | | throw new BaseException("类型中字典标签已存在!"); |
| | | } |
| | | int row = dictDataMapper.insertDictData(data); |
| | | if (row > 0) |
| | | { |
| | |
| | | |
| | | /** |
| | | * 修改保存字典数据信息 |
| | | * |
| | | * |
| | | * @param data 字典数据信息 |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public int updateDictData(SysDictData data) |
| | | { |
| | | int valueCount = dictDataMapper.countByDictTypeAndValue(data.getDictType(),data.getDictValue(), data.getDictCode()); |
| | | if (valueCount>0) { |
| | | throw new BaseException("类型中字典值已存在!"); |
| | | } |
| | | int labelCount = dictDataMapper.countByDictTypeAndLabel(data.getDictType(),data.getDictLabel(), data.getDictCode()); |
| | | if (labelCount>0) { |
| | | throw new BaseException("类型中字典标签已存在!"); |
| | | } |
| | | int row = dictDataMapper.updateDictData(data); |
| | | if (row > 0) |
| | | { |
| | |
| | | ) |
| | | </insert> |
| | | |
| | | <select id="countByDictTypeAndValue" resultType="Integer"> |
| | | select count(1) from sys_dict_data where dict_type=#{dictType} and dict_value=#{dictValue} |
| | | <if test="dictCode != null"> and dict_code != #{dictCode} </if> |
| | | </select> |
| | | |
| | | <select id="countByDictTypeAndLabel" resultType="Integer"> |
| | | select count(1) from sys_dict_data where dict_type=#{dictType} and dict_label=#{dictLabel} |
| | | <if test="dictCode != null"> and dict_code != #{dictCode} </if> |
| | | </select> |
| | | |
| | | </mapper> |