| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
| | | import com.vci.ubcs.code.dto.CodeBasicSecDTO; |
| | | import com.vci.ubcs.code.dto.CodeOrderDTO; |
| | | import com.vci.ubcs.code.dto.CodeRuleDTO; |
| | | import com.vci.ubcs.code.entity.CodeBasicSec; |
| | | import com.vci.ubcs.code.service.ICodeBasicSecService; |
| | | import com.vci.ubcs.code.vo.pagemodel.CodeBasicSecVO; |
| | | import com.vci.ubcs.code.vo.pagemodel.CodeRuleVO; |
| | | import com.vci.ubcs.code.wrapper.CodeBasicSecWrapper; |
| | | import com.vci.ubcs.starter.exception.VciBaseException; |
| | | import com.vci.ubcs.starter.web.pagemodel.BladeQueryObject; |
| | | import com.vci.ubcs.starter.web.util.VciBaseUtil; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.validation.Valid; |
| | | import java.rmi.ServerException; |
| | | import java.util.Collection; |
| | | import java.util.List; |
| | | |
| | |
| | | @Autowired |
| | | private ICodeBasicSecService codeBasicSecService; |
| | | |
| | | /** |
| | | * 编码规则 分页 |
| | | */ |
| | | @GetMapping("/list") |
| | | @ApiOperationSupport(order = 1) |
| | | @ApiOperation(value = "分页", notes = "传入codeRuleVO") |
| | | public R<IPage<CodeBasicSecVO>> list(CodeBasicSec codeBasicSec, Query query) { |
| | | IPage<CodeBasicSec> pages = codeBasicSecService.page(Condition.getPage(query), Condition.getQueryWrapper(codeBasicSec)); |
| | | return R.data(CodeBasicSecWrapper.build().pageVO(pages)); |
| | | } |
| | | |
| | | /** |
| | | * 码段基础信息列表 |
| | | * @param codeBasicSecVO 基础查询对象,包含查询条件,分页,排序等 |
| | | * @param bladeQueryObject 基础查询对象,包含查询条件,分页,排序等 |
| | | * @return 码段基础信息显示对象列表 |
| | | */ |
| | | @GetMapping("/gridCodeBasicSec") |
| | | @ApiOperationSupport(order = 2) |
| | | @ApiOperation(value = "分页 码段基础信息列表", notes = "传入codeRuleVO") |
| | | public R<IPage<CodeBasicSecVO>> gridCodeBasicSec(CodeBasicSecVO codeBasicSecVO, Query query){ |
| | | IPage<CodeBasicSecVO> codeRuleVOIPage = codeBasicSecService.gridCodeBasicSec(Condition.getPage(query.setAscs("ordernum")),codeBasicSecVO); |
| | | public R<IPage<CodeBasicSecVO>> gridCodeBasicSec(BladeQueryObject bladeQueryObject) throws Exception{ |
| | | IPage<CodeBasicSecVO> codeRuleVOIPage = codeBasicSecService.gridCodeBasicSec(bladeQueryObject.getQuery().setAscs("ordernum"),bladeQueryObject.getConditionMap()); |
| | | return R.data(codeRuleVOIPage); |
| | | } |
| | | |
| | |
| | | @PostMapping( "/addSave") |
| | | @ApiOperationSupport(order = 3) |
| | | @ApiOperation(value = "增加 码段基础信息", notes = "codeBasicSecDTO") |
| | | public R addSave(@RequestBody CodeBasicSecDTO codeBasicSecDTO){ |
| | | public R addSave(@Valid @RequestBody CodeBasicSecDTO codeBasicSecDTO){ |
| | | boolean resBoolean; |
| | | try { |
| | | resBoolean = codeBasicSecService.addSave(codeBasicSecDTO); |
| | |
| | | |
| | | /** |
| | | * 参照码段基础信息列表 |
| | | * @param codeBasicSecVO 基础查询对象,包含查询条件,分页,排序等 |
| | | * @param bladeQueryObject 基础查询对象,包含查询条件,分页,排序等 |
| | | * @return 码段基础信息显示对象列表,生效的内容 |
| | | */ |
| | | @GetMapping("/refDataGrid") |
| | | @ApiOperationSupport(order = 8) |
| | | @ApiOperation(value = "参照码段基础信息列表", notes = "codeBasicSecVO") |
| | | public R<IPage<CodeBasicSecVO>> refDataGridCodeBasicSec(CodeBasicSecVO codeBasicSecVO, Query query){ |
| | | return R.data(codeBasicSecService.refDataGridCodeBasicSec(Condition.getPage(query),codeBasicSecVO)); |
| | | public R<IPage<CodeBasicSecVO>> refDataGridCodeBasicSec(BladeQueryObject bladeQueryObject){ |
| | | return R.data(codeBasicSecService.refDataGridCodeBasicSec(bladeQueryObject.getQuery(), bladeQueryObject.getConditionMap())); |
| | | } |
| | | |
| | | /** |
| | | * 参数分类码段基础信息列表 |
| | | * @param codeBasicSecVO 基础查询对象,包含查询条件,分页,排序等,必须要有编码规则的主键 pkCodeRule |
| | | * @param bladeQueryObject 基础查询对象,包含查询条件,分页,排序等,必须要有编码规则的主键 pkCodeRule |
| | | * @return 码段的信息 |
| | | */ |
| | | @GetMapping("/refDataGridClassifySec") |
| | | @ApiOperationSupport(order = 9) |
| | | @ApiOperation(value = "参数分类码段基础信息列表", notes = "codeBasicSecVO") |
| | | public R<IPage<CodeBasicSecVO>> refDataGridClassifySec(CodeBasicSecVO codeBasicSecVO, Query query){ |
| | | return R.data(codeBasicSecService.refDataGridClassifySec(Condition.getPage(query.setAscs("ordernum")), codeBasicSecVO)); |
| | | public R<IPage<CodeBasicSecVO>> refDataGridClassifySec(BladeQueryObject bladeQueryObject){ |
| | | return R.data(codeBasicSecService.refDataGridClassifySec(bladeQueryObject.getQuery(), bladeQueryObject.getConditionMap())); |
| | | } |
| | | |
| | | /** |
| | |
| | | @PostMapping("/clone") |
| | | @ApiOperationSupport(order = 10) |
| | | @ApiOperation(value = "克隆码段信息", notes = "codeBasicSecDTO") |
| | | public R cloneCodeBasicSec(@RequestBody CodeBasicSecDTO codeBasicSecDTO){ |
| | | public R cloneCodeBasicSec(@RequestBody CodeBasicSecDTO codeBasicSecDTO) throws ServerException { |
| | | VciBaseUtil.alertNotNull(codeBasicSecDTO.getOidArr(),"选择码段主键"); |
| | | List<String> oidArr = VciBaseUtil.str2List(codeBasicSecDTO.getOidArr()); |
| | | if (CollectionUtils.isEmpty(oidArr)){ |
| | |
| | | return R.status(codeBasicSecService.downOrderNum(oid)); |
| | | } |
| | | |
| | | /** |
| | | * 查询编码规则的所有流水依赖的码段 |
| | | * @param ruleOid 编码规则主键 |
| | | * @return |
| | | */ |
| | | @GetMapping("/getCodeRuleAndBasicSecByRuleOid") |
| | | @ApiOperationSupport(order = 13) |
| | | @ApiOperation(value = "查询编码规则的所有流水依赖的码段", notes = "传入oid") |
| | | public R<CodeRuleVO> getCodeRuleAndBasicSecByRuleOid(String ruleOid){ |
| | | return R.data(codeBasicSecService.getSerialNumberDepend(ruleOid)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 设置最大流水号 |
| | | * @param codeOrderDTO 编码申请传输对象 |
| | | * @return |
| | | */ |
| | | @PostMapping("/setMaxSerialNumberForCodeRule") |
| | | @ApiOperationSupport(order = 14) |
| | | @ApiOperation(value = "设置最大流水号", notes = "codeOrderDTO") |
| | | public R setMaxSerialNumberForCodeRule(@RequestBody CodeOrderDTO codeOrderDTO){ |
| | | return R.success(codeBasicSecService.setMaxSerialNumberForCodeRule(codeOrderDTO)); |
| | | } |
| | | } |