123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337 |
- package com.zhongzheng.controller.covenant;
- import com.zhongzheng.common.annotation.Log;
- import com.zhongzheng.common.core.controller.BaseController;
- import com.zhongzheng.common.core.domain.AjaxResult;
- import com.zhongzheng.common.core.domain.model.LoginUser;
- import com.zhongzheng.common.core.page.TableDataInfo;
- import com.zhongzheng.common.enums.BusinessType;
- import com.zhongzheng.common.utils.ServletUtils;
- import com.zhongzheng.common.utils.poi.ExcelUtil;
- import com.zhongzheng.framework.web.service.TokenService;
- import com.zhongzheng.modules.bs.covenant.bo.BsCovenantAddBo;
- import com.zhongzheng.modules.bs.covenant.bo.BsCovenantEditBo;
- import com.zhongzheng.modules.bs.covenant.bo.BsCovenantQueryBo;
- import com.zhongzheng.modules.bs.covenant.bo.TenantCovenantInfoAddBo;
- import com.zhongzheng.modules.bs.covenant.service.IBsCovenantService;
- import com.zhongzheng.modules.bs.covenant.vo.BsCovenantVo;
- import com.zhongzheng.modules.bs.covenant.vo.NoCheckInfo;
- import com.zhongzheng.modules.records.vo.CovenantCheckRecordVo;
- import io.swagger.annotations.Api;
- import io.swagger.annotations.ApiOperation;
- import lombok.RequiredArgsConstructor;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.web.bind.annotation.*;
- import java.util.Arrays;
- import java.util.List;
- /**
- * 企业协议Controller
- *
- * @author ruoyi
- * @date 2024-05-28
- */
- @Api(value = "企业协议控制器", tags = {"企业协议管理"})
- @RequiredArgsConstructor(onConstructor_ = @Autowired)
- @RestController
- @RequestMapping("/bs/covenant")
- public class BsCovenantController extends BaseController {
- private final IBsCovenantService iBsCovenantService;
- private final TokenService tokenService;
- /**
- * 查询企业协议列表
- */
- @ApiOperation("查询企业协议管理列表")
- @GetMapping("/getCovenantList")
- public TableDataInfo<BsCovenantVo> getCovenantList(BsCovenantQueryBo bo) {
- startPage();
- bo.setListType(1);
- bo.setUserId(tokenService.getLoginUser(ServletUtils.getRequest()).getUser().getUserId());
- bo.setFormApp(1L);
- List<BsCovenantVo> list = iBsCovenantService.queryList(bo);
- return getDataTable(list);
- }
- /**
- * 查询企业协议列表
- */
- @ApiOperation("查询终止管理协议列表")
- @GetMapping("/getStopCovenantList")
- public TableDataInfo<BsCovenantVo> getStopCovenantList(BsCovenantQueryBo bo) {
- startPage();
- bo.setListType(2);
- bo.setUserId(tokenService.getLoginUser(ServletUtils.getRequest()).getUser().getUserId());
- bo.setFormApp(1L);
- List<BsCovenantVo> list = iBsCovenantService.queryList(bo);
- return getDataTable(list);
- }
- /**
- * 查询企业协议列表
- */
- @ApiOperation("查询协议审核列表")
- @GetMapping("/getCovenantCheckList")
- public TableDataInfo<BsCovenantVo> getCovenantCheckList(BsCovenantQueryBo bo) {
- startPage();
- bo.setListType(3);
- bo.setUserId(tokenService.getLoginUser(ServletUtils.getRequest()).getUser().getUserId());
- bo.setFormApp(1L);
- List<BsCovenantVo> list = iBsCovenantService.queryList(bo);
- return getDataTable(list);
- }
- /**
- * 查询企业协议列表
- */
- @ApiOperation("查询终止审核列表")
- @GetMapping("/getStopCheckList")
- public TableDataInfo<BsCovenantVo> getStopCheckList(BsCovenantQueryBo bo) {
- startPage();
- bo.setListType(4);
- bo.setUserId(tokenService.getLoginUser(ServletUtils.getRequest()).getUser().getUserId());
- bo.setFormApp(1L);
- List<BsCovenantVo> list = iBsCovenantService.queryList(bo);
- return getDataTable(list);
- }
- /**
- * 查询企业协议列表
- */
- @ApiOperation("查询协议上传列表")
- @GetMapping("/getCovenantUploadList")
- public TableDataInfo<BsCovenantVo> getCovenantUploadList(BsCovenantQueryBo bo) {
- startPage();
- bo.setListType(5);
- bo.setUserId(tokenService.getLoginUser(ServletUtils.getRequest()).getUser().getUserId());
- bo.setFormApp(1L);
- List<BsCovenantVo> list = iBsCovenantService.queryList(bo);
- return getDataTable(list);
- }
- /**
- * 查询企业协议列表
- */
- @ApiOperation("查询甲乙方上一次收件信息")
- @GetMapping("/getLastJiaInfo")
- public AjaxResult getLastJiaInfo(BsCovenantQueryBo bo) {
- startPage();
- bo.setUserId(tokenService.getLoginUser(ServletUtils.getRequest()).getUser().getUserId());
- bo.setFormApp(1L);
- return AjaxResult.success(iBsCovenantService.getLastJiaInfo(bo));
- }
- /**
- * 查询企业协议列表
- */
- @ApiOperation("查询乙方名称及地址")
- @GetMapping("/getYiInfo")
- public AjaxResult getYiInfo() {
- return AjaxResult.success(iBsCovenantService.getYiInfo());
- }
- /**
- * 获取企业协议详细信息
- */
- @ApiOperation("获取企业协议详细信息")
- @GetMapping("/{covenantId}")
- public AjaxResult<BsCovenantVo> getInfo(@PathVariable("covenantId") Long covenantId) {
- return AjaxResult.success(iBsCovenantService.queryById(covenantId));
- }
- /**
- * 新增企业协议
- */
- @ApiOperation("云学堂新增协议")
- @Log(title = "企业协议", businessType = BusinessType.INSERT)
- @PostMapping("/insert")
- public AjaxResult<Void> add(@RequestBody BsCovenantAddBo bo) {
- LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
- bo.setUserId(loginUser.getUser().getUserId());
- bo.setFormApp(1L);
- return toAjax(iBsCovenantService.insertYXTByAddBo(bo) ? 1 : 0);
- }
- @ApiOperation("云学堂新增乙方地址信息")
- @Log(title = "企业协议", businessType = BusinessType.INSERT)
- @PostMapping("/insertYiInfo")
- public AjaxResult<Void> insertYiInfo(@RequestBody TenantCovenantInfoAddBo bo) {
- return toAjax(iBsCovenantService.insertYiInfo(bo) ? 1 : 0);
- }
- /**
- * 新增企业协议
- */
- @ApiOperation("业务系统新增协议")
- @Log(title = "企业协议", businessType = BusinessType.INSERT)
- @PostMapping("/insertYw")
- public AjaxResult<Void> addYW(@RequestBody BsCovenantAddBo bo) {
- bo.setFormApp(3L);
- return toAjax(iBsCovenantService.insertYXTByAddBo(bo) ? 1 : 0);
- }
- /**
- * 修改企业协议
- */
- @ApiOperation("复制新增")
- @Log(title = "企业协议", businessType = BusinessType.UPDATE)
- @PostMapping("/copyAndInsert")
- public AjaxResult<Void> copyAndInsert(@RequestBody BsCovenantAddBo bo) {
- LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
- bo.setUserId(loginUser.getUser().getUserId());
- bo.setFormApp(1L);
- return toAjax(iBsCovenantService.insertYXTByAddBo(bo) ? 1 : 0);
- }
- /**
- * 修改企业协议
- */
- @ApiOperation("修改重提")
- @Log(title = "企业协议", businessType = BusinessType.UPDATE)
- @PostMapping("/updateCommit")
- public AjaxResult<Void> copyAndInsert(@RequestBody BsCovenantEditBo bo) {
- return toAjax(iBsCovenantService.updateByEditBo(bo) ? 1 : 0);
- }
- /**
- * 删除企业协议
- */
- @ApiOperation("协议取消")
- @Log(title = "企业协议", businessType = BusinessType.DELETE)
- @PostMapping("/cancelStatus")
- public AjaxResult<Void> cancelStatus(@RequestBody BsCovenantEditBo bo) {
- return toAjax(iBsCovenantService.deleteWithValidByIds(bo.getCovenantId()) ? 1 : 0);
- }
- /**
- * 删除企业协议
- */
- @ApiOperation("生成协议编号")
- @Log(title = "企业协议", businessType = BusinessType.DELETE)
- @GetMapping("/getCovenantNum")
- public AjaxResult<Void> getCovenantNum() {
- return AjaxResult.success(iBsCovenantService.getCovenantNum());
- }
- /**
- * 删除企业协议
- */
- @ApiOperation("判断当前业务类型是否有已知存在协议")
- @Log(title = "企业协议", businessType = BusinessType.DELETE)
- @PostMapping("/judgeBusiness")
- public AjaxResult judgeBusiness(@RequestParam("businessId") Long businessId) {
- Long userId = tokenService.getLoginUser(ServletUtils.getRequest()).getUser().getUserId();
- return AjaxResult.success(iBsCovenantService.getJudgeBusiness(businessId,userId));
- }
- @ApiOperation(value = "导出协议pdf培训服务证书")
- @GetMapping("/download")
- public AjaxResult download(@RequestParam("covenantId") Long covenantId) {
- return AjaxResult.success(iBsCovenantService.exportPdf(covenantId));
- }
- @ApiOperation(value = "云学堂判断当前选择甲方是否存在待审核或者申请终止审核")
- @GetMapping("/judgeExistYW")
- public AjaxResult judgeExistYW(@RequestParam("companyId") Long companyId) {
- return AjaxResult.success(iBsCovenantService.judgeExistYW(companyId));
- }
- /**
- * 删除企业协议
- */
- @ApiOperation("终止申请")
- @Log(title = "企业协议", businessType = BusinessType.DELETE)
- @PostMapping("/updateStopStatus")
- public AjaxResult<Void> updateStopStatus(@RequestBody BsCovenantEditBo bo) {
- return toAjax(iBsCovenantService.updateStopStatus(bo.getCovenantId()) ? 1 : 0);
- }
- /**
- * 删除企业协议
- */
- @ApiOperation("取消终止申请")
- @Log(title = "企业协议", businessType = BusinessType.DELETE)
- @PostMapping("/cancelStopStatus")
- public AjaxResult<Void> cancelStopStatus(@RequestBody BsCovenantEditBo bo) {
- return toAjax(iBsCovenantService.cancelStopStatus(bo.getCovenantId()) ? 1 : 0);
- }
- /**
- * 删除企业协议
- */
- @ApiOperation("协议审核")
- @Log(title = "企业协议", businessType = BusinessType.DELETE)
- @PostMapping("/updateCheckStatus")
- public AjaxResult updateCheckStatus(@RequestBody NoCheckInfo noCheckInfo) {
- LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
- return toAjax(iBsCovenantService.updateCheckStatus(noCheckInfo, loginUser.getUser().getUserId()) ? 1 : 0);
- }
- /**
- * 删除企业协议
- */
- @ApiOperation("终止审核")
- @Log(title = "企业协议", businessType = BusinessType.DELETE)
- @PostMapping("/updateStopCheck")
- public AjaxResult updateStopCheck(@RequestBody NoCheckInfo noCheckInfo) {
- LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
- return toAjax(iBsCovenantService.updateStopCheck(noCheckInfo, loginUser.getUser().getUserId()) ? 1 : 0);
- }
- /**
- * 删除企业协议
- */
- @ApiOperation("协议上传")
- @Log(title = "企业协议", businessType = BusinessType.DELETE)
- @PostMapping("/uploadImg")
- public AjaxResult uploadImg(@RequestBody BsCovenantEditBo bo) {
- return toAjax(iBsCovenantService.uploadImg(bo.getCovenantId(), bo.getPaths()) ? 1 : 0);
- }
- /**
- * 删除企业协议
- */
- @ApiOperation("协议上传确认生效")
- @Log(title = "企业协议", businessType = BusinessType.DELETE)
- @PostMapping("/confirmAssert")
- public AjaxResult confirmAssert(@RequestBody BsCovenantEditBo bo) {
- return toAjax(iBsCovenantService.confirmAssert(bo.getCovenantId()) ? 1 : 0);
- }
- /**
- * 删除企业协议
- */
- @ApiOperation("统计协议审核待审核数量")
- @Log(title = "企业协议", businessType = BusinessType.DELETE)
- @PostMapping("/countNoCheckNum")
- public AjaxResult countNoCheckNum() {
- Long userId = tokenService.getLoginUser(ServletUtils.getRequest()).getUser().getUserId();
- return AjaxResult.success(iBsCovenantService.countNoCheckNum(userId, 1L));
- }
- /**
- * 删除企业协议
- */
- @ApiOperation("统计终止审核待审核数量")
- @Log(title = "企业协议", businessType = BusinessType.DELETE)
- @PostMapping("/countStopNoCheckNum")
- public AjaxResult countStopNoCheckNum() {
- Long userId = tokenService.getLoginUser(ServletUtils.getRequest()).getUser().getUserId();
- return AjaxResult.success(iBsCovenantService.countStopNoCheckNum(userId, 1L));
- }
- @ApiOperation("统计协议上传数量")
- @Log(title = "企业协议", businessType = BusinessType.DELETE)
- @PostMapping("/countUploadImgNum")
- public AjaxResult countUploadImgNum() {
- Long userId = tokenService.getLoginUser(ServletUtils.getRequest()).getUser().getUserId();
- return AjaxResult.success(iBsCovenantService.countUploadImgNum(userId, 1L));
- }
- @ApiOperation("获取审核意见列表")
- @Log(title = "企业协议", businessType = BusinessType.DELETE)
- @GetMapping("/getCheckInfo")
- public TableDataInfo<CovenantCheckRecordVo> getCheckInfo(@RequestParam("covenantId") Long covenantId) {
- return getDataTable(iBsCovenantService.getNoCheckInfo(covenantId));
- }
- }
|