app版本接口

This commit is contained in:
huangzj
2023-04-10 11:19:39 +08:00
parent ee2457f2c1
commit 381f8ea690
20 changed files with 698 additions and 63 deletions

View File

@@ -0,0 +1,75 @@
package com.njcn.algorithm.controller.project;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.njcn.algorithm.pojo.param.CsEdDataAddParm;
import com.njcn.algorithm.pojo.param.CsEdDataAuditParm;
import com.njcn.algorithm.pojo.param.CsEdDataQueryParm;
import com.njcn.algorithm.pojo.vo.CsEdDataVO;
import com.njcn.algorithm.service.CsEdDataService;
import com.njcn.common.pojo.annotation.OperateInfo;
import com.njcn.common.pojo.enums.common.LogEnum;
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
import com.njcn.common.pojo.response.HttpResult;
import com.njcn.common.utils.HttpResultUtil;
import com.njcn.web.controller.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* Description:
* 接口文档访问地址http://serverIP:port/swagger-ui.html
* Date: 2023/4/4 9:02【需求编号】
*
* @author clam
* @version V1.0.0
*/
@Slf4j
@RestController
@RequestMapping("/edData")
@Api(tags = "app版本信息")
@AllArgsConstructor
public class CsEdDataController extends BaseController {
private final CsEdDataService csEdDataService;
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
@PostMapping("/addEdData")
@ApiOperation("新增app版本信息")
public HttpResult<Boolean> addEdData(@Validated CsEdDataAddParm csEdDataAddParm){
String methodDescribe = getMethodDescribe("addEdData");
boolean save = csEdDataService.addEdData (csEdDataAddParm);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, save, methodDescribe);
}
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
@PostMapping("/auditEdData")
@ApiOperation("修改/删除app版本信息")
public HttpResult<Boolean> auditEdData(@Validated CsEdDataAuditParm csEdDataAuditParm){
String methodDescribe = getMethodDescribe("auditEdData");
Boolean flag = csEdDataService.auditEdData(csEdDataAuditParm);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, flag, methodDescribe);
}
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
@PostMapping("/queryEdDataPage")
@ApiOperation("版本信息查询")
@ApiImplicitParam(name = "csEdDataQueryParm", value = "查询参数", required = true)
public HttpResult<IPage<CsEdDataVO>> queryEdDataPage(@Validated @RequestBody CsEdDataQueryParm csEdDataQueryParm){
String methodDescribe = getMethodDescribe("queryEdDataPage");
IPage<CsEdDataVO> page = csEdDataService.queryEdDataPage (csEdDataQueryParm);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, page, methodDescribe);
}
}

View File

@@ -1,16 +1,20 @@
package com.njcn.algorithm.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.njcn.algorithm.pojo.param.CsEdDataQueryParm;
import com.njcn.algorithm.pojo.po.CsEdDataPO;
import com.njcn.algorithm.pojo.vo.CsEdDataVO;
import org.apache.ibatis.annotations.Param;
/**
*
* Description:
* 接口文档访问地址http://serverIP:port/swagger-ui.html
* Date: 2023/4/3 19:12【需求编号】
* Date: 2023/4/7 11:29【需求编号】
*
* @author clam
* @version V1.0.0
*/
public interface CsEdDataMapper extends BaseMapper<CsEdDataPO> {
Page<CsEdDataVO> getPage(Page<CsEdDataVO> returnpage,@Param("csEdDataQueryParm") CsEdDataQueryParm csEdDataQueryParm);
}

View File

@@ -0,0 +1,16 @@
package com.njcn.algorithm.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.njcn.algorithm.pojo.po.CsEngineeringPO;
/**
*
* Description:
* 接口文档访问地址http://serverIP:port/swagger-ui.html
* Date: 2023/4/7 11:04【需求编号】
*
* @author clam
* @version V1.0.0
*/
public interface CsEngineeringMapper extends BaseMapper<CsEngineeringPO> {
}

View File

@@ -1,26 +1,47 @@
<?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.njcn.algorithm.mapper.CsEdDataMapper">
<resultMap id="BaseResultMap" type="com.njcn.algorithm.pojo.po.CsEdDataPO">
<!--@mbg.generated-->
<!--@Table cs_ed_data-->
<result column="id" jdbcType="VARCHAR" property="id" />
<result column="dev_type" jdbcType="VARCHAR" property="devType" />
<result column="version_no" jdbcType="VARCHAR" property="versionNo" />
<result column="version_agree" jdbcType="VARCHAR" property="versionAgree" />
<result column="version_date" jdbcType="TIMESTAMP" property="versionDate" />
<result column="describe" jdbcType="VARCHAR" property="describe" />
<result column="version_type" jdbcType="VARCHAR" property="versionType" />
<result column="status" jdbcType="INTEGER" property="status" />
<result column="file_path" jdbcType="VARCHAR" property="filePath" />
<result column="create_by" jdbcType="VARCHAR" property="createBy" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_by" jdbcType="VARCHAR" property="updateBy" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
id, dev_type, version_no, version_agree, version_date, `describe`, version_type,
`status`, file_path, create_by, create_time, update_by, update_time
</sql>
<resultMap id="BaseResultMap" type="com.njcn.algorithm.pojo.po.CsEdDataPO">
<!--@mbg.generated-->
<!--@Table cs_ed_data-->
<result column="id" jdbcType="VARCHAR" property="id"/>
<result column="dev_type" jdbcType="VARCHAR" property="devType"/>
<result column="version_no" jdbcType="VARCHAR" property="versionNo"/>
<result column="version_agreement" jdbcType="VARCHAR" property="versionAgreement"/>
<result column="version_date" jdbcType="TIMESTAMP" property="versionDate"/>
<result column="describe" jdbcType="VARCHAR" property="describe"/>
<result column="version_type" jdbcType="VARCHAR" property="versionType"/>
<result column="status" jdbcType="BOOLEAN" property="status"/>
<result column="file_path" jdbcType="VARCHAR" property="filePath"/>
<result column="create_by" jdbcType="VARCHAR" property="createBy"/>
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
<result column="update_by" jdbcType="VARCHAR" property="updateBy"/>
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
id, dev_type, version_no, version_agreement, version_date, `describe`, version_type,
`status`, file_path, create_by, create_time, update_by, update_time
</sql>
<select id="getPage" resultType="com.njcn.algorithm.pojo.vo.CsEdDataVO">
SELECT a.*,
b.code as devName
FROM cs_ed_data a
LEFT JOIN sys_dict_data b ON a.dev_type = b.id
WHERE
1 = 1
<if test="csEdDataQueryParm.versionStartDate != null and csEdDataQueryParm.versionStartDate != ''">
AND a.version_date &gt;= #{csEdDataQueryParm.versionStartDate }
</if>
<if test="csEdDataQueryParm.versionendDate != null and csEdDataQueryParm.versionendDate != ''">
AND a.version_date &lt;= #{csEdDataQueryParm.versionendDate }
</if>
<if test="csEdDataQueryParm.devName != null and csEdDataQueryParm.devName != ''">
AND b.CODE LIKE concat('%',#{csEdDataQueryParm.devName},'%')
</if>
<if test="csEdDataQueryParm.devType != null and csEdDataQueryParm.devType != ''">
AND a.dev_type = #{csEdDataQueryParm.devType}
</if>
</select>
</mapper>

View File

@@ -0,0 +1,24 @@
<?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.njcn.algorithm.mapper.CsEngineeringMapper">
<resultMap id="BaseResultMap" type="com.njcn.algorithm.pojo.po.CsEngineeringPO">
<!--@mbg.generated-->
<!--@Table cs_engineering-->
<id column="id" jdbcType="VARCHAR" property="id" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="user_id" jdbcType="VARCHAR" property="userId" />
<result column="province" jdbcType="VARCHAR" property="province" />
<result column="city" jdbcType="VARCHAR" property="city" />
<result column="description" jdbcType="VARCHAR" property="description" />
<result column="status" jdbcType="BOOLEAN" property="status" />
<result column="create_by" jdbcType="VARCHAR" property="createBy" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_by" jdbcType="VARCHAR" property="updateBy" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
id, `name`, user_id, province, city, description, `status`, create_by, create_time,
update_by, update_time
</sql>
</mapper>

View File

@@ -1,9 +1,14 @@
package com.njcn.algorithm.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.njcn.algorithm.pojo.param.CsEdDataAddParm;
import com.njcn.algorithm.pojo.param.CsEdDataAuditParm;
import com.njcn.algorithm.pojo.param.CsEdDataQueryParm;
import com.njcn.algorithm.pojo.po.CsEdDataPO;
import com.baomidou.mybatisplus.extension.service.IService;
/**
*
import com.njcn.algorithm.pojo.vo.CsEdDataVO;
/**
* Description:
* 接口文档访问地址http://serverIP:port/swagger-ui.html
* Date: 2023/4/3 19:12【需求编号】
@@ -11,7 +16,31 @@ import com.baomidou.mybatisplus.extension.service.IService;
* @author clam
* @version V1.0.0
*/
public interface CsEdDataService extends IService<CsEdDataPO>{
public interface CsEdDataService extends IService<CsEdDataPO> {
/**
* @Description: addEdData
* @Param: [csEdDataAddParm]
* @return: boolean
* @Author: clam
* @Date: 2023/4/7
*/
boolean addEdData(CsEdDataAddParm csEdDataAddParm);
/**
* @Description:
* @Param: [csEdDataAuditParm]
* @return: java.lang.Boolean
* @Author: clam
* @Date: 2023/4/7
*/
Boolean auditEdData(CsEdDataAuditParm csEdDataAuditParm);
/**
* @Description: queryEdDataPage
* @Param: [csEdDataQueryParm]
* @return: com.baomidou.mybatisplus.core.metadata.IPage<com.njcn.algorithm.pojo.vo.CsEdDataVO>
* @Author: clam
* @Date: 2023/4/7
*/
IPage<CsEdDataVO> queryEdDataPage(CsEdDataQueryParm csEdDataQueryParm);
}

View File

@@ -0,0 +1,17 @@
package com.njcn.algorithm.service;
import com.njcn.algorithm.pojo.po.CsEngineeringPO;
import com.baomidou.mybatisplus.extension.service.IService;
/**
*
* Description:
* 接口文档访问地址http://serverIP:port/swagger-ui.html
* Date: 2023/4/7 11:04【需求编号】
*
* @author clam
* @version V1.0.0
*/
public interface CsEngineeringService extends IService<CsEngineeringPO>{
}

View File

@@ -1,12 +1,25 @@
package com.njcn.algorithm.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.njcn.algorithm.mapper.CsEdDataMapper;
import com.njcn.algorithm.pojo.param.CsEdDataAddParm;
import com.njcn.algorithm.pojo.param.CsEdDataAuditParm;
import com.njcn.algorithm.pojo.param.CsEdDataQueryParm;
import com.njcn.algorithm.pojo.po.CsEdDataPO;
import com.njcn.algorithm.pojo.vo.CsEdDataVO;
import com.njcn.algorithm.service.CsEdDataService;
import com.njcn.oss.constant.OssPath;
import com.njcn.oss.utils.FileStorageUtil;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Objects;
/**
*
* Description:
* 接口文档访问地址http://serverIP:port/swagger-ui.html
* Date: 2023/4/3 19:12【需求编号】
@@ -15,6 +28,42 @@ import org.springframework.stereotype.Service;
* @version V1.0.0
*/
@Service
public class CsEdDataServiceImpl extends ServiceImpl<CsEdDataMapper, CsEdDataPO> implements CsEdDataService{
@RequiredArgsConstructor
public class CsEdDataServiceImpl extends ServiceImpl<CsEdDataMapper, CsEdDataPO> implements CsEdDataService {
private final FileStorageUtil fileStorageUtil;
@Override
@Transactional(rollbackFor = {Exception.class})
public boolean addEdData(CsEdDataAddParm csEdDataAddParm) {
CsEdDataPO csEdDataPO = new CsEdDataPO ();
BeanUtils.copyProperties (csEdDataAddParm, csEdDataPO);
String filePath = fileStorageUtil.uploadMultipart (csEdDataAddParm.getFile (), OssPath.EDDATA);
csEdDataPO.setFilePath (filePath);
csEdDataPO.setStatus ("1");
boolean save = this.save (csEdDataPO);
return save;
}
@Override
public Boolean auditEdData(CsEdDataAuditParm csEdDataAuditParm) {
CsEdDataPO csEdDataPO = new CsEdDataPO ();
BeanUtils.copyProperties (csEdDataAuditParm, csEdDataPO);
if(!Objects.isNull (csEdDataAuditParm.getFile ())){
String filePath = fileStorageUtil.uploadMultipart (csEdDataAuditParm.getFile (), OssPath.EDDATA);
csEdDataPO.setFilePath (filePath);
}
boolean b = this.updateById (csEdDataPO);
return b;
}
@Override
public IPage<CsEdDataVO> queryEdDataPage(CsEdDataQueryParm csEdDataQueryParm) {
Page<CsEdDataVO> returnpage = new Page<> (csEdDataQueryParm.getCurrentPage ( ), csEdDataQueryParm.getPageSize ( ));
returnpage = this.getBaseMapper ().getPage(returnpage,csEdDataQueryParm);
return returnpage;
}
}

View File

@@ -0,0 +1,20 @@
package com.njcn.algorithm.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.njcn.algorithm.mapper.CsEngineeringMapper;
import com.njcn.algorithm.pojo.po.CsEngineeringPO;
import com.njcn.algorithm.service.CsEngineeringService;
import org.springframework.stereotype.Service;
/**
*
* Description:
* 接口文档访问地址http://serverIP:port/swagger-ui.html
* Date: 2023/4/7 11:04【需求编号】
*
* @author clam
* @version V1.0.0
*/
@Service
public class CsEngineeringServiceImpl extends ServiceImpl<CsEngineeringMapper, CsEngineeringPO> implements CsEngineeringService{
}

View File

@@ -5,17 +5,20 @@ import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.njcn.algorithm.enums.AlgorithmResponseEnum;
import com.njcn.algorithm.mapper.CsEquipmentDeliveryMapper;
import com.njcn.algorithm.pojo.param.CsEquipmentDeliveryAddParm;
import com.njcn.algorithm.pojo.param.ProjectEquipmentQueryParm;
import com.njcn.algorithm.pojo.po.CsEquipmentDeliveryPO;
import com.njcn.algorithm.pojo.vo.AppProjectVO;
import com.njcn.algorithm.pojo.vo.CsEquipmentDeliveryVO;
import com.njcn.algorithm.pojo.vo.ProjectEquipmentVO;
import com.njcn.algorithm.service.CsEquipmentDeliveryService;
import com.njcn.common.pojo.exception.BusinessException;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import java.util.Objects;
/**
*
* Description:
@@ -30,6 +33,10 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliv
@Override
public Boolean save(CsEquipmentDeliveryAddParm csEquipmentDeliveryAddParm) {
CsEquipmentDeliveryPO po = this.queryEquipmentPOByndid (csEquipmentDeliveryAddParm.getNdid ( ));
if(!Objects.isNull (po)){
throw new BusinessException (AlgorithmResponseEnum.NDID_ERROR);
}
CsEquipmentDeliveryPO csEquipmentDeliveryPO = new CsEquipmentDeliveryPO();
BeanUtils.copyProperties (csEquipmentDeliveryAddParm,csEquipmentDeliveryPO);
@@ -50,14 +57,21 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliv
@Override
public CsEquipmentDeliveryVO queryEquipmentByndid(String ndid) {
CsEquipmentDeliveryVO result = new CsEquipmentDeliveryVO();
QueryWrapper<CsEquipmentDeliveryPO> wrapper = new QueryWrapper();
wrapper.eq ("ndid", ndid);
CsEquipmentDeliveryPO csEquipmentDeliveryPO = this.baseMapper.selectOne (wrapper);
CsEquipmentDeliveryPO csEquipmentDeliveryPO = queryEquipmentPOByndid (ndid);
if(Objects.isNull (csEquipmentDeliveryPO)){
return result;
}
BeanUtils.copyProperties (csEquipmentDeliveryPO,result);
return result;
}
public CsEquipmentDeliveryPO queryEquipmentPOByndid(String ndid) {
QueryWrapper<CsEquipmentDeliveryPO> wrapper = new QueryWrapper();
wrapper.eq ("ndid", ndid);
CsEquipmentDeliveryPO csEquipmentDeliveryPO = this.baseMapper.selectOne (wrapper);
return csEquipmentDeliveryPO;
}
@Override
@Override
public IPage<ProjectEquipmentVO> queryEquipmentByProject(ProjectEquipmentQueryParm projectEquipmentQueryParm) {
Page<ProjectEquipmentVO> returnpage = new Page<> (projectEquipmentQueryParm.getCurrentPage ( ), projectEquipmentQueryParm.getPageSize ( ));
@@ -65,4 +79,5 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliv
Page<ProjectEquipmentVO> list = this.baseMapper.queryProjectEquipmentVO(returnpage,projectEquipmentQueryParm);
return list;
}
}

View File

@@ -25,6 +25,7 @@ import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
/**
@@ -50,20 +51,24 @@ public class CsFeedbackServiceImpl extends ServiceImpl<CsFeedbackMapper, CsFeedb
BeanUtils.copyProperties (csFeedbackAddParm, csFeedbackPO);
csFeedbackPO.setStatus ("1");
boolean save = this.save (csFeedbackPO);
List<CsFilePathPO> csFilePathPOS= new ArrayList<> ();
for (int i = 0; i < csFeedbackAddParm.getFiles ( ).length; i++) {
boolean flag= true;
if(Objects.isNull (csFeedbackAddParm.getFiles ( ))){
List<CsFilePathPO> csFilePathPOS= new ArrayList<> ();
for (int i = 0; i < csFeedbackAddParm.getFiles ( ).length; i++) {
CsFilePathPO csFilePathPO = new CsFilePathPO ( );
csFilePathPO.setId (csFeedbackPO.getId ());
String filePath = fileStorageUtil.uploadMultipart (csFeedbackAddParm.getFiles ( )[i], OssPath.FEEDBACK);
csFilePathPO.setFileName (csFeedbackAddParm.getFiles ( )[i].getOriginalFilename ( ));
csFilePathPO.setFilePath (filePath);
csFilePathPO.setStatus ("1");
csFilePathPOS.add (csFilePathPO);
CsFilePathPO csFilePathPO = new CsFilePathPO ( );
csFilePathPO.setId (csFeedbackPO.getId ());
String filePath = fileStorageUtil.uploadMultipart (csFeedbackAddParm.getFiles ( )[i], OssPath.FEEDBACK);
csFilePathPO.setFileName (csFeedbackAddParm.getFiles ( )[i].getOriginalFilename ( ));
csFilePathPO.setFilePath (filePath);
csFilePathPO.setStatus ("1");
csFilePathPOS.add (csFilePathPO);
}
flag = csFilePathService.saveBatch (csFilePathPOS);
}
boolean b = csFilePathService.saveBatch (csFilePathPOS);
return save&&b;
return save&&flag;
}
@Override
@@ -101,7 +106,9 @@ public class CsFeedbackServiceImpl extends ServiceImpl<CsFeedbackMapper, CsFeedb
QueryWrapper<CsFilePathPO> queryWrapper = new QueryWrapper();
queryWrapper.eq ("id", id).eq ("status", "1");
List<CsFilePathPO> list = csFilePathService.list (queryWrapper);
List<String> collect = list.stream ( ).map (CsFilePathPO::getFilePath).collect (Collectors.toList ( ));
List<String> collect = list.stream ( ).map (temp->{
return fileStorageUtil.getFileUrl (temp.getFilePath ());
}).collect (Collectors.toList ( ));
csFeedbackDetailVO.setImageUrls (collect);
QueryWrapper<CsFeedbackChatPO> csFeedbackChatPOQueryWrapper = new QueryWrapper();
csFeedbackChatPOQueryWrapper.eq ("id", id).eq ("status", "1").orderByAsc ("create_time");