修改是否显示字段;

This commit is contained in:
王奎兴
2026-04-02 14:22:10 +08:00
parent 35974b48c7
commit ba5137899f
2 changed files with 84 additions and 2 deletions
@@ -408,6 +408,66 @@ public class ExpenseAccountApplicationService {
expenseAccountDO.setUpdateByName(loginUser.getUsername());
return expenseAccountDomainService.update(expenseAccountDO);
}
/**
* 修改创建订单是否固定显示 0-否 1-是
* @param expenseAccountDTO
* @return
*/
public boolean changeInOrderDisplay(ExpenseAccountDTO expenseAccountDTO) {
//获取登录用户信息
LoginUser loginUser = SecurityUtils.getLoginUser();
if (ObjectUtil.isNull(loginUser)) {
throw new DigitalLogisticsException(UserError.TIMEOUT);
}
//根据id修改启用状态停用状态
if(expenseAccountDTO.getExpenseAccountId() == null){
throw new ServiceException("费用科目id不能为空");
}
if(expenseAccountDTO.getInOrderDisplay() == null){
throw new ServiceException("状态不能为空");
}
if(expenseAccountDTO.getInOrderDisplay() != 0 && expenseAccountDTO.getInOrderDisplay()!=1){
throw new ServiceException("状态错误");
}
ExpenseAccountDO expenseAccountDO = new ExpenseAccountDO();
expenseAccountDO.setExpenseAccountId(expenseAccountDTO.getExpenseAccountId());
expenseAccountDO.setInOrderDisplay(expenseAccountDTO.getInOrderDisplay());
expenseAccountDO.setUpdateBy(loginUser.getUserid());
expenseAccountDO.setUpdateTime(new Date());
expenseAccountDO.setUpdateByName(loginUser.getUsername());
return expenseAccountDomainService.update(expenseAccountDO);
}
/**
* 修改创建订单是否固定显示 0-否 1-是
* @param expenseAccountDTO
* @return
*/
public boolean changeOutOrderDisplay(ExpenseAccountDTO expenseAccountDTO) {
//获取登录用户信息
LoginUser loginUser = SecurityUtils.getLoginUser();
if (ObjectUtil.isNull(loginUser)) {
throw new DigitalLogisticsException(UserError.TIMEOUT);
}
//根据id修改启用状态停用状态
if(expenseAccountDTO.getExpenseAccountId() == null){
throw new ServiceException("费用科目id不能为空");
}
if(expenseAccountDTO.getOutOrderDisplay() == null){
throw new ServiceException("状态不能为空");
}
if(expenseAccountDTO.getOutOrderDisplay() != 0 && expenseAccountDTO.getOutOrderDisplay()!=1){
throw new ServiceException("状态错误");
}
ExpenseAccountDO expenseAccountDO = new ExpenseAccountDO();
expenseAccountDO.setExpenseAccountId(expenseAccountDTO.getExpenseAccountId());
expenseAccountDO.setOutOrderDisplay(expenseAccountDTO.getOutOrderDisplay());
expenseAccountDO.setUpdateBy(loginUser.getUserid());
expenseAccountDO.setUpdateTime(new Date());
expenseAccountDO.setUpdateByName(loginUser.getUsername());
return expenseAccountDomainService.update(expenseAccountDO);
}
/**
* 根据编码查询费用科目信息
*/
@@ -470,4 +530,4 @@ public class ExpenseAccountApplicationService {
public List<QueryExpenseAccountPO> selectSocialVehicleExpenseAccount(){
return expenseAccountDomainService.selectSocialVehicleExpenseAccount();
}
}
}
@@ -271,6 +271,28 @@ public class ExpenseAccountApi extends BaseController{
}
}
@ApiOperation("修改创建订单默认显示设置")
@PostMapping("/changeInOrderDisplay")
public AjaxResult changeInOrderDisplay(@RequestBody ExpenseAccountDTO expenseAccountDTO)
{
try {
return toAjax(expenseAccountApplicationService.changeInOrderDisplay(expenseAccountDTO));
}catch (Exception e){
return AjaxResult.error(e.getMessage());
}
}
@ApiOperation("修改创建订单默认显示设置")
@PostMapping("/changeOutOrderDisplay")
public AjaxResult changeOutOrderDisplay(@RequestBody ExpenseAccountDTO expenseAccountDTO)
{
try {
return toAjax(expenseAccountApplicationService.changeOutOrderDisplay(expenseAccountDTO));
}catch (Exception e){
return AjaxResult.error(e.getMessage());
}
}
@ApiOperation("根据code获取费用科目")
@GetMapping(value = "/getInfoByCode")
public AjaxResult getInfoByCode(@RequestParam("subjectCode") String subjectCode)
@@ -288,4 +310,4 @@ public class ExpenseAccountApi extends BaseController{
}
}
}