diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/controller/LeaseApplyInfoController.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/controller/LeaseApplyInfoController.java index f02bb966..05a10e1c 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/controller/LeaseApplyInfoController.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/controller/LeaseApplyInfoController.java @@ -12,9 +12,9 @@ import com.bonus.material.lease.service.ILeaseApplyInfoService; import com.bonus.material.task.domain.vo.TmTaskRequestVo; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; +import javax.annotation.Resource; import javax.servlet.http.HttpServletResponse; import javax.validation.constraints.NotNull; import java.util.List; @@ -29,7 +29,8 @@ import java.util.List; @RestController @RequestMapping("/lease_apply_info") public class LeaseApplyInfoController extends BaseController { - @Autowired + + @Resource private ILeaseApplyInfoService leaseApplyInfoService; /** @@ -54,7 +55,7 @@ public class LeaseApplyInfoController extends BaseController { @PostMapping("/export") public void export(HttpServletResponse response, LeaseApplyInfo leaseApplyInfo) { List list = leaseApplyInfoService.selectLeaseApplyInfoList(leaseApplyInfo); - ExcelUtil util = new ExcelUtil(LeaseApplyInfo.class); + ExcelUtil util = new ExcelUtil<>(LeaseApplyInfo.class); util.exportExcel(response, list, "领料任务数据"); } @@ -64,7 +65,7 @@ public class LeaseApplyInfoController extends BaseController { @ApiOperation(value = "获取领料任务详细信息") //@RequiresPermissions("lease:info:query") @GetMapping(value = "/{id}") - public AjaxResult getInfo(@PathVariable("id") @NotNull(message = "领料任务ID不能为空") Long id) { + public AjaxResult getInfo(@NotNull(message = "领料任务ID不能为空") @PathVariable("id") Long id) { return success(leaseApplyInfoService.selectLeaseApplyInfoById(id)); } @@ -76,7 +77,7 @@ public class LeaseApplyInfoController extends BaseController { //@RequiresPermissions("lease:info:add") @SysLog(title = "领料任务", businessType = OperaType.INSERT, logType = 1,module = "仓储管理->新增领料任务") @PostMapping - public AjaxResult add(@RequestBody @NotNull(message = "领料任务不能为空") TmTaskRequestVo tmTaskRequestVo) { + public AjaxResult add(@NotNull(message = "领料任务不能为空") @RequestBody TmTaskRequestVo tmTaskRequestVo) { try { return leaseApplyInfoService.insertLeaseApplyInfo(tmTaskRequestVo); } catch (Exception e) { diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/domain/LeaseApplyInfo.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/domain/LeaseApplyInfo.java index 0d9eb19d..07756675 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/domain/LeaseApplyInfo.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/domain/LeaseApplyInfo.java @@ -117,7 +117,7 @@ public class LeaseApplyInfo extends BaseEntity { private Long directId; /** 0工程1长期 */ - @Excel(name = "0工程1长期") + @Excel(name = "领用类型",readConverterExp = "0=工程,1=长期") @ApiModelProperty(value = "0工程1长期") private String leaseType; @@ -137,12 +137,14 @@ public class LeaseApplyInfo extends BaseEntity { List leaseApplyDetails; @ApiModelProperty(value = "租赁工程") + @Excel(name = "领料工程") private String leaseProject; @ApiModelProperty(value = "租赁工程id") private Integer leaseProjectId; @ApiModelProperty(value = "租赁单位") + @Excel(name = "领料单位") private String leaseUnit; @ApiModelProperty(value = "租赁单位id") @@ -152,6 +154,7 @@ public class LeaseApplyInfo extends BaseEntity { private Long agreementId; @ApiModelProperty(value = "协议号") + @Excel(name = "协议号") private String agreementCode; } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/service/impl/LeaseApplyInfoServiceImpl.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/service/impl/LeaseApplyInfoServiceImpl.java index c740c026..3afaf86e 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/service/impl/LeaseApplyInfoServiceImpl.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/service/impl/LeaseApplyInfoServiceImpl.java @@ -19,7 +19,6 @@ import com.bonus.material.task.domain.TmTaskAgreement; import com.bonus.material.task.domain.vo.TmTaskRequestVo; import com.bonus.material.task.mapper.TmTaskAgreementMapper; import com.bonus.material.task.mapper.TmTaskMapper; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.dao.DataAccessException; import org.springframework.stereotype.Service; import com.bonus.material.lease.mapper.LeaseApplyInfoMapper; @@ -37,10 +36,11 @@ import javax.annotation.Resource; */ @Service public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService { - @Autowired + + @Resource private LeaseApplyInfoMapper leaseApplyInfoMapper; - @Autowired + @Resource private LeaseApplyDetailsMapper leaseApplyDetailsMapper; @Resource @@ -49,7 +49,6 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService { @Resource TmTaskAgreementMapper tmTaskAgreementMapper; - /** * 查询领料任务 * @@ -175,7 +174,7 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService { try { // 提取到局部变量中,减少重复代码 LeaseApplyInfo leaseApplyInfo = tmTaskRequestVo.getLeaseApplyInfo(); - if (leaseApplyInfo != null) { + if (leaseApplyInfo != null && leaseApplyInfo.getId() != null) { leaseApplyInfo.setUpdateTime(DateUtils.getNowDate()); leaseApplyInfo.setUpdateBy(SecurityUtils.getUsername()); diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/task/mapper/TmTaskAgreementMapper.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/task/mapper/TmTaskAgreementMapper.java index 96eaf43f..2181ffa9 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/task/mapper/TmTaskAgreementMapper.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/task/mapper/TmTaskAgreementMapper.java @@ -10,13 +10,14 @@ import com.bonus.material.task.domain.TmTaskAgreement; * @date 2024-10-16 */ public interface TmTaskAgreementMapper { + /** * 查询任务 * * @param taskId 任务主键 * @return 任务 */ - public TmTaskAgreement selectTmTaskAgreementByTaskId(Long taskId); + TmTaskAgreement selectTmTaskAgreementByTaskId(Long taskId); /** * 查询任务列表 @@ -24,7 +25,7 @@ public interface TmTaskAgreementMapper { * @param tmTaskAgreement 任务 * @return 任务集合 */ - public List selectTmTaskAgreementList(TmTaskAgreement tmTaskAgreement); + List selectTmTaskAgreementList(TmTaskAgreement tmTaskAgreement); /** * 新增任务 @@ -32,7 +33,7 @@ public interface TmTaskAgreementMapper { * @param tmTaskAgreement 任务 * @return 结果 */ - public int insertTmTaskAgreement(TmTaskAgreement tmTaskAgreement); + int insertTmTaskAgreement(TmTaskAgreement tmTaskAgreement); /** * 修改任务 @@ -40,7 +41,7 @@ public interface TmTaskAgreementMapper { * @param tmTaskAgreement 任务 * @return 结果 */ - public int updateTmTaskAgreement(TmTaskAgreement tmTaskAgreement); + int updateTmTaskAgreement(TmTaskAgreement tmTaskAgreement); /** * 删除任务 @@ -48,7 +49,7 @@ public interface TmTaskAgreementMapper { * @param taskId 任务主键 * @return 结果 */ - public int deleteTmTaskAgreementByTaskId(Long taskId); + int deleteTmTaskAgreementByTaskId(Long taskId); /** * 批量删除任务 @@ -56,5 +57,5 @@ public interface TmTaskAgreementMapper { * @param taskIds 需要删除的数据主键集合 * @return 结果 */ - public int deleteTmTaskAgreementByTaskIds(Long[] taskIds); + int deleteTmTaskAgreementByTaskIds(Long[] taskIds); }