国际采购计量
This commit is contained in:
@ -24,7 +24,17 @@ public class LngMeaPurIntVo extends com.xjrsoft.common.model.base.BaseModel{
|
||||
@ApiModelProperty("主键")
|
||||
private Long id;
|
||||
|
||||
private String kName;
|
||||
|
||||
private String kNo;
|
||||
|
||||
private String ssNo;
|
||||
|
||||
private String suCode;
|
||||
|
||||
private String suName;
|
||||
|
||||
private String ssTypeName;
|
||||
/**
|
||||
* 执行ID
|
||||
*/
|
||||
|
||||
@ -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.ship.dto.LngMeaPurIntPageDto;
|
||||
import com.xjrsoft.module.ship.dto.UpdateLngMeaPurIntDto;
|
||||
import com.xjrsoft.module.ship.dto.UpdateLngOpsPurIntDto;
|
||||
import com.xjrsoft.module.ship.entity.LngMeaPurInt;
|
||||
import com.xjrsoft.module.ship.service.IMeaPurIntService;
|
||||
import com.xjrsoft.module.ship.vo.LngMeaPurIntPageVo;
|
||||
@ -100,15 +110,69 @@ public class MeaPurIntController {
|
||||
@ApiOperation(value = "新增LngMeaPurInt")
|
||||
@SaCheckPermission("meaPurInt:add")
|
||||
public R add(@Valid @RequestBody UpdateLngMeaPurIntDto dto){
|
||||
UpdateLngMeaPurIntDto res = dataService.insert(dto);
|
||||
return R.ok(res.getId());
|
||||
return R.ok(dataService.insert(dto, new DataOperationListener<UpdateLngMeaPurIntDto>() {
|
||||
@Override
|
||||
public UpdateLngMeaPurIntDto before(DataOperationContent<UpdateLngMeaPurIntDto> content) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public UpdateLngMeaPurIntDto after(DataOperationContent<UpdateLngMeaPurIntDto> 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();
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@ApiOperation(value = "修改LngMeaPurInt")
|
||||
@SaCheckPermission("meaPurInt:edit")
|
||||
public R update(@Valid @RequestBody UpdateLngMeaPurIntDto dto){
|
||||
return R.ok(dataService.updateById(dto));
|
||||
|
||||
return R.ok(dataService.updateById(dto, new DataOperationListener<UpdateLngMeaPurIntDto>() {
|
||||
@Override
|
||||
public UpdateLngMeaPurIntDto before(DataOperationContent<UpdateLngMeaPurIntDto> content) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public UpdateLngMeaPurIntDto after(DataOperationContent<UpdateLngMeaPurIntDto> 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
|
||||
|
||||
@ -1,9 +1,13 @@
|
||||
package com.xjrsoft.module.ship.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.github.yulichang.base.MPJBaseMapper;
|
||||
import com.xjrsoft.module.ship.entity.LngMeaPurInt;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.xjrsoft.module.ship.entity.LngMeaPurInt;
|
||||
import com.xjrsoft.module.ship.vo.LngMeaPurIntVo;
|
||||
import com.xjrsoft.module.ship.vo.LngShipScheduleVo;
|
||||
|
||||
/**
|
||||
* @title: mapper
|
||||
@ -14,4 +18,17 @@ import org.apache.ibatis.annotations.Mapper;
|
||||
@Mapper
|
||||
public interface LngMeaPurIntMapper extends BaseMapper<LngMeaPurInt> {
|
||||
|
||||
@Select("SELECT mpi.*,k.k_name,k.K_no,NVL(com.short_name,com.name) AS com_name ,"
|
||||
+ " opi.ss_no,opi.su_code,opi.su_name,"
|
||||
+ " sl.full_name AS sta_name, dd_m.name AS ss_type_name"
|
||||
+ " FROM lng_mea_pur_int mpi "
|
||||
+ " LEFT JOIN lng_ops_pur_int opi ON opi.id=mpi.ops_id "
|
||||
+ " LEFT JOIN lng_contract k ON k.id=opi.k_id "
|
||||
+ " LEFT JOIN lng_b_station_lng sl ON sl.code=opi.sta_code "
|
||||
+ " LEFT JOIN xjr_dictionary_item di_m on di_m.code='LNG_MEA_I' "
|
||||
+ " LEFT JOIN xjr_dictionary_detail dd_m on dd_m.item_id=di_m.id AND dd_m.code=mpi.type_code "
|
||||
+ " LEFT JOIN xjr_department com on com.id=opi.com_id "
|
||||
+ " WHERE mpi.id = #{id}")
|
||||
LngMeaPurIntVo getInfoBygId(@Param("id") Long id);
|
||||
|
||||
}
|
||||
|
||||
@ -8,11 +8,9 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.pictc.enums.BusinessCode;
|
||||
import com.xjrsoft.common.exception.BusinessException;
|
||||
import com.xjrsoft.module.ship.entity.LngMeaPurInt;
|
||||
import com.xjrsoft.module.ship.entity.LngOpsPurInt;
|
||||
import com.xjrsoft.module.ship.mapper.LngMeaPurIntMapper;
|
||||
import com.xjrsoft.module.ship.service.IMeaPurIntService;
|
||||
import com.xjrsoft.module.ship.vo.LngMeaPurIntVo;
|
||||
import com.xjrsoft.module.ship.vo.LngOpsPurIntVo;
|
||||
import com.xjrsoft.module.system.client.IFileClient;
|
||||
import com.xjrsoft.module.system.vo.LngFileUploadVo;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user