diff --git a/itc-pcitc-mdm/itc-pcitc-mdm-api/src/main/java/com/xjrsoft/module/dayPlan/vo/LngPngDemandVo.java b/itc-pcitc-mdm/itc-pcitc-mdm-api/src/main/java/com/xjrsoft/module/dayPlan/vo/LngPngDemandVo.java index 503290c..8b8491a 100644 --- a/itc-pcitc-mdm/itc-pcitc-mdm-api/src/main/java/com/xjrsoft/module/dayPlan/vo/LngPngDemandVo.java +++ b/itc-pcitc-mdm/itc-pcitc-mdm-api/src/main/java/com/xjrsoft/module/dayPlan/vo/LngPngDemandVo.java @@ -83,6 +83,8 @@ public class LngPngDemandVo extends com.xjrsoft.common.model.base.BaseModel{ @ApiModelProperty("合同-主信息主键(销售)(lng_contract)") private Long ksId; + private String kName; + /** * 合同-国内销售-管道气-交割点主键(lng_contract_sales_png_point) @@ -95,7 +97,9 @@ public class LngPngDemandVo extends com.xjrsoft.common.model.base.BaseModel{ * 交割点编码 */ @ApiModelProperty("交割点编码") + @Trans(type = TransType.LNG_STATION, transToFieldName = "pointDelyName") private String pointDelyCode; + private String pointDelyName; /** @@ -214,8 +218,9 @@ public class LngPngDemandVo extends com.xjrsoft.common.model.base.BaseModel{ * 审批状态(待提交/审批中/已审批/已驳回) */ @ApiModelProperty("审批状态(待提交/审批中/已审批/已驳回)") + @Trans(type = TransType.DIC, id = "1990669393069129729", transToFieldName = "approName") private String approCode; - + private String approName; /** * 提交时间 diff --git a/itc-pcitc-mdm/itc-pcitc-mdm-service/src/main/java/com/xjrsoft/module/dayPlan/controller/DemandController.java b/itc-pcitc-mdm/itc-pcitc-mdm-service/src/main/java/com/xjrsoft/module/dayPlan/controller/DemandController.java index 5ff8be7..fcf37f5 100644 --- a/itc-pcitc-mdm/itc-pcitc-mdm-service/src/main/java/com/xjrsoft/module/dayPlan/controller/DemandController.java +++ b/itc-pcitc-mdm/itc-pcitc-mdm-service/src/main/java/com/xjrsoft/module/dayPlan/controller/DemandController.java @@ -103,11 +103,19 @@ public class DemandController { @Override public UpdateLngPngDemandDto after(DataOperationContent 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 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() { - + @Override public UpdateLngPngDemandDto before(DataOperationContent content) { return null; @@ -126,11 +136,19 @@ public class DemandController { @Override public UpdateLngPngDemandDto after(DataOperationContent 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 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(); } })); } diff --git a/itc-pcitc-mdm/itc-pcitc-mdm-service/src/main/java/com/xjrsoft/module/dayPlan/mapper/LngPngDemandMapper.java b/itc-pcitc-mdm/itc-pcitc-mdm-service/src/main/java/com/xjrsoft/module/dayPlan/mapper/LngPngDemandMapper.java index 93186d4..ea494ff 100644 --- a/itc-pcitc-mdm/itc-pcitc-mdm-service/src/main/java/com/xjrsoft/module/dayPlan/mapper/LngPngDemandMapper.java +++ b/itc-pcitc-mdm/itc-pcitc-mdm-service/src/main/java/com/xjrsoft/module/dayPlan/mapper/LngPngDemandMapper.java @@ -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,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); } diff --git a/itc-pcitc-mdm/itc-pcitc-mdm-service/src/main/java/com/xjrsoft/module/dayPlan/service/impl/DemandServiceImpl.java b/itc-pcitc-mdm/itc-pcitc-mdm-service/src/main/java/com/xjrsoft/module/dayPlan/service/impl/DemandServiceImpl.java index 193ca00..eecf26f 100644 --- a/itc-pcitc-mdm/itc-pcitc-mdm-service/src/main/java/com/xjrsoft/module/dayPlan/service/impl/DemandServiceImpl.java +++ b/itc-pcitc-mdm/itc-pcitc-mdm-service/src/main/java/com/xjrsoft/module/dayPlan/service/impl/DemandServiceImpl.java @@ -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 queryPurWrapper = new LambdaQueryWrapper<>(); + queryPurWrapper.eq(LngPngDemandPur::getDemandId,id); + queryPurWrapper.orderByAsc(LngPngDemandPur::getSort); + List purList = demandPurMapper.selectList(queryPurWrapper); + lngPngDemandVo.setLngPngDemandPurList(BeanUtil.copyToList(purList, LngPngDemandPurVo.class)); + return lngPngDemandVo; } @Override @@ -251,7 +257,7 @@ public class DemandServiceImpl extends MPJBaseServiceImpl queryWrapper = new LambdaQueryWrapper<>(); @@ -300,7 +306,7 @@ public class DemandServiceImpl extends MPJBaseServiceImpl content) { + String sql = StringUtils.format("{? = call pc_{0}.f_submit(?)}", content.getTableName()); List params = Lists.newArrayList(); @@ -344,7 +351,8 @@ public class DemandServiceImpl extends MPJBaseServiceImpl