日计划管理-客户需求
This commit is contained in:
@ -83,6 +83,8 @@ public class LngPngDemandVo extends com.xjrsoft.common.model.base.BaseModel{
|
|||||||
@ApiModelProperty("合同-主信息主键(销售)(lng_contract)")
|
@ApiModelProperty("合同-主信息主键(销售)(lng_contract)")
|
||||||
private Long ksId;
|
private Long ksId;
|
||||||
|
|
||||||
|
private String kName;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 合同-国内销售-管道气-交割点主键(lng_contract_sales_png_point)
|
* 合同-国内销售-管道气-交割点主键(lng_contract_sales_png_point)
|
||||||
@ -95,7 +97,9 @@ public class LngPngDemandVo extends com.xjrsoft.common.model.base.BaseModel{
|
|||||||
* 交割点编码
|
* 交割点编码
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty("交割点编码")
|
@ApiModelProperty("交割点编码")
|
||||||
|
@Trans(type = TransType.LNG_STATION, transToFieldName = "pointDelyName")
|
||||||
private String pointDelyCode;
|
private String pointDelyCode;
|
||||||
|
private String pointDelyName;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -214,8 +218,9 @@ public class LngPngDemandVo extends com.xjrsoft.common.model.base.BaseModel{
|
|||||||
* 审批状态(待提交/审批中/已审批/已驳回)
|
* 审批状态(待提交/审批中/已审批/已驳回)
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty("审批状态(待提交/审批中/已审批/已驳回)")
|
@ApiModelProperty("审批状态(待提交/审批中/已审批/已驳回)")
|
||||||
|
@Trans(type = TransType.DIC, id = "1990669393069129729", transToFieldName = "approName")
|
||||||
private String approCode;
|
private String approCode;
|
||||||
|
private String approName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 提交时间
|
* 提交时间
|
||||||
|
|||||||
@ -103,11 +103,19 @@ public class DemandController {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public UpdateLngPngDemandDto after(DataOperationContent<UpdateLngPngDemandDto> content) {
|
public UpdateLngPngDemandDto after(DataOperationContent<UpdateLngPngDemandDto> content) {
|
||||||
String msg = CommonCallUtils.saveAfter(content.getTableName(),content.getIdValue());
|
String sql = StringUtils.format("{? = call pc_{0}.f_save(?,?)}",
|
||||||
if (StringUtils.isNotEmpty(msg)) {
|
content.getTableName());
|
||||||
throw new BusinessException(BusinessCode.ofArgs(ExceptionCommonCode.DB_FUNCTION_EXEC_ERROR, msg));
|
List<JdbcParam> params = Lists.newArrayList();
|
||||||
}
|
JdbcParam outParam = JdbcParam.ofString(null).setOut(true);
|
||||||
return content.getObj();
|
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,6 +125,8 @@ public class DemandController {
|
|||||||
@ApiOperation(value = "编辑LngPngDemand")
|
@ApiOperation(value = "编辑LngPngDemand")
|
||||||
@SaCheckPermission("demand:edit")
|
@SaCheckPermission("demand:edit")
|
||||||
public R update(@Valid @RequestBody UpdateLngPngDemandDto dto){
|
public R update(@Valid @RequestBody UpdateLngPngDemandDto dto){
|
||||||
|
|
||||||
|
dto.setOrgId(dto.getId());
|
||||||
return R.ok(dataService.updateById(dto,new DataOperationListener<UpdateLngPngDemandDto>() {
|
return R.ok(dataService.updateById(dto,new DataOperationListener<UpdateLngPngDemandDto>() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -126,11 +136,19 @@ public class DemandController {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public UpdateLngPngDemandDto after(DataOperationContent<UpdateLngPngDemandDto> content) {
|
public UpdateLngPngDemandDto after(DataOperationContent<UpdateLngPngDemandDto> content) {
|
||||||
String msg = CommonCallUtils.saveAfter(content.getTableName(),content.getIdValue());
|
String sql = StringUtils.format("{? = call pc_{0}.f_save(?,?)}",
|
||||||
if (StringUtils.isNotEmpty(msg)) {
|
content.getTableName());
|
||||||
throw new BusinessException(BusinessCode.ofArgs(ExceptionCommonCode.DB_FUNCTION_EXEC_ERROR, msg));
|
List<JdbcParam> params = Lists.newArrayList();
|
||||||
}
|
JdbcParam outParam = JdbcParam.ofString(null).setOut(true);
|
||||||
return content.getObj();
|
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;
|
package com.xjrsoft.module.dayPlan.mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
import org.apache.ibatis.annotations.Select;
|
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.github.yulichang.base.MPJBaseMapper;
|
||||||
import com.xjrsoft.module.dayPlan.dto.LngPngDemandPageDto;
|
import com.xjrsoft.module.dayPlan.dto.LngPngDemandPageDto;
|
||||||
import com.xjrsoft.module.dayPlan.entity.LngPngDemand;
|
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.LngPngDemandPageVo;
|
||||||
|
import com.xjrsoft.module.dayPlan.vo.LngPngDemandVo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @title: mapper
|
* @title: mapper
|
||||||
@ -43,4 +47,11 @@ public interface LngPngDemandMapper extends MPJBaseMapper<LngPngDemand>,BaseMapp
|
|||||||
" JOIN lng_png_approval a ON a.appro_id=pa.id " +
|
" JOIN lng_png_approval a ON a.appro_id=pa.id " +
|
||||||
" WHERE d.id = #{id}")
|
" WHERE d.id = #{id}")
|
||||||
Long getApprovedCount(@Param("id") Long 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.mapper.LngPngDemandPurMapper;
|
||||||
import com.xjrsoft.module.dayPlan.service.IDemandService;
|
import com.xjrsoft.module.dayPlan.service.IDemandService;
|
||||||
import com.xjrsoft.module.dayPlan.vo.LngPngDemandChangeDetailVo;
|
import com.xjrsoft.module.dayPlan.vo.LngPngDemandChangeDetailVo;
|
||||||
|
import com.xjrsoft.module.dayPlan.vo.LngPngDemandPurVo;
|
||||||
import com.xjrsoft.module.dayPlan.vo.LngPngDemandVo;
|
import com.xjrsoft.module.dayPlan.vo.LngPngDemandVo;
|
||||||
|
|
||||||
import cn.hutool.core.bean.BeanUtil;
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
@ -62,11 +63,16 @@ public class DemandServiceImpl extends MPJBaseServiceImpl<LngPngDemandMapper, Ln
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public LngPngDemandVo getInfoById(Long id) {
|
public LngPngDemandVo getInfoById(Long id) {
|
||||||
LngPngDemand lngPngDemand = this.getByIdDeep(id);
|
LngPngDemandVo lngPngDemandVo = this.baseMapper.getInfoBygId(id);
|
||||||
if (lngPngDemand == null) {
|
if (lngPngDemandVo == null) {
|
||||||
return 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
|
@Override
|
||||||
@ -251,7 +257,7 @@ public class DemandServiceImpl extends MPJBaseServiceImpl<LngPngDemandMapper, Ln
|
|||||||
throw new BusinessException(BusinessCode.of(10500,"找不到此数据!"));
|
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,"审批状态变化,不能删除"));
|
throw new BusinessException(BusinessCode.of(10500,"审批状态变化,不能删除"));
|
||||||
}
|
}
|
||||||
LambdaQueryWrapper<LngPngDemand> queryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<LngPngDemand> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
@ -300,7 +306,7 @@ public class DemandServiceImpl extends MPJBaseServiceImpl<LngPngDemandMapper, Ln
|
|||||||
throw new BusinessException(BusinessCode.of(10500,"找不到此数据!"));
|
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,"审批状态变化,不能提交"));
|
throw new BusinessException(BusinessCode.of(10500,"审批状态变化,不能提交"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -317,6 +323,7 @@ public class DemandServiceImpl extends MPJBaseServiceImpl<LngPngDemandMapper, Ln
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public UpdateLngPngDemandDto after(DataOperationContent<UpdateLngPngDemandDto> content) {
|
public UpdateLngPngDemandDto after(DataOperationContent<UpdateLngPngDemandDto> content) {
|
||||||
|
|
||||||
String sql = StringUtils.format("{? = call pc_{0}.f_submit(?)}",
|
String sql = StringUtils.format("{? = call pc_{0}.f_submit(?)}",
|
||||||
content.getTableName());
|
content.getTableName());
|
||||||
List<JdbcParam> params = Lists.newArrayList();
|
List<JdbcParam> params = Lists.newArrayList();
|
||||||
@ -344,7 +351,8 @@ public class DemandServiceImpl extends MPJBaseServiceImpl<LngPngDemandMapper, Ln
|
|||||||
throw new BusinessException(BusinessCode.of(10500,"找不到此数据!"));
|
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,"审批状态变化,不能提交"));
|
throw new BusinessException(BusinessCode.of(10500,"审批状态变化,不能提交"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user