日计划管理-客户需求
This commit is contained in:
@ -103,11 +103,19 @@ public class DemandController {
|
||||
|
||||
@Override
|
||||
public UpdateLngPngDemandDto after(DataOperationContent<UpdateLngPngDemandDto> content) {
|
||||
String msg = CommonCallUtils.saveAfter(content.getTableName(),content.getIdValue());
|
||||
if (StringUtils.isNotEmpty(msg)) {
|
||||
throw new BusinessException(BusinessCode.ofArgs(ExceptionCommonCode.DB_FUNCTION_EXEC_ERROR, msg));
|
||||
}
|
||||
return content.getObj();
|
||||
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()));
|
||||
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));
|
||||
}
|
||||
return content.getObj();
|
||||
}
|
||||
}));
|
||||
|
||||
@ -117,8 +125,10 @@ public class DemandController {
|
||||
@ApiOperation(value = "编辑LngPngDemand")
|
||||
@SaCheckPermission("demand:edit")
|
||||
public R update(@Valid @RequestBody UpdateLngPngDemandDto dto){
|
||||
|
||||
dto.setOrgId(dto.getId());
|
||||
return R.ok(dataService.updateById(dto,new DataOperationListener<UpdateLngPngDemandDto>() {
|
||||
|
||||
|
||||
@Override
|
||||
public UpdateLngPngDemandDto before(DataOperationContent<UpdateLngPngDemandDto> content) {
|
||||
return null;
|
||||
@ -126,11 +136,19 @@ public class DemandController {
|
||||
|
||||
@Override
|
||||
public UpdateLngPngDemandDto after(DataOperationContent<UpdateLngPngDemandDto> content) {
|
||||
String msg = CommonCallUtils.saveAfter(content.getTableName(),content.getIdValue());
|
||||
if (StringUtils.isNotEmpty(msg)) {
|
||||
throw new BusinessException(BusinessCode.ofArgs(ExceptionCommonCode.DB_FUNCTION_EXEC_ERROR, msg));
|
||||
}
|
||||
return content.getObj();
|
||||
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()));
|
||||
params.add(JdbcParam.ofString("U"));
|
||||
JdbcTools.call(sql,params);
|
||||
String error = outParam.getStringValue();
|
||||
if (StringUtils.isNotEmpty(error)) {
|
||||
throw new BusinessException(BusinessCode.ofArgs(ExceptionCommonCode.DB_FUNCTION_DELETE_EXEC_ERROR, error));
|
||||
}
|
||||
return content.getObj();
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
@ -1,5 +1,7 @@
|
||||
package com.xjrsoft.module.dayPlan.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
@ -11,7 +13,9 @@ import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import com.github.yulichang.base.MPJBaseMapper;
|
||||
import com.xjrsoft.module.dayPlan.dto.LngPngDemandPageDto;
|
||||
import com.xjrsoft.module.dayPlan.entity.LngPngDemand;
|
||||
import com.xjrsoft.module.dayPlan.vo.LngPngApproVo;
|
||||
import com.xjrsoft.module.dayPlan.vo.LngPngDemandPageVo;
|
||||
import com.xjrsoft.module.dayPlan.vo.LngPngDemandVo;
|
||||
|
||||
/**
|
||||
* @title: mapper
|
||||
@ -43,4 +47,11 @@ public interface LngPngDemandMapper extends MPJBaseMapper<LngPngDemand>,BaseMapp
|
||||
" JOIN lng_png_approval a ON a.appro_id=pa.id " +
|
||||
" WHERE d.id = #{id}")
|
||||
Long getApprovedCount(@Param("id") Long id);
|
||||
|
||||
|
||||
@Select("SELECT d.*,k.k_name"+
|
||||
" FROM lng_png_demand d" +
|
||||
" LEFT JOIN lng_contract k ON k.id=d.ks_id" +
|
||||
" WHERE d.id = #{id}")
|
||||
LngPngDemandVo getInfoBygId(@Param("id") Long id);
|
||||
}
|
||||
|
||||
@ -34,6 +34,7 @@ import com.xjrsoft.module.dayPlan.mapper.LngPngDemandMapper;
|
||||
import com.xjrsoft.module.dayPlan.mapper.LngPngDemandPurMapper;
|
||||
import com.xjrsoft.module.dayPlan.service.IDemandService;
|
||||
import com.xjrsoft.module.dayPlan.vo.LngPngDemandChangeDetailVo;
|
||||
import com.xjrsoft.module.dayPlan.vo.LngPngDemandPurVo;
|
||||
import com.xjrsoft.module.dayPlan.vo.LngPngDemandVo;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
@ -62,11 +63,16 @@ public class DemandServiceImpl extends MPJBaseServiceImpl<LngPngDemandMapper, Ln
|
||||
|
||||
@Override
|
||||
public LngPngDemandVo getInfoById(Long id) {
|
||||
LngPngDemand lngPngDemand = this.getByIdDeep(id);
|
||||
if (lngPngDemand == null) {
|
||||
LngPngDemandVo lngPngDemandVo = this.baseMapper.getInfoBygId(id);
|
||||
if (lngPngDemandVo == null) {
|
||||
return null;
|
||||
}
|
||||
return BeanUtil.toBean(lngPngDemand, LngPngDemandVo.class);
|
||||
LambdaQueryWrapper<LngPngDemandPur> queryPurWrapper = new LambdaQueryWrapper<>();
|
||||
queryPurWrapper.eq(LngPngDemandPur::getDemandId,id);
|
||||
queryPurWrapper.orderByAsc(LngPngDemandPur::getSort);
|
||||
List<LngPngDemandPur> purList = demandPurMapper.selectList(queryPurWrapper);
|
||||
lngPngDemandVo.setLngPngDemandPurList(BeanUtil.copyToList(purList, LngPngDemandPurVo.class));
|
||||
return lngPngDemandVo;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -251,7 +257,7 @@ public class DemandServiceImpl extends MPJBaseServiceImpl<LngPngDemandMapper, Ln
|
||||
throw new BusinessException(BusinessCode.of(10500,"找不到此数据!"));
|
||||
|
||||
}
|
||||
if(!"WTJ".equals(lngPngDemand.getApproCode()) || !"YBH".equals(lngPngDemand.getApproCode()) ) {
|
||||
if(!"WTJ".equals(lngPngDemand.getApproCode()) && !"YBH".equals(lngPngDemand.getApproCode()) ) {
|
||||
throw new BusinessException(BusinessCode.of(10500,"审批状态变化,不能删除"));
|
||||
}
|
||||
LambdaQueryWrapper<LngPngDemand> queryWrapper = new LambdaQueryWrapper<>();
|
||||
@ -300,7 +306,7 @@ public class DemandServiceImpl extends MPJBaseServiceImpl<LngPngDemandMapper, Ln
|
||||
throw new BusinessException(BusinessCode.of(10500,"找不到此数据!"));
|
||||
|
||||
}
|
||||
if(!"WTJ".equals(lngPngDemand.getApproCode()) || !"YBH".equals(lngPngDemand.getApproCode()) ) {
|
||||
if(!"WTJ".equals(lngPngDemand.getApproCode()) && !"YBH".equals(lngPngDemand.getApproCode()) ) {
|
||||
throw new BusinessException(BusinessCode.of(10500,"审批状态变化,不能提交"));
|
||||
}
|
||||
|
||||
@ -317,6 +323,7 @@ public class DemandServiceImpl extends MPJBaseServiceImpl<LngPngDemandMapper, Ln
|
||||
|
||||
@Override
|
||||
public UpdateLngPngDemandDto after(DataOperationContent<UpdateLngPngDemandDto> content) {
|
||||
|
||||
String sql = StringUtils.format("{? = call pc_{0}.f_submit(?)}",
|
||||
content.getTableName());
|
||||
List<JdbcParam> params = Lists.newArrayList();
|
||||
@ -344,7 +351,8 @@ public class DemandServiceImpl extends MPJBaseServiceImpl<LngPngDemandMapper, Ln
|
||||
throw new BusinessException(BusinessCode.of(10500,"找不到此数据!"));
|
||||
|
||||
}
|
||||
if(!"WTJ".equals(lngPngDemand.getApproCode()) || !"YBH".equals(lngPngDemand.getApproCode()) ) {
|
||||
|
||||
if(!"WTJ".equals(lngPngDemand.getApproCode()) && !"YBH".equals(lngPngDemand.getApproCode()) ) {
|
||||
throw new BusinessException(BusinessCode.of(10500,"审批状态变化,不能提交"));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user