fix: 优化过鱼设施填报逻辑
This commit is contained in:
parent
10946f8476
commit
d040297adb
@ -54,4 +54,6 @@ public class SwaggerConfig {
|
||||
.packagesToScan("com.yfd.platform.env.controller")
|
||||
.build();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -78,7 +78,7 @@ public class FishDraftDataController {
|
||||
|
||||
@GetMapping("/getByApprovalId")
|
||||
@Operation(summary = "根据审批批次ID查询")
|
||||
public ResponseResult getByApprovalId(@RequestParam Long approvalId) {
|
||||
public ResponseResult getByApprovalId(@RequestParam String approvalId) {
|
||||
List<FishDraftData> list = fishDraftDataService.getByApprovalId(approvalId);
|
||||
return ResponseResult.successData(list);
|
||||
}
|
||||
@ -113,7 +113,7 @@ public class FishDraftDataController {
|
||||
|
||||
@PostMapping("/removeDraft")
|
||||
@Operation(summary = "删除草稿(软删除)")
|
||||
public ResponseResult removeDraft(@RequestParam Long id,
|
||||
public ResponseResult removeDraft(@RequestParam String id,
|
||||
@RequestParam String operatorId) {
|
||||
boolean result = fishDraftDataService.removeDraft(id, operatorId);
|
||||
return result ? ResponseResult.success("删除成功") : ResponseResult.error("删除失败");
|
||||
@ -121,7 +121,7 @@ public class FishDraftDataController {
|
||||
|
||||
@PostMapping("/submitDraft")
|
||||
@Operation(summary = "提交草稿")
|
||||
public ResponseResult submitDraft(@RequestParam Long id,
|
||||
public ResponseResult submitDraft(@RequestParam String id,
|
||||
@RequestParam String operatorId) {
|
||||
boolean result = fishDraftDataService.submitDraft(id, operatorId);
|
||||
return result ? ResponseResult.success("提交成功") : ResponseResult.error("提交失败");
|
||||
@ -129,7 +129,7 @@ public class FishDraftDataController {
|
||||
|
||||
@PostMapping("/submitDrafts")
|
||||
@Operation(summary = "批量提交草稿")
|
||||
public ResponseResult submitDrafts(@RequestBody List<Long> ids,
|
||||
public ResponseResult submitDrafts(@RequestBody List<String> ids,
|
||||
@RequestParam String operatorId) {
|
||||
boolean result = fishDraftDataService.submitDrafts(ids, operatorId);
|
||||
return result ? ResponseResult.success("提交成功") : ResponseResult.error("提交失败");
|
||||
@ -137,14 +137,14 @@ public class FishDraftDataController {
|
||||
|
||||
@PostMapping("/lockDraft")
|
||||
@Operation(summary = "锁定草稿")
|
||||
public ResponseResult lockDraft(@RequestParam Long id) {
|
||||
public ResponseResult lockDraft(@RequestParam String id) {
|
||||
boolean result = fishDraftDataService.lockDraft(id);
|
||||
return result ? ResponseResult.success("锁定成功") : ResponseResult.error("锁定失败");
|
||||
}
|
||||
|
||||
@PostMapping("/unlockDraft")
|
||||
@Operation(summary = "解锁草稿")
|
||||
public ResponseResult unlockDraft(@RequestParam Long id) {
|
||||
public ResponseResult unlockDraft(@RequestParam String id) {
|
||||
boolean result = fishDraftDataService.unlockDraft(id);
|
||||
return result ? ResponseResult.success("解锁成功") : ResponseResult.error("解锁失败");
|
||||
}
|
||||
@ -165,11 +165,18 @@ public class FishDraftDataController {
|
||||
|
||||
@PostMapping("/delete")
|
||||
@Operation(summary = "删除过鱼数据")
|
||||
public ResponseResult delete(@RequestParam Long id) {
|
||||
public ResponseResult delete(@RequestParam String id) {
|
||||
boolean result = fishDraftDataService.removeById(id);
|
||||
return result ? ResponseResult.success("删除成功") : ResponseResult.error("删除失败");
|
||||
}
|
||||
|
||||
@PostMapping("/batchDelete")
|
||||
@Operation(summary = "批量删除过鱼数据")
|
||||
public ResponseResult batchDelete(@RequestBody List<String> ids) {
|
||||
boolean result = fishDraftDataService.removeByIds(ids);
|
||||
return result ? ResponseResult.success("删除成功") : ResponseResult.error("删除失败");
|
||||
}
|
||||
|
||||
@PostMapping("/importExcel")
|
||||
@Operation(summary = "导入Excel过鱼数据")
|
||||
public ResponseResult importExcel(@RequestParam("file") MultipartFile file,
|
||||
|
||||
@ -34,6 +34,7 @@ public class FishDraftData implements Serializable {
|
||||
/**
|
||||
* 所属基地编码
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String baseId;
|
||||
|
||||
/**
|
||||
@ -130,7 +131,7 @@ public class FishDraftData implements Serializable {
|
||||
/**
|
||||
* 水温
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
// @TableField(exist = false)
|
||||
private BigDecimal wt;
|
||||
|
||||
|
||||
|
||||
@ -18,7 +18,7 @@ public interface FishDraftDataMapper extends BaseMapper<FishDraftData> {
|
||||
* 根据审批批次ID查询草稿数据
|
||||
*/
|
||||
@Select("SELECT * FROM FISH_DRAFT_DATA WHERE APPROVAL_ID = #{approvalId} ORDER BY TM DESC")
|
||||
List<FishDraftData> selectByApprovalId(@Param("approvalId") Long approvalId);
|
||||
List<FishDraftData> selectByApprovalId(@Param("approvalId") String approvalId);
|
||||
|
||||
/**
|
||||
* 根据状态查询草稿数据
|
||||
|
||||
@ -21,7 +21,7 @@ public interface IFishDraftDataService extends IService<FishDraftData> {
|
||||
/**
|
||||
* 根据审批批次ID查询
|
||||
*/
|
||||
List<FishDraftData> getByApprovalId(Long approvalId);
|
||||
List<FishDraftData> getByApprovalId(String approvalId);
|
||||
|
||||
/**
|
||||
* 根据状态查询
|
||||
@ -46,25 +46,25 @@ public interface IFishDraftDataService extends IService<FishDraftData> {
|
||||
/**
|
||||
* 删除草稿(软删除)
|
||||
*/
|
||||
boolean removeDraft(Long id, String operatorId);
|
||||
boolean removeDraft(String id, String operatorId);
|
||||
|
||||
/**
|
||||
* 提交草稿
|
||||
*/
|
||||
boolean submitDraft(Long id, String operatorId);
|
||||
boolean submitDraft(String id, String operatorId);
|
||||
|
||||
/**
|
||||
* 批量提交草稿
|
||||
*/
|
||||
boolean submitDrafts(List<Long> ids, String operatorId);
|
||||
boolean submitDrafts(List<String> ids, String operatorId);
|
||||
|
||||
/**
|
||||
* 锁定草稿
|
||||
*/
|
||||
boolean lockDraft(Long id);
|
||||
boolean lockDraft(String id);
|
||||
|
||||
/**
|
||||
* 解锁草稿
|
||||
*/
|
||||
boolean unlockDraft(Long id);
|
||||
boolean unlockDraft(String id);
|
||||
}
|
||||
@ -44,7 +44,7 @@ public class FishDraftDataServiceImpl extends ServiceImpl<FishDraftDataMapper, F
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FishDraftData> getByApprovalId(Long approvalId) {
|
||||
public List<FishDraftData> getByApprovalId(String approvalId) {
|
||||
return fishDraftDataMapper.selectByApprovalId(approvalId);
|
||||
}
|
||||
|
||||
@ -83,7 +83,7 @@ public class FishDraftDataServiceImpl extends ServiceImpl<FishDraftDataMapper, F
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean removeDraft(Long id, String operatorId) {
|
||||
public boolean removeDraft(String id, String operatorId) {
|
||||
FishDraftData fishDraftData = this.getById(id);
|
||||
if (fishDraftData == null || fishDraftData.getLockFlag() == 1) {
|
||||
return false;
|
||||
@ -97,7 +97,7 @@ public class FishDraftDataServiceImpl extends ServiceImpl<FishDraftDataMapper, F
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean submitDraft(Long id, String operatorId) {
|
||||
public boolean submitDraft(String id, String operatorId) {
|
||||
FishDraftData fishDraftData = this.getById(id);
|
||||
if (fishDraftData == null || fishDraftData.getLockFlag() == 1) {
|
||||
return false;
|
||||
@ -110,8 +110,8 @@ public class FishDraftDataServiceImpl extends ServiceImpl<FishDraftDataMapper, F
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean submitDrafts(List<Long> ids, String operatorId) {
|
||||
for (Long id : ids) {
|
||||
public boolean submitDrafts(List<String> ids, String operatorId) {
|
||||
for (String id : ids) {
|
||||
FishDraftData fishDraftData = this.getById(id);
|
||||
if (fishDraftData != null && fishDraftData.getLockFlag() == 0) {
|
||||
fishDraftData.setStatus("SUBMITTED");
|
||||
@ -125,7 +125,7 @@ public class FishDraftDataServiceImpl extends ServiceImpl<FishDraftDataMapper, F
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean lockDraft(Long id) {
|
||||
public boolean lockDraft(String id) {
|
||||
FishDraftData fishDraftData = this.getById(id);
|
||||
if (fishDraftData == null) {
|
||||
return false;
|
||||
@ -137,7 +137,7 @@ public class FishDraftDataServiceImpl extends ServiceImpl<FishDraftDataMapper, F
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean unlockDraft(Long id) {
|
||||
public boolean unlockDraft(String id) {
|
||||
FishDraftData fishDraftData = this.getById(id);
|
||||
if (fishDraftData == null) {
|
||||
return false;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user