安全证书
This commit is contained in:
parent
c58aa96c9f
commit
3a0016321e
|
|
@ -71,7 +71,7 @@ public class MaDevQcController extends BaseController {
|
||||||
@ApiOperation(value = "删除装备质检")
|
@ApiOperation(value = "删除装备质检")
|
||||||
@PostMapping("/deleteById")
|
@PostMapping("/deleteById")
|
||||||
public AjaxResult deleteById(@RequestBody MaDevQc maDevQc) {
|
public AjaxResult deleteById(@RequestBody MaDevQc maDevQc) {
|
||||||
if (maDevQc == null || maDevQc.getId() == null) {
|
if (maDevQc == null || maDevQc.getMaId() == null) {
|
||||||
return AjaxResult.error(HttpCodeEnum.TO_PARAM_NULL.getCode(), HttpCodeEnum.TO_PARAM_NULL.getMsg());
|
return AjaxResult.error(HttpCodeEnum.TO_PARAM_NULL.getCode(), HttpCodeEnum.TO_PARAM_NULL.getMsg());
|
||||||
}
|
}
|
||||||
Integer i = maDevQcService.deleteById(maDevQc);
|
Integer i = maDevQcService.deleteById(maDevQc);
|
||||||
|
|
|
||||||
|
|
@ -4,24 +4,25 @@ import com.bonus.common.core.web.controller.BaseController;
|
||||||
import com.bonus.common.core.web.domain.AjaxResult;
|
import com.bonus.common.core.web.domain.AjaxResult;
|
||||||
import com.bonus.material.device.domain.SafeBookInfo;
|
import com.bonus.material.device.domain.SafeBookInfo;
|
||||||
import com.bonus.material.device.service.SafeBookService;
|
import com.bonus.material.device.service.SafeBookService;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author:liang.chao
|
* @Author:liang.chao
|
||||||
* @Date:2024/12/4 - 16:24
|
* @Date:2024/12/4 - 16:24
|
||||||
*/
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/safeBook")
|
||||||
|
@Api(value = "安全证书",tags = "安全证书管理")
|
||||||
public class SafeBookController extends BaseController {
|
public class SafeBookController extends BaseController {
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private SafeBookService safeBookService;
|
private SafeBookService safeBookService;
|
||||||
|
|
||||||
@ApiOperation(value = "查询安全证书")
|
@ApiOperation(value = "安全证书列表")
|
||||||
@GetMapping("/getSafeBookByMaId")
|
@GetMapping("/getSafeBookByMaId")
|
||||||
public AjaxResult getSafeBookByMaId(SafeBookInfo safeBookInfo) {
|
public AjaxResult getSafeBookByMaId(SafeBookInfo safeBookInfo) {
|
||||||
startPage();
|
startPage();
|
||||||
|
|
@ -39,6 +40,16 @@ public class SafeBookController extends BaseController {
|
||||||
return AjaxResult.error("新增失败");
|
return AjaxResult.error("新增失败");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ApiOperation(value = "修改安全证书")
|
||||||
|
@PostMapping("/editSafeBook")
|
||||||
|
public AjaxResult editSafeBook(@RequestBody SafeBookInfo safeBookInfo) {
|
||||||
|
Integer i = safeBookService.editSafeBook(safeBookInfo);
|
||||||
|
if (i > 0) {
|
||||||
|
return AjaxResult.success("修改成功");
|
||||||
|
} else {
|
||||||
|
return AjaxResult.error("修改失败");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@ApiOperation(value = "删除安全证书")
|
@ApiOperation(value = "删除安全证书")
|
||||||
|
|
|
||||||
|
|
@ -40,4 +40,16 @@ public class SafeBookInfo {
|
||||||
|
|
||||||
@ApiModelProperty(value = "安全证书附件")
|
@ApiModelProperty(value = "安全证书附件")
|
||||||
private List<BmFileInfo> fileInfoList;
|
private List<BmFileInfo> fileInfoList;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "装备名称")
|
||||||
|
private String deviceName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "装备编码")
|
||||||
|
private String deviceCode;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "文件地址")
|
||||||
|
private String url;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "上传人")
|
||||||
|
private String nickName;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@ public interface MaDevQcMapper {
|
||||||
* @param id
|
* @param id
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
int deleteDevQcById(Integer id);
|
int deleteDevQcById(Integer maId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询月任务数
|
* 查询月任务数
|
||||||
|
|
|
||||||
|
|
@ -18,4 +18,6 @@ public interface SafeBookMapper {
|
||||||
String selectTaskNumByMonth(@Param("date") Date nowDate);
|
String selectTaskNumByMonth(@Param("date") Date nowDate);
|
||||||
|
|
||||||
Integer delSafeBook(SafeBookInfo safeBookInfo);
|
Integer delSafeBook(SafeBookInfo safeBookInfo);
|
||||||
|
|
||||||
|
Integer updateTime(Integer maId);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -15,4 +15,6 @@ public interface SafeBookService {
|
||||||
Integer addSafeBook(SafeBookInfo safeBookInfo);
|
Integer addSafeBook(SafeBookInfo safeBookInfo);
|
||||||
|
|
||||||
Integer delSafeBook(SafeBookInfo safeBookInfo);
|
Integer delSafeBook(SafeBookInfo safeBookInfo);
|
||||||
|
|
||||||
|
Integer editSafeBook(SafeBookInfo safeBookInfo);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -112,9 +112,9 @@ public class MaDevQcServiceImpl implements MaDevQcService {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Integer deleteById(MaDevQc maDevQc) {
|
public Integer deleteById(MaDevQc maDevQc) {
|
||||||
int i = maDevQcMapper.deleteDevQcById(maDevQc.getId());
|
int i = maDevQcMapper.deleteDevQcById(maDevQc.getMaId());
|
||||||
if (i > 0) {
|
if (i > 0) {
|
||||||
bmFileInfoMapper.deleteBmFileInfoByMaId(maDevQc.getId(),4);
|
bmFileInfoMapper.deleteBmFileInfoByMaId(maDevQc.getMaId(),4);
|
||||||
}
|
}
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,7 @@ import com.bonus.material.device.service.SafeBookService;
|
||||||
import org.apache.commons.collections4.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
|
@ -33,6 +34,7 @@ public class SafeBookServiceImpl implements SafeBookService {
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private DevInfoMapper devInfoMapper;
|
private DevInfoMapper devInfoMapper;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<SafeBookInfo> getSafeBookByMaId(SafeBookInfo safeBookInfo) {
|
public List<SafeBookInfo> getSafeBookByMaId(SafeBookInfo safeBookInfo) {
|
||||||
return safeBookMapper.getSafeBookByMaId(safeBookInfo);
|
return safeBookMapper.getSafeBookByMaId(safeBookInfo);
|
||||||
|
|
@ -44,10 +46,10 @@ public class SafeBookServiceImpl implements SafeBookService {
|
||||||
safeBookInfo.setUploadPerson(SecurityUtils.getLoginUser().getUserid());
|
safeBookInfo.setUploadPerson(SecurityUtils.getLoginUser().getUserid());
|
||||||
Integer i = safeBookMapper.addSafeBook(safeBookInfo);
|
Integer i = safeBookMapper.addSafeBook(safeBookInfo);
|
||||||
devInfoMapper.updateDevInfoIsSafeBook(safeBookInfo);
|
devInfoMapper.updateDevInfoIsSafeBook(safeBookInfo);
|
||||||
if (i > 0){
|
if (i > 0) {
|
||||||
if (CollectionUtils.isNotEmpty(safeBookInfo.getFileInfoList())) {
|
if (CollectionUtils.isNotEmpty(safeBookInfo.getFileInfoList())) {
|
||||||
for (BmFileInfo bmFileInfo : safeBookInfo.getFileInfoList()) {
|
for (BmFileInfo bmFileInfo : safeBookInfo.getFileInfoList()) {
|
||||||
bmFileInfo.setModelId(safeBookInfo.getId().longValue());
|
bmFileInfo.setModelId(Long.valueOf(safeBookInfo.getMaId()));
|
||||||
bmFileInfo.setTaskType(MaterialConstants.MATERIAL_FILE_TYPE_CODE);
|
bmFileInfo.setTaskType(MaterialConstants.MATERIAL_FILE_TYPE_CODE);
|
||||||
// 安全证书附件
|
// 安全证书附件
|
||||||
bmFileInfo.setFileType(5L);
|
bmFileInfo.setFileType(5L);
|
||||||
|
|
@ -62,8 +64,27 @@ public class SafeBookServiceImpl implements SafeBookService {
|
||||||
@Override
|
@Override
|
||||||
public Integer delSafeBook(SafeBookInfo safeBookInfo) {
|
public Integer delSafeBook(SafeBookInfo safeBookInfo) {
|
||||||
Integer i = safeBookMapper.delSafeBook(safeBookInfo);
|
Integer i = safeBookMapper.delSafeBook(safeBookInfo);
|
||||||
if (i > 0){
|
if (i > 0) {
|
||||||
bmFileInfoMapper.deleteBmFileInfoByMaId(safeBookInfo.getMaId(),5);
|
bmFileInfoMapper.deleteBmFileInfoByMaId(safeBookInfo.getMaId(), 5);
|
||||||
|
}
|
||||||
|
return i;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Integer editSafeBook(SafeBookInfo safeBookInfo) {
|
||||||
|
safeBookMapper.updateTime(safeBookInfo.getMaId());
|
||||||
|
Integer i = bmFileInfoMapper.deleteBmFileInfoByMaId(safeBookInfo.getMaId(), 5);
|
||||||
|
if (i > 0) {
|
||||||
|
if (CollectionUtils.isNotEmpty(safeBookInfo.getFileInfoList())) {
|
||||||
|
for (BmFileInfo bmFileInfo : safeBookInfo.getFileInfoList()) {
|
||||||
|
bmFileInfo.setModelId(Long.valueOf(safeBookInfo.getMaId()));
|
||||||
|
bmFileInfo.setTaskType(MaterialConstants.MATERIAL_FILE_TYPE_CODE);
|
||||||
|
// 安全证书附件
|
||||||
|
bmFileInfo.setFileType(5L);
|
||||||
|
bmFileInfo.setCreateBy(SecurityUtils.getLoginUser().getUserid().toString());
|
||||||
|
bmFileInfoMapper.insertBmFileInfo(bmFileInfo);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
|
@ -84,7 +105,7 @@ public class SafeBookServiceImpl implements SafeBookService {
|
||||||
} else {
|
} else {
|
||||||
taskNum = "0001";
|
taskNum = "0001";
|
||||||
}
|
}
|
||||||
return format + "-" + taskNum;
|
return "AQZS" + format + "-" + taskNum;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<mapper namespace="com.bonus.material.device.mapper.MaDevQcMapper">
|
<mapper namespace="com.bonus.material.device.mapper.MaDevQcMapper">
|
||||||
|
|
||||||
<delete id="deleteDevQcById">
|
<delete id="deleteDevQcById">
|
||||||
delete from ma_dev_qc where id = #{id}
|
delete from ma_dev_qc where ma_id = #{maId}
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
<insert id="insertDevQc" useGeneratedKeys="true" keyProperty="id">
|
<insert id="insertDevQc" useGeneratedKeys="true" keyProperty="id">
|
||||||
|
|
@ -64,7 +64,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="qcUser != null and qcUser != ''">
|
<if test="qcUser != null and qcUser != ''">
|
||||||
and m1.qc_user like concat('%',#{qcUser},'%')
|
and m1.qc_user like concat('%',#{qcUser},'%')
|
||||||
</if>
|
</if>
|
||||||
<if test="minNum != null and maxNum != ''">
|
<if test="minNum != null and maxNum != null">
|
||||||
and latest_qc.num BETWEEN #{minNum} AND #{maxNum}
|
and latest_qc.num BETWEEN #{minNum} AND #{maxNum}
|
||||||
</if>
|
</if>
|
||||||
<if test="qcCode != null and qcCode != ''">
|
<if test="qcCode != null and qcCode != ''">
|
||||||
|
|
|
||||||
|
|
@ -7,24 +7,40 @@
|
||||||
insert into safe_book(code,ma_id,upload_person,create_time)
|
insert into safe_book(code,ma_id,upload_person,create_time)
|
||||||
values(#{code},#{maId},#{uploadPerson},now())
|
values(#{code},#{maId},#{uploadPerson},now())
|
||||||
</insert>
|
</insert>
|
||||||
|
<update id="updateTime">
|
||||||
|
update safe_book set update_time = now() where ma_id = #{maId}
|
||||||
|
</update>
|
||||||
|
|
||||||
<delete id="delSafeBook">
|
<delete id="delSafeBook">
|
||||||
delete from safe_book where id = #{id}
|
delete from safe_book where ma_id = #{maId}
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
<select id="getSafeBookByMaId" resultType="com.bonus.material.device.domain.SafeBookInfo">
|
<select id="getSafeBookByMaId" resultType="com.bonus.material.device.domain.SafeBookInfo">
|
||||||
select id,code,ma_id,url,upload_person,create_time,update_time from safe_book where ma_id = #{maId}
|
SELECT
|
||||||
|
sb.*,
|
||||||
|
su.nick_name,
|
||||||
|
mdi.device_name,
|
||||||
|
mdi.CODE AS deviceCode,
|
||||||
|
bfi.url
|
||||||
|
FROM
|
||||||
|
safe_book sb
|
||||||
|
LEFT JOIN ma_dev_info mdi ON sb.ma_id = mdi.ma_id
|
||||||
|
LEFT JOIN bm_file_info bfi ON bfi.model_id = sb.ma_id
|
||||||
|
LEFT JOIN sys_user su on sb.upload_person = su.user_id
|
||||||
|
WHERE
|
||||||
|
bfi.task_type = 17
|
||||||
|
AND bfi.file_type = 5
|
||||||
<if test="code != null and code != ''">
|
<if test="code != null and code != ''">
|
||||||
and code like concat('%',#{code},'%')
|
and mdi.code like concat('%',#{code},'%')
|
||||||
</if>
|
</if>
|
||||||
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
|
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
|
||||||
AND create_time BETWEEN CONCAT(#{startTime}, ' 00:00:00') AND CONCAT(#{endTime}, ' 23:59:59')
|
AND sb.create_time BETWEEN CONCAT(#{startTime}, ' 00:00:00') AND CONCAT(#{endTime}, ' 23:59:59')
|
||||||
</if>
|
</if>
|
||||||
order by create_time desc
|
order by create_time desc
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectTaskNumByMonth" resultType="java.lang.String">
|
<select id="selectTaskNumByMonth" resultType="java.lang.String">
|
||||||
SELECT SUBSTRING(lease_code, - 4) as code
|
SELECT SUBSTRING(code, - 4) as code
|
||||||
FROM safe_book
|
FROM safe_book
|
||||||
WHERE DATE_FORMAT(create_time, '%y%m') = DATE_FORMAT(#{date}, '%y%m')
|
WHERE DATE_FORMAT(create_time, '%y%m') = DATE_FORMAT(#{date}, '%y%m')
|
||||||
ORDER BY create_time DESC LIMIT 1
|
ORDER BY create_time DESC LIMIT 1
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue