Merge remote-tracking branch 'origin/ah-simple-test' into ah-simple-test
This commit is contained in:
commit
c9e088548d
|
|
@ -213,6 +213,17 @@ public class DevMergeController extends BaseController {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "装备台账-删除增单个设备草稿")
|
||||||
|
@PostMapping("/delDeviceByMaIds")
|
||||||
|
public AjaxResult delDeviceByMaIds(@RequestBody Long[] maIds) {
|
||||||
|
try {
|
||||||
|
return toAjax(service.deleteDevInfoByMaIds(maIds));
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error("报错啦", e);
|
||||||
|
return AjaxResult.error("调用异常,请联系管理员");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 提交设备台账
|
* 提交设备台账
|
||||||
|
|
|
||||||
|
|
@ -325,5 +325,7 @@ public interface DevInfoMapper {
|
||||||
DevInfoVo selectToolByMaId(Long maId);
|
DevInfoVo selectToolByMaId(Long maId);
|
||||||
|
|
||||||
DevInfo getMaStatusByToolId(@Param("id") Long id, @Param("num") Integer num);
|
DevInfo getMaStatusByToolId(@Param("id") Long id, @Param("num") Integer num);
|
||||||
|
|
||||||
|
int delMaApplyDetails(@Param("maIds") Long[] maIds);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -88,4 +88,12 @@ public interface DevMergeService {
|
||||||
* @return Map<装备类型名称, 特征项列表>
|
* @return Map<装备类型名称, 特征项列表>
|
||||||
*/
|
*/
|
||||||
Map<String, List<EquipmentProperty>> getAllTypePropertiesMap();
|
Map<String, List<EquipmentProperty>> getAllTypePropertiesMap();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除设备信息
|
||||||
|
*
|
||||||
|
* @param maIds 需要删除的设备信息主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int deleteDevInfoByMaIds(Long[] maIds);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -492,13 +492,45 @@ public class DevMergeServiceImpl implements DevMergeService {
|
||||||
|
|
||||||
// 4.4 校验日期格式(若框架未自动处理,可添加)
|
// 4.4 校验日期格式(若框架未自动处理,可添加)
|
||||||
// 示例:校验productionDate是否为有效日期(根据实际需求调整)
|
// 示例:校验productionDate是否为有效日期(根据实际需求调整)
|
||||||
LocalDate productionDate = item.getProductionDate().toInstant()
|
Date prodDate = item.getProductionDate();
|
||||||
.atZone(ZoneId.systemDefault()).toLocalDate();
|
Date purDate = item.getPurchaseDate();
|
||||||
LocalDate purchaseDate = item.getPurchaseDate().toInstant()
|
|
||||||
.atZone(ZoneId.systemDefault()).toLocalDate();
|
if (prodDate != null && purDate != null) {
|
||||||
if (productionDate.isAfter(purchaseDate)) {
|
LocalDate productionDate = prodDate.toInstant()
|
||||||
rowError.append("生产日期不能晚于采购日期;");
|
.atZone(ZoneId.systemDefault())
|
||||||
|
.toLocalDate();
|
||||||
|
LocalDate purchaseDate = purDate.toInstant()
|
||||||
|
.atZone(ZoneId.systemDefault())
|
||||||
|
.toLocalDate();
|
||||||
|
|
||||||
|
if (productionDate.isAfter(purchaseDate)) {
|
||||||
|
rowError.append("生产日期不能晚于采购日期;");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//校验装备名称、规格型号、资产原值、生产厂家、下次维保日期、最大使用年限、计数单位等字段必填
|
||||||
|
if (StringUtils.isBlank(item.getEquipmentName())){
|
||||||
|
rowError.append("装备名称不能为空;");
|
||||||
|
}
|
||||||
|
if (StringUtils.isBlank(item.getSpecification())){
|
||||||
|
rowError.append("规格型号不能为空;");
|
||||||
|
}
|
||||||
|
if (ObjectUtil.isEmpty(item.getOriginalValue())){
|
||||||
|
rowError.append("资产原值不能为空;");
|
||||||
|
}
|
||||||
|
if (StringUtils.isBlank(item.getManufacturer())){
|
||||||
|
rowError.append("生产厂家不能为空;");
|
||||||
|
}
|
||||||
|
if (item.getNextMaintenanceDate() == null) {
|
||||||
|
rowError.append("下次维保日期不能为空;");
|
||||||
|
}
|
||||||
|
if (StringUtils.isBlank(item.getUnit())){
|
||||||
|
rowError.append("计数单位不能为空;");
|
||||||
|
}
|
||||||
|
if (ObjectUtil.isEmpty(item.getMaxServiceYears())){
|
||||||
|
rowError.append("最大使用年限不能为空;");
|
||||||
|
}
|
||||||
|
|
||||||
Integer typeId = devMergeMapper.getTypeId(item.getProfession());
|
Integer typeId = devMergeMapper.getTypeId(item.getProfession());
|
||||||
if (ObjectUtil.isEmpty(typeId)) {
|
if (ObjectUtil.isEmpty(typeId)) {
|
||||||
rowError.append("请选择类别");
|
rowError.append("请选择类别");
|
||||||
|
|
@ -1163,6 +1195,20 @@ public class DevMergeServiceImpl implements DevMergeService {
|
||||||
return typePropertiesMap;
|
return typePropertiesMap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除设备信息
|
||||||
|
*
|
||||||
|
* @param maIds 需要删除的设备信息主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public int deleteDevInfoByMaIds(Long[] maIds) {
|
||||||
|
devInfoMapper.batchDeleteDevInfoProperties(maIds);
|
||||||
|
devInfoMapper.deleteDevInfoByMaIds(maIds);
|
||||||
|
return devInfoMapper.delMaApplyDetails(maIds);
|
||||||
|
}
|
||||||
|
|
||||||
private boolean isCoreFieldHasValue(EquipmentImportDTO item) {
|
private boolean isCoreFieldHasValue(EquipmentImportDTO item) {
|
||||||
return StringUtils.hasText(item.getEquipmentName())
|
return StringUtils.hasText(item.getEquipmentName())
|
||||||
|| StringUtils.hasText(item.getSpecification())
|
|| StringUtils.hasText(item.getSpecification())
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ package com.bonus.material.repair.controller;
|
||||||
|
|
||||||
import com.bonus.common.core.web.controller.BaseController;
|
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.common.core.web.page.TableDataInfo;
|
||||||
import com.bonus.material.devchange.domain.CsDeviceInfo;
|
import com.bonus.material.devchange.domain.CsDeviceInfo;
|
||||||
import com.bonus.material.devchange.domain.CsDeviceVo;
|
import com.bonus.material.devchange.domain.CsDeviceVo;
|
||||||
import com.bonus.material.repair.domain.ToBeRepair;
|
import com.bonus.material.repair.domain.ToBeRepair;
|
||||||
|
|
@ -33,10 +34,11 @@ public class RepairController extends BaseController {
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "获取待修工具和装备列表")
|
@ApiOperation(value = "获取待修工具和装备列表")
|
||||||
@GetMapping("/getToBeRepairList")
|
@GetMapping("/getToBeRepairList")
|
||||||
public AjaxResult list(ToBeRepair bean)
|
public TableDataInfo list(ToBeRepair bean)
|
||||||
{
|
{
|
||||||
|
startPage();
|
||||||
List<ToBeRepair> list = service.getToBeRepairList(bean);
|
List<ToBeRepair> list = service.getToBeRepairList(bean);
|
||||||
return AjaxResult.success(list);
|
return getDataTable(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -693,6 +693,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
#{maId}
|
#{maId}
|
||||||
</foreach>
|
</foreach>
|
||||||
</delete>
|
</delete>
|
||||||
|
<delete id="delMaApplyDetails">
|
||||||
|
delete from ma_apply_details where dev_id in
|
||||||
|
<foreach item="maId" collection="maIds" open="(" separator="," close=")">
|
||||||
|
#{maId}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
|
||||||
<insert id="insertDevInfoProperties">
|
<insert id="insertDevInfoProperties">
|
||||||
insert into
|
insert into
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue