Merge branch 'dev' of http://47.94.165.164:13000/geg-gas/geg-gas-pcitc into dev
This commit is contained in:
@ -54,6 +54,7 @@ public class LngInventoryInVo extends com.xjrsoft.common.model.base.BaseModel{
|
||||
@ApiModelProperty("品种(缺省LNG)")
|
||||
private String catCode;
|
||||
|
||||
private String catName;
|
||||
|
||||
/**
|
||||
* 采购执行主键(type_code=CQ时选采购执行,带出船期计划、采购合同、供应商;ZN时空)
|
||||
|
||||
@ -57,7 +57,7 @@ public class LngInventoryOutVo extends com.xjrsoft.common.model.base.BaseModel{
|
||||
@ApiModelProperty("品种")
|
||||
private String catCode;
|
||||
|
||||
|
||||
private String catName;
|
||||
/**
|
||||
* 销售合同主键(type_code=ZN时必须,其他空)
|
||||
*/
|
||||
|
||||
@ -15,6 +15,15 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.pictc.datalog.DataOperationContent;
|
||||
import com.pictc.datalog.DataOperationListener;
|
||||
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.model.result.R;
|
||||
import com.xjrsoft.common.page.ConventPage;
|
||||
import com.xjrsoft.common.page.PageOutput;
|
||||
@ -26,10 +35,8 @@ import com.xjrsoft.module.inventory.dto.UpdateLngInventoryInDto;
|
||||
import com.xjrsoft.module.inventory.entity.LngInventoryIn;
|
||||
import com.xjrsoft.module.inventory.service.ILngInventoryInService;
|
||||
import com.xjrsoft.module.inventory.vo.LngInventoryInPageVo;
|
||||
import com.xjrsoft.module.inventory.vo.LngInventoryInVo;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
@ -89,7 +96,36 @@ public class LngInventoryInController {
|
||||
@ApiOperation(value = "新增LngInventoryIn")
|
||||
@SaCheckPermission("lngInventoryIn:add")
|
||||
public R add(@Valid @RequestBody UpdateLngInventoryInDto dto){
|
||||
UpdateLngInventoryInDto res = dataService.insert(dto);
|
||||
UpdateLngInventoryInDto res = dataService.insert(dto,new DataOperationListener<UpdateLngInventoryInDto>() {
|
||||
|
||||
@Override
|
||||
public UpdateLngInventoryInDto before(DataOperationContent<UpdateLngInventoryInDto> content) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public UpdateLngInventoryInDto after(DataOperationContent<UpdateLngInventoryInDto> 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("I"));
|
||||
}else {
|
||||
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();
|
||||
}
|
||||
});
|
||||
return R.ok(res.getId());
|
||||
}
|
||||
|
||||
@ -97,14 +133,67 @@ public class LngInventoryInController {
|
||||
@ApiOperation(value = "修改LngInventoryIn")
|
||||
@SaCheckPermission("lngInventoryIn:edit")
|
||||
public R update(@Valid @RequestBody UpdateLngInventoryInDto dto){
|
||||
return R.ok(dataService.updateById(dto));
|
||||
return R.ok(dataService.updateById(dto,new DataOperationListener<UpdateLngInventoryInDto>() {
|
||||
|
||||
@Override
|
||||
public UpdateLngInventoryInDto before(DataOperationContent<UpdateLngInventoryInDto> content) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public UpdateLngInventoryInDto after(DataOperationContent<UpdateLngInventoryInDto> 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("I"));
|
||||
}else {
|
||||
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();
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
@DeleteMapping
|
||||
@ApiOperation(value = "删除")
|
||||
@SaCheckPermission("lngInventoryIn:delete")
|
||||
public R delete(@Valid @RequestBody List<Long> ids){
|
||||
return R.ok(dataService.deleteByIds(UpdateLngInventoryInDto.class, ids));
|
||||
return R.ok(dataService.deleteByIds(UpdateLngInventoryInDto.class, ids,new DataOperationListener<UpdateLngInventoryInDto>() {
|
||||
|
||||
@Override
|
||||
public UpdateLngInventoryInDto before(DataOperationContent<UpdateLngInventoryInDto> content) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public UpdateLngInventoryInDto after(DataOperationContent<UpdateLngInventoryInDto> content) {
|
||||
|
||||
String sql = StringUtils.format("{? = call pc_{0}.f_before_delete(?)}",
|
||||
content.getTableName());
|
||||
List<JdbcParam> params = Lists.newArrayList();
|
||||
JdbcParam outParam = JdbcParam.ofString(null).setOut(true);
|
||||
params.add(outParam);
|
||||
params.add(JdbcParam.ofLong(content.getIdValue()));
|
||||
|
||||
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();
|
||||
}
|
||||
}));
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -15,6 +15,15 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.pictc.datalog.DataOperationContent;
|
||||
import com.pictc.datalog.DataOperationListener;
|
||||
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.model.result.R;
|
||||
import com.xjrsoft.common.page.ConventPage;
|
||||
import com.xjrsoft.common.page.PageOutput;
|
||||
@ -23,6 +32,7 @@ import com.xjrsoft.module.datalog.service.DatalogService;
|
||||
import com.xjrsoft.module.datalog.vo.DataChangeLogVo;
|
||||
import com.xjrsoft.module.inventory.dto.LngInventoryOutPageDto;
|
||||
import com.xjrsoft.module.inventory.dto.UpdateLngInventoryOutDto;
|
||||
import com.xjrsoft.module.inventory.dto.UpdateLngInventoryOutDto;
|
||||
import com.xjrsoft.module.inventory.entity.LngInventoryOut;
|
||||
import com.xjrsoft.module.inventory.service.ILngInventoryOutService;
|
||||
import com.xjrsoft.module.inventory.vo.LngInventoryOutPageVo;
|
||||
@ -86,7 +96,36 @@ public class LngInventoryOutController {
|
||||
@ApiOperation(value = "新增LngInventoryOut")
|
||||
@SaCheckPermission("lngInventoryOut:add")
|
||||
public R add(@Valid @RequestBody UpdateLngInventoryOutDto dto){
|
||||
UpdateLngInventoryOutDto res = dataService.insert(dto);
|
||||
UpdateLngInventoryOutDto res = dataService.insert(dto,new DataOperationListener<UpdateLngInventoryOutDto>() {
|
||||
|
||||
@Override
|
||||
public UpdateLngInventoryOutDto before(DataOperationContent<UpdateLngInventoryOutDto> content) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public UpdateLngInventoryOutDto after(DataOperationContent<UpdateLngInventoryOutDto> 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("I"));
|
||||
}else {
|
||||
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();
|
||||
}
|
||||
});
|
||||
return R.ok(res.getId());
|
||||
}
|
||||
|
||||
@ -94,14 +133,67 @@ public class LngInventoryOutController {
|
||||
@ApiOperation(value = "修改LngInventoryOut")
|
||||
@SaCheckPermission("lngInventoryOut:edit")
|
||||
public R update(@Valid @RequestBody UpdateLngInventoryOutDto dto){
|
||||
return R.ok(dataService.updateById(dto));
|
||||
return R.ok(dataService.updateById(dto,new DataOperationListener<UpdateLngInventoryOutDto>() {
|
||||
|
||||
@Override
|
||||
public UpdateLngInventoryOutDto before(DataOperationContent<UpdateLngInventoryOutDto> content) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public UpdateLngInventoryOutDto after(DataOperationContent<UpdateLngInventoryOutDto> 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("I"));
|
||||
}else {
|
||||
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();
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
@DeleteMapping
|
||||
@ApiOperation(value = "删除")
|
||||
@SaCheckPermission("lngInventoryOut:delete")
|
||||
public R delete(@Valid @RequestBody List<Long> ids){
|
||||
return R.ok(dataService.deleteByIds(UpdateLngInventoryOutDto.class, ids));
|
||||
return R.ok(dataService.deleteByIds(UpdateLngInventoryOutDto.class, ids,new DataOperationListener<UpdateLngInventoryOutDto>() {
|
||||
|
||||
@Override
|
||||
public UpdateLngInventoryOutDto before(DataOperationContent<UpdateLngInventoryOutDto> content) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public UpdateLngInventoryOutDto after(DataOperationContent<UpdateLngInventoryOutDto> content) {
|
||||
|
||||
String sql = StringUtils.format("{? = call pc_{0}.f_before_delete(?)}",
|
||||
content.getTableName());
|
||||
List<JdbcParam> params = Lists.newArrayList();
|
||||
JdbcParam outParam = JdbcParam.ofString(null).setOut(true);
|
||||
params.add(outParam);
|
||||
params.add(JdbcParam.ofLong(content.getIdValue()));
|
||||
|
||||
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();
|
||||
}
|
||||
}));
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -21,12 +21,13 @@ public interface LngInventoryInMapper extends BaseMapper<LngInventoryIn> {
|
||||
@Select("SELECT ii.*, dd_ii.name AS type_name, "+
|
||||
" opi.ss_no AS ssNo , sl.full_name AS staName , "+
|
||||
" k.k_name AS k_name ,"+
|
||||
" su.su_name AS su_name , "+
|
||||
" su.su_name AS su_name ,bc.full_name as cat_name, "+
|
||||
" NVL(com.short_name,com.name) AS com_name "+
|
||||
" FROM lng_inventory_in ii "+
|
||||
" LEFT JOIN lng_ops_pur_int opi ON opi.id=ii.ops_id "+
|
||||
" LEFT JOIN lng_contract k ON k.id=ii.k_id "+
|
||||
" LEFT JOIN lng_supplier su ON su.su_code=ii.su_code "+
|
||||
" LEFT JOIN lng_b_category bc on bc.code=ii.cat_code "+
|
||||
" LEFT JOIN xjr_dictionary_item di_ii on di_ii.code='LNG_INV_I' "+
|
||||
" LEFT JOIN xjr_dictionary_detail dd_ii on dd_ii.item_id=di_ii.id AND dd_ii.code=ii.type_code "+
|
||||
" LEFT JOIN lng_b_station_lng sl ON sl.code=ii.sta_code "+
|
||||
|
||||
@ -20,11 +20,12 @@ public interface LngInventoryOutMapper extends BaseMapper<LngInventoryOut> {
|
||||
|
||||
|
||||
@Select("SELECT io.*, sl.full_name AS staName ,"+
|
||||
" k.k_name as kName , "+
|
||||
" k.k_name as kName , bc.full_name as cat_name,"+
|
||||
" cu.cu_name as cuName ,NVL(com.short_name,com.name) AS com_name "+
|
||||
" FROM lng_inventory_out io "+
|
||||
" LEFT JOIN lng_contract k ON k.id=io.k_id "+
|
||||
" LEFT JOIN lng_contract k ON k.id=io.k_id"+
|
||||
" LEFT JOIN lng_customer cu ON cu.cu_code=io.cu_code "+
|
||||
" LEFT JOIN lng_b_category bc on bc.code=ii.cat_code "+
|
||||
" LEFT JOIN lng_b_station_lng sl ON sl.code=io.sta_code "+
|
||||
" LEFT JOIN xjr_department com ON com.id=io.com_id "+
|
||||
" WHERE io.id = #{id}")
|
||||
|
||||
Reference in New Issue
Block a user