年度计划
This commit is contained in:
@ -20,9 +20,8 @@ import com.alibaba.excel.EasyExcel;
|
|||||||
import com.alibaba.excel.support.ExcelTypeEnum;
|
import com.alibaba.excel.support.ExcelTypeEnum;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.pictc.enums.ApproveCodeEnum;
|
import com.pictc.datalog.DataOperationContent;
|
||||||
import com.pictc.enums.BusinessCode;
|
import com.pictc.datalog.DataOperationListener;
|
||||||
import com.xjrsoft.common.exception.BusinessException;
|
|
||||||
import com.xjrsoft.common.model.result.R;
|
import com.xjrsoft.common.model.result.R;
|
||||||
import com.xjrsoft.common.page.ConventPage;
|
import com.xjrsoft.common.page.ConventPage;
|
||||||
import com.xjrsoft.common.page.PageOutput;
|
import com.xjrsoft.common.page.PageOutput;
|
||||||
@ -38,7 +37,6 @@ import com.xjrsoft.module.plan.service.IPlanYearDemandHdrEcService;
|
|||||||
import com.xjrsoft.module.plan.vo.LngPlanYearDemandHdrEcPageVo;
|
import com.xjrsoft.module.plan.vo.LngPlanYearDemandHdrEcPageVo;
|
||||||
import com.xjrsoft.module.plan.vo.LngPlanYearDemandHdrEcVo;
|
import com.xjrsoft.module.plan.vo.LngPlanYearDemandHdrEcVo;
|
||||||
import com.xjrsoft.module.plan.vo.LngPlanYearDemandHdrPageVo;
|
import com.xjrsoft.module.plan.vo.LngPlanYearDemandHdrPageVo;
|
||||||
import com.xjrsoft.module.plan.vo.LngPlanYearDemandVo;
|
|
||||||
|
|
||||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
@ -139,7 +137,20 @@ public class PlanYearDemandHdrEcController {
|
|||||||
@ApiOperation(value = "删除")
|
@ApiOperation(value = "删除")
|
||||||
@SaCheckPermission("planYearDemandHdrEc:delete")
|
@SaCheckPermission("planYearDemandHdrEc:delete")
|
||||||
public R delete(@Valid @RequestBody List<Long> ids){
|
public R delete(@Valid @RequestBody List<Long> ids){
|
||||||
return R.ok(dataService.deleteByIds(UpdateLngPlanYearDemandHdrEcDto.class, ids));
|
|
||||||
|
return R.ok(dataService.deleteByIds(UpdateLngPlanYearDemandHdrEcDto.class, ids,new DataOperationListener<UpdateLngPlanYearDemandHdrEcDto>() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public UpdateLngPlanYearDemandHdrEcDto before(DataOperationContent<UpdateLngPlanYearDemandHdrEcDto> content) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public UpdateLngPlanYearDemandHdrEcDto after(DataOperationContent<UpdateLngPlanYearDemandHdrEcDto> content) {
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -12,6 +12,10 @@ import com.pictc.datalog.DataOperationContent;
|
|||||||
import com.pictc.datalog.DataOperationListener;
|
import com.pictc.datalog.DataOperationListener;
|
||||||
import com.pictc.enums.ApproveCodeEnum;
|
import com.pictc.enums.ApproveCodeEnum;
|
||||||
import com.pictc.enums.BusinessCode;
|
import com.pictc.enums.BusinessCode;
|
||||||
|
import com.pictc.enums.ExceptionCommonCode;
|
||||||
|
import com.pictc.jdbc.JdbcTools;
|
||||||
|
import com.pictc.jdbc.model.JdbcParam;
|
||||||
|
import com.pictc.utils.StringUtils;
|
||||||
import com.xjrsoft.common.exception.BusinessException;
|
import com.xjrsoft.common.exception.BusinessException;
|
||||||
import com.xjrsoft.module.datalog.service.DatalogService;
|
import com.xjrsoft.module.datalog.service.DatalogService;
|
||||||
import com.xjrsoft.module.plan.dto.UpdateLngPlanYearDemandHdrEcDto;
|
import com.xjrsoft.module.plan.dto.UpdateLngPlanYearDemandHdrEcDto;
|
||||||
@ -57,7 +61,9 @@ public class PlanYearDemandHdrEcServiceImpl extends ServiceImpl<LngPlanYearDeman
|
|||||||
if(StrUtil.isBlank(dto.getCuCode())) {
|
if(StrUtil.isBlank(dto.getCuCode())) {
|
||||||
throw new BusinessException(BusinessCode.of(10500,"客户编码不能为空"));
|
throw new BusinessException(BusinessCode.of(10500,"客户编码不能为空"));
|
||||||
}
|
}
|
||||||
|
if(dto.getDemandVerNo() == null) {
|
||||||
|
dto.setDemandVerNo((byte) 1);
|
||||||
|
}
|
||||||
if(!checkIfCanSave(dto.getCuCode(),dto.getId())) {
|
if(!checkIfCanSave(dto.getCuCode(),dto.getId())) {
|
||||||
throw new BusinessException(BusinessCode.of(10500,"存在未提交或已驳回的需求,不可保存数据"));
|
throw new BusinessException(BusinessCode.of(10500,"存在未提交或已驳回的需求,不可保存数据"));
|
||||||
}
|
}
|
||||||
@ -77,7 +83,7 @@ public class PlanYearDemandHdrEcServiceImpl extends ServiceImpl<LngPlanYearDeman
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public UpdateLngPlanYearDemandHdrEcDto after(DataOperationContent<UpdateLngPlanYearDemandHdrEcDto> content) {
|
public UpdateLngPlanYearDemandHdrEcDto after(DataOperationContent<UpdateLngPlanYearDemandHdrEcDto> content) {
|
||||||
//callSubmit(dto,content);
|
callSubmit(dto,content);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -93,13 +99,55 @@ public class PlanYearDemandHdrEcServiceImpl extends ServiceImpl<LngPlanYearDeman
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public UpdateLngPlanYearDemandHdrEcDto after(DataOperationContent<UpdateLngPlanYearDemandHdrEcDto> content) {
|
public UpdateLngPlanYearDemandHdrEcDto after(DataOperationContent<UpdateLngPlanYearDemandHdrEcDto> content) {
|
||||||
//callSubmit(dto,content);
|
callSubmit(dto,content);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void callSubmit(UpdateLngPlanYearDemandHdrEcDto dto,DataOperationContent<UpdateLngPlanYearDemandHdrEcDto> content) {
|
||||||
|
String sql = StringUtils.format("{? = call pc_{0}.f_save_submit(?,?)}",
|
||||||
|
content.getTableName());
|
||||||
|
|
||||||
|
List<JdbcParam> params = Lists.newArrayList();
|
||||||
|
JdbcParam outParam = JdbcParam.ofString(null).setOut(true);
|
||||||
|
params.add(outParam);
|
||||||
|
params.add(JdbcParam.ofLong(content.getIdValue()));
|
||||||
|
if(dto.getId() != null) {
|
||||||
|
params.add(JdbcParam.ofString("U"));
|
||||||
|
}else {
|
||||||
|
params.add(JdbcParam.ofString("I"));
|
||||||
|
}
|
||||||
|
JdbcTools.call(sql,params);
|
||||||
|
String error = outParam.getStringValue();
|
||||||
|
if (StringUtils.isNotEmpty(error)) {
|
||||||
|
throw new BusinessException(BusinessCode.ofArgs(ExceptionCommonCode.DB_FUNCTION_DELETE_EXEC_ERROR, error));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void callSave(UpdateLngPlanYearDemandHdrEcDto dto,DataOperationContent<UpdateLngPlanYearDemandHdrEcDto> content) {
|
||||||
|
String sql = StringUtils.format("{? = call pc_{0}.f_save(?,?)}",
|
||||||
|
content.getTableName());
|
||||||
|
|
||||||
|
List<JdbcParam> params = Lists.newArrayList();
|
||||||
|
JdbcParam outParam = JdbcParam.ofString(null).setOut(true);
|
||||||
|
params.add(outParam);
|
||||||
|
params.add(JdbcParam.ofLong(content.getIdValue()));
|
||||||
|
if(dto.getId() != null) {
|
||||||
|
params.add(JdbcParam.ofString("U"));
|
||||||
|
}else {
|
||||||
|
params.add(JdbcParam.ofString("I"));
|
||||||
|
}
|
||||||
|
JdbcTools.call(sql,params);
|
||||||
|
String error = outParam.getStringValue();
|
||||||
|
if (StringUtils.isNotEmpty(error)) {
|
||||||
|
throw new BusinessException(BusinessCode.ofArgs(ExceptionCommonCode.DB_FUNCTION_DELETE_EXEC_ERROR, error));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -131,8 +179,9 @@ public class PlanYearDemandHdrEcServiceImpl extends ServiceImpl<LngPlanYearDeman
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public UpdateLngPlanYearDemandHdrEcDto after(DataOperationContent<UpdateLngPlanYearDemandHdrEcDto> content) {
|
public UpdateLngPlanYearDemandHdrEcDto after(DataOperationContent<UpdateLngPlanYearDemandHdrEcDto> content) {
|
||||||
//callSubmit(dto,content);
|
|
||||||
return null;
|
callSave(dto,content);
|
||||||
|
return content.getObj();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}else {
|
}else {
|
||||||
@ -147,8 +196,8 @@ public class PlanYearDemandHdrEcServiceImpl extends ServiceImpl<LngPlanYearDeman
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public UpdateLngPlanYearDemandHdrEcDto after(DataOperationContent<UpdateLngPlanYearDemandHdrEcDto> content) {
|
public UpdateLngPlanYearDemandHdrEcDto after(DataOperationContent<UpdateLngPlanYearDemandHdrEcDto> content) {
|
||||||
//callSubmit(dto,content);
|
callSave(dto,content);
|
||||||
return null;
|
return content.getObj();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user