Commit 49b95f25 by 东州 翁 Committed by chenzg

调整意见反馈接口

parent 10f0d6a1
......@@ -38,7 +38,7 @@ public class QyzxAttaFpgl extends Model<QyzxAttaFpgl> {
@ApiModelProperty(value="编号 编号",example="101")
private Integer id;
@ApiModelProperty(value="组织机构代码 组织机构代码",example="101")
@ApiModelProperty(value="组织机构代码 ",example="101")
private Integer orgCode;
@ApiModelProperty(value="发票抬头 ",example="发票抬头")
......@@ -56,7 +56,7 @@ public class QyzxAttaFpgl extends Model<QyzxAttaFpgl> {
@ApiModelProperty(value="开户银行 ",example="开户银行")
private String depositBank;
@ApiModelProperty(value="开户账号 开户账号",example="101")
@ApiModelProperty(value="开户账号",example="101")
private String depositBankAccount;
@ApiModelProperty(value="是否默认 0:是;1:否",example="101")
......
......@@ -38,7 +38,7 @@ public class QyzxAttaQyfj extends Model<QyzxAttaQyfj> {
@ApiModelProperty(value="编号 编号",example="101")
private Integer id;
@ApiModelProperty(value="组织机构代码 qyzx_main_qyxx",example="101")
@ApiModelProperty(value="组织机构代码",example="101")
private Integer orgCode;
@ApiModelProperty(value="附件名称 ",example="附件名称")
......
......@@ -73,8 +73,6 @@ public class QyzxInvoiceUsual extends Model<QyzxInvoiceUsual>{
@ApiModelProperty(value="发票类型",example="0-普通 1-专用")
private Integer invoiceType;
@ApiModelProperty(value="收货人",example="翁🐻")
private String consignee;
......
......@@ -37,21 +37,21 @@ public class QyzxSuggestionFeeback extends Model<QyzxSuggestionFeeback> {
@ApiModelProperty(value="员工编号",example="9688")
private Integer empNum;
@ApiModelProperty(value="",example="不好用")
@ApiModelProperty(value="意见文本",example="不好用")
private String opinionText;
@ApiModelProperty(value="",example="1")
@ApiModelProperty(value="bug类型",example="1")
private Integer bugType;
@ApiModelProperty(value="",example="2020-4-20 08:00:00")
@ApiModelProperty(value="创建时间",example="2020-4-20 08:00:00")
private Date createTime;
@ApiModelProperty(value="",example="117")
@ApiModelProperty(value="组织机构代码",example="117")
private Integer orgCode;
@ApiModelProperty(value="",example="那别用了")
@ApiModelProperty(value="回复",example="那别用了")
private String reply;
@ApiModelProperty(value="",example="2020-4-21 08:00:00")
@ApiModelProperty(value="回复时间",example="2020-4-21 08:00:00")
private Date replyTime;
}
\ No newline at end of file
......@@ -31,7 +31,6 @@ import cn.hutool.core.util.NumberUtil;
import cn.timer.api.bean.qyzx.QyzxAttaFwjsb;
import cn.timer.api.bean.qyzx.QyzxEmpEntAsso;
import cn.timer.api.bean.qyzx.QyzxEmpLogin;
import cn.timer.api.bean.qyzx.QyzxEntAuth;
import cn.timer.api.bean.qyzx.QyzxEntInfoM;
import cn.timer.api.bean.qyzx.QyzxFeebackAccessory;
import cn.timer.api.bean.qyzx.QyzxInvoiceUsual;
......@@ -43,7 +42,7 @@ import cn.timer.api.bean.zzgl.ZzglBmgwM;
import cn.timer.api.config.annotation.CurrentUser;
import cn.timer.api.config.annotation.UserBean;
import cn.timer.api.config.enums.CommonEnum;
import cn.timer.api.dao.qyzx.QyzxAttaFpzlMapper;
import cn.timer.api.dao.qyzx.QyzxEmpEntAssoMapper;
import cn.timer.api.dao.qyzx.QyzxEmpLoginMapper;
import cn.timer.api.dao.qyzx.QyzxEntAuthMapper;
......@@ -58,6 +57,7 @@ import cn.timer.api.dto.login.QysDto;
import cn.timer.api.dto.qyzx.AdminListDto;
import cn.timer.api.dto.qyzx.AttaFpglQueryDto;
import cn.timer.api.dto.qyzx.EntauthDto;
import cn.timer.api.dto.qyzx.FeebackDto;
import cn.timer.api.dto.qyzx.LogBuyDto;
import cn.timer.api.utils.Result;
import cn.timer.api.utils.ResultUtil;
......@@ -90,9 +90,6 @@ public class QyzxController {
private QyzxLogBuyMapper qyzxLogBuyMapper;
@Autowired
private QyzxAttaFpzlMapper qyzxAttaFpzlMapper;
@Autowired
private QyzxEntAuthMapper qyzxEntAuthMapper;
@Autowired
......@@ -309,8 +306,11 @@ public class QyzxController {
} else {
// 获取权限
ArrayList<Integer> list = new ArrayList<Integer>();
List<ZzglBmgwM> zzglBmgwMs = new LambdaQueryChainWrapper<ZzglBmgwM>(zzglBmgwMMapper)
.eq(ZzglBmgwM::getOrgCode, ctrl.getId()).list();
// List<ZzglBmgwM> zzglBmgwMs = new LambdaQueryChainWrapper<ZzglBmgwM>(zzglBmgwMMapper)
// .eq(ZzglBmgwM::getOrgCode, ctrl.getId()).list();
List<ZzglBmgwM> zzglBmgwMs = zzglBmgwMMapper.selectList(new QueryWrapper<ZzglBmgwM>().lambda().eq(ZzglBmgwM::getOrgCode, ctrl.getId()));
// 传入的部门岗位是登录者的岗位id.获取的list中只有一个元素,不必要
ZzglBmgwM.getupDepts(list, ctrl.getBmgwId(), zzglBmgwMs);
if (list != null && list.size() > 0) {
......@@ -334,220 +334,57 @@ public class QyzxController {
}
}
@Autowired
private OSSUtil oss;
// 下载系统使用手册 直接提供(OSS公共读权限文件)url地址到前端按钮
/**
* 获取开票资料
*/
/*
*
* @Override public Result<QyzxEntInfoM> selectfpzl() { Integer orgCode =
* List<QyzxAttaFpzl> qyzxAttaFpzl =
* QyzxAttaFpzl.builder().build().selectList(new
* QueryWrapper<QyzxAttaFpzl>().eq("org_code", orgCode)); return new
* ResultUtil.data("获取发票资料成功", qyzxAttaFpzl); }
*
*
*//**
* 添加/修改开票资料
*
* @param
* @return
*/
/*
* @PostMapping(value = "/fpzl")
*
* @ApiOperation(value = "添加/修改发票资料", httpMethod = "POST", notes = "接口发布说明")
* public Result<QyzxAttaFpzl> addfpzl(@CurrentUser UserBean
* userBean, @RequestBody QyzxAttaFpzl qyzxAttaFpzl) {
* qyzxAttaFpzl.setOrgCode(userBean.getOrgCode());
* qyzxAttaFpzl.insertOrUpdate(); return ResultUtil.data(qyzxAttaFpzl,
* "添加/修改发票资料成功"); }
*
*//**
* 设置默认发票
*
* @param
* @return
*/
/*
* @GetMapping(value = "/defaultfp/{id}")
*
* @ApiOperation(value = "设置默认发票", httpMethod = "GET", notes = "接口发布说明") public
* Result<Void> setdef(@CurrentUser UserBean userBean, @PathVariable("id")
* Integer id) { // 将所有地址设为非默认 UpdateWrapper<QyzxAttaFpzl> updateWrapper = new
* UpdateWrapper<QyzxAttaFpzl>(); QyzxAttaFpzl q =
* QyzxAttaFpzl.builder().orgCode(userBean.getOrgCode()).isDefault(2).build();
* qyzxAttaFpzlMapper.update(q, updateWrapper);
*
* // 根据id将发票设为默认 updateWrapper.eq("id", id); QyzxAttaFpzl w =
* QyzxAttaFpzl.builder().orgCode(userBean.getOrgCode()).id(id).isDefault(1).
* build(); qyzxAttaFpzlMapper.update(w, updateWrapper);
*
* // 返回成功 return ResultUtil.success("设置成功"); }
*
*//**
* 删除开票资料
*
* @param
* @return
*/
/*
* @DeleteMapping(value = "/fpzl/{id}")
*
* @ApiOperation(value = "删除发票资料", httpMethod = "DELETE", notes = "接口发布说明")
* public Result<Integer> deletefpzl(@PathVariable Integer id) {
* QyzxAttaFpzl.builder().build().deleteById(id); return ResultUtil.data(id,
* "删除发票资料成功"); }
*
* // 获取发票管理
*
* @Override public Result<QyzxEntInfoM> selectfpgl() { Integer orgCode =
* qyzxAttaFpgl = QyzxAttaFpgl.builder().build().selectList(new
* QueryWrapper<QyzxAttaFpgl>().eq("org_code", orgCode)); return new
* ResultUtil.data("获取发票管理成功", qyzxAttaFpgl); }
*
*
*//**
* 添加/修改发票管理
*
* @param
* @return
*/
/*
* @PostMapping(value = "/fpgl")
*
* @ApiOperation(value = "添加/修改发票管理", httpMethod = "POST", notes = "接口发布说明")
* public Result<QyzxAttaFpgl> addfpgl(@CurrentUser UserBean
* userBean, @RequestBody QyzxAttaFpgl qyzxAttaFpgl) {
* qyzxAttaFpgl.setOrgCode(userBean.getOrgCode());
* qyzxAttaFpgl.insertOrUpdate(); return ResultUtil.data(qyzxAttaFpgl,
* "添加/修改发票管理成功"); }
*
*//**
* 删除开票资料
*
* @param
* @return
*/
/*
* @DeleteMapping(value = "/fpgl/{id}")
*
* @ApiOperation(value = "删除发票管理", httpMethod = "DELETE", notes = "接口发布说明")
* public Result<Integer> deletefpgl(@PathVariable Integer id) {
* QyzxAttaFpgl.builder().build().deleteById(id); return ResultUtil.data(id,
* "删除发票管理成功"); }
*
*//**
* 开票资料查询
*
* @param
* @return
* 意见反馈
*/
/*
* @PostMapping(value = "/fpzlquery")
*
* @ApiOperation(value = "发票资料查询", httpMethod = "POST", notes = "接口发布说明") public
* Result<Object> queryfpzl(@CurrentUser UserBean userBean,
*
* @RequestBody QyzxAttaFpzlQueryDto qyzxAttaFpzlQueryDto) { String
* titleOrAddress = qyzxAttaFpzlQueryDto.getNameOrAddress();
*
* Page<QyzxAttaFpzl> page = new Page<QyzxAttaFpzl>(
* qyzxAttaFpzlQueryDto.getCurrentPage() == null ? 1 :
* qyzxAttaFpzlQueryDto.getCurrentPage(), qyzxAttaFpzlQueryDto.getTotalPage() ==
* null ? 10 : qyzxAttaFpzlQueryDto.getTotalPage());
*
* QueryWrapper<QyzxAttaFpzl> queryWrapper = new QueryWrapper<>();
* queryWrapper.eq("org_code",
* userBean.getOrgCode()).and(!StrUtil.hasBlank(titleOrAddress), wq ->
* wq.likeRight("address", titleOrAddress).or().likeRight("title",
* titleOrAddress)); IPage<QyzxAttaFpzl> qyzxAttaFpzlPage =
* QyzxAttaFpzl.builder().build().selectPage(page, queryWrapper);
* List<QyzxAttaFpzl> qyzxAttaFpzls = qyzxAttaFpzlPage.getRecords();
* qyzxAttaFpzlPage.getCurrent(); qyzxAttaFpzlPage.getPages();
* qyzxAttaFpzlPage.getTotal(); qyzxAttaFpzlPage.getSize(); return
* ResultUtil.data(qyzxAttaFpzlPage, qyzxAttaFpzls, "发票资料查询成功"); }
*
*//**
* 发票管理查询
*
* @param
* @return
*//*
* @PostMapping(value = "/fpglquery")
*
* @ApiOperation(value = "发票管理查询", httpMethod = "POST", notes = "接口发布说明") public
* Result<Object> queryfpgl(@CurrentUser UserBean userBean, @RequestBody
* AttaFpglQueryDto attaFpglQueryDto) { String query =
* attaFpglQueryDto.getQuery(); String startTime =
* attaFpglQueryDto.getStartTime(); String endTime =
* attaFpglQueryDto.getEndTime(); Page<QyzxAttaFpgl> page = new
* Page<QyzxAttaFpgl>( attaFpglQueryDto.getCurrentPage() == null ? 1 :
* attaFpglQueryDto.getCurrentPage(), attaFpglQueryDto.getTotalPage() == null ?
* 10 : attaFpglQueryDto.getTotalPage()); Integer orgCode =
* userBean.getOrgCode(); QueryWrapper<QyzxAttaFpgl> queryWrapper = new
* QueryWrapper<>(); queryWrapper.eq("org_code",
* orgCode).gt(!StrUtil.hasBlank(startTime), "create_time", startTime)
* .lt(!StrUtil.hasBlank(endTime), "create_time", endTime)
* .and(!StrUtil.hasBlank(query), wq -> wq.likeRight("title",
* query).or().likeRight("project", query)); List<QyzxAttaFpgl> qyzxAttaFpgls =
* QyzxAttaFpgl.builder().build().selectList(queryWrapper);
*
* queryWrapper.eq("org_code", orgCode) .between(!StrUtil.hasBlank(startTime) &&
* !StrUtil.hasBlank(endTime), "create_time", !StrUtil.hasBlank(startTime) ?
* startTime : "1000-01-01 00:00:00", !StrUtil.hasBlank(endTime) ? endTime :
* "9999-01-01 00:00:00") .and(!StrUtil.hasBlank(query), wq ->
* wq.likeRight("title", query).or().likeRight("project", query));
*
*
*
* IPage<QyzxAttaFpgl> qyzxAttaFpglPage =
* QyzxAttaFpgl.builder().build().selectPage(page, queryWrapper);
* List<QyzxAttaFpgl> qyzxAttaFpgls = qyzxAttaFpglPage.getRecords();
* qyzxAttaFpglPage.getCurrent(); qyzxAttaFpglPage.getPages();
* qyzxAttaFpglPage.getTotal(); qyzxAttaFpglPage.getSize();
*
*
* return ResultUtil.data(page, qyzxAttaFpgls, "发票资料查询成功"); }
* @PostMapping(value = "/feedback")
*
* @ApiOperation(value = "意见反馈", httpMethod = "POST", notes = "接口发布说明") public
* Result<QyzxSuggestionFeeback> feedback(@CurrentUser UserBean userBean,
*
* @RequestParam(required = false) String opinionText, @RequestParam(required =
* false) String moudle,
*
* @Param("files") List<MultipartFile> files) { String url = null; List<String>
* list = new ArrayList<String>(); if (files != null) { for (MultipartFile file
* : files) { String path = "8timer2.0/" + userBean.getOrgCode() + "/" + moudle
* + "/" + file.getOriginalFilename(); if (file == null || file.getSize() <= 0)
* { return ResultUtil.error("上传的文件为空,请重新选择!"); } else { try { url =
* oss.uploadFile(path, file.getInputStream()); list.add(url); } catch
* (IOException e) { e.printStackTrace(); } } } } QyzxSuggestionFeeback feeback
* = new QyzxSuggestionFeeback(); feeback.setEmpNum(userBean.getEmpNum());
* feeback.setOpinionText(opinionText); feeback.setCreateTime(new Date());
* feeback.setOrgCode(userBean.getOrgCode()); boolean a = feeback.insert(); if
* (a && list.size() > 0) { for (String opinionUrl : list) {
* QyzxFeebackAccessory.builder().feebackId(feeback.getId()).opinionUrl(
* opinionUrl).build().insert(); } } return ResultUtil.success("意见反馈成功!"); }
*/
// 下载系统使用手册 直接提供(OSS公共读权限文件)url地址到前端按钮
/**
* 意见反馈
* 意见反馈2
*/
@PostMapping(value = "/feedback")
@ApiOperation(value = "意见反馈", httpMethod = "POST", notes = "接口发布说明")
public Result<QyzxSuggestionFeeback> feedback(@CurrentUser UserBean userBean,
@RequestParam(required = false) String opinionText, @RequestParam(required = false) String moudle,
@Param("files") List<MultipartFile> files) {
String url = null;
List<String> list = new ArrayList<String>();
if (files != null) {
for (MultipartFile file : files) {
String path = "8timer2.0/" + userBean.getOrgCode() + "/" + moudle + "/" + file.getOriginalFilename();
if (file == null || file.getSize() <= 0) {
return ResultUtil.error("上传的文件为空,请重新选择!");
} else {
try {
url = OSSUtil.uploadFile(path, file.getInputStream());
list.add(url);
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
QyzxSuggestionFeeback feeback = new QyzxSuggestionFeeback();
feeback.setEmpNum(userBean.getEmpNum());
feeback.setOpinionText(opinionText);
feeback.setCreateTime(new Date());
feeback.setOrgCode(userBean.getOrgCode());
boolean a = feeback.insert();
if (a && list.size() > 0) {
for (String opinionUrl : list) {
QyzxFeebackAccessory.builder().feebackId(feeback.getId()).opinionUrl(opinionUrl).build().insert();
public Result<String> feedback(@CurrentUser UserBean userBean, @RequestBody FeebackDto feebackDto) {
String opinionText = feebackDto.getOpinionText();
List<String> urlList = feebackDto.getUrlList();
QyzxSuggestionFeeback qs = QyzxSuggestionFeeback.builder().orgCode(userBean.getOrgCode()).empNum(userBean.getEmpNum()).opinionText(opinionText).bugType(1).createTime(new Date()).build();
boolean tof = qs.insert();
Integer feebackId = qs.getId();
if (tof) {
for (String str : urlList) {
QyzxFeebackAccessory.builder().feebackId(feebackId).opinionUrl(str).build().insert();
}
return ResultUtil.data("意见反馈成功!");
}
return ResultUtil.success("意见反馈成功!");
return ResultUtil.data("意见反馈失败!");
}
/**
......
/**
* @date 2020年4月27日
* @author 翁东州
* @方法中文名称:
*/
package cn.timer.api.dto.qyzx;
import java.io.Serializable;
import java.util.List;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @date 2020年4月27日
* @author 翁东州
* @方法中文名称:
*/
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class FeebackDto implements Serializable{
/**
* @date 2020年4月27日
* @author 翁东州
* @方法中文名称:
*/
private static final long serialVersionUID = 4457381912053961473L;
@ApiModelProperty(value = "填写内容", example = "13129310893")
private String opinionText;
@ApiModelProperty(value = "附件地址", example = "123456")
private List<String> urlList;
}
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