diff --git a/src/main/java/com/glxp/api/ApiAdminApplication.java b/src/main/java/com/glxp/api/ApiAdminApplication.java index 0b10ac59..8311440d 100644 --- a/src/main/java/com/glxp/api/ApiAdminApplication.java +++ b/src/main/java/com/glxp/api/ApiAdminApplication.java @@ -1,5 +1,6 @@ package com.glxp.api; +import org.mybatis.spring.annotation.MapperScan; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.builder.SpringApplicationBuilder; @@ -9,6 +10,7 @@ import org.springframework.boot.web.servlet.support.SpringBootServletInitializer @SpringBootApplication @ServletComponentScan +@MapperScan("com.glxp.api.dao") public class ApiAdminApplication extends SpringBootServletInitializer { diff --git a/src/main/java/com/glxp/api/controller/basic/BasicBussinessTypeController.java b/src/main/java/com/glxp/api/controller/basic/BasicBussinessTypeController.java index 8b063898..3491d648 100644 --- a/src/main/java/com/glxp/api/controller/basic/BasicBussinessTypeController.java +++ b/src/main/java/com/glxp/api/controller/basic/BasicBussinessTypeController.java @@ -1,5 +1,6 @@ package com.glxp.api.controller.basic; +import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.util.StrUtil; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; @@ -8,6 +9,7 @@ import com.glxp.api.common.enums.ResultEnum; import com.glxp.api.common.res.BaseResponse; import com.glxp.api.common.util.ResultVOUtils; import com.glxp.api.entity.basic.BasicBussinessTypeEntity; +import com.glxp.api.req.basic.BussinessTypeSaveRequest; import com.glxp.api.req.basic.FilterBussinessTypeRequest; import com.glxp.api.req.system.DeleteRequest; import com.glxp.api.res.basic.BasicBussinessTypeResponse; @@ -24,6 +26,7 @@ import org.springframework.web.multipart.MultipartFile; import javax.annotation.Resource; import javax.servlet.http.HttpServletResponse; +import javax.validation.Valid; import java.io.IOException; import java.io.InputStream; import java.nio.charset.StandardCharsets; @@ -56,19 +59,21 @@ public class BasicBussinessTypeController { /** * 新增单据类型 * - * @param bussinessTypeEntity 单据类型数据 + * @param bussinessTypeSaveRequest 单据类型数据 * @param bindingResult * @return */ - @PostMapping("/udiwms/bussinessType/insert") - public BaseResponse insertBussinessType(@RequestBody BasicBussinessTypeEntity bussinessTypeEntity, BindingResult bindingResult) { + @PostMapping(value = "/udiwms/bussinessType/insert") + public BaseResponse insertBussinessType(@RequestBody @Valid BussinessTypeSaveRequest bussinessTypeSaveRequest, BindingResult bindingResult) { if (bindingResult.hasErrors()) { return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage()); } - if (bussinessTypeEntity != null) { - bussinessTypeEntity.setAction("SC" + CustomUtil.getId()); - basicBussinessTypeService.insertBussinessType(bussinessTypeEntity); + if (bussinessTypeSaveRequest != null) { + bussinessTypeSaveRequest.setAction("SC" + CustomUtil.getId()); + BasicBussinessTypeEntity basicBussinessTypeEntity = new BasicBussinessTypeEntity(); + BeanUtil.copyProperties(bussinessTypeSaveRequest, basicBussinessTypeEntity); + basicBussinessTypeService.insertBussinessType(basicBussinessTypeEntity); } else { ResultVOUtils.error(999, "参数错误"); } @@ -83,13 +88,15 @@ public class BasicBussinessTypeController { * @return */ @PostMapping("/udiwms/bussinessType/update") - public BaseResponse updateBussinessType(@RequestBody BasicBussinessTypeEntity bussinessTypeEntity, + public BaseResponse updateBussinessType(@RequestBody BussinessTypeSaveRequest bussinessTypeSaveRequest, BindingResult bindingResult) { if (bindingResult.hasErrors()) { return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage()); } - if (bussinessTypeEntity != null) { - basicBussinessTypeService.updateBussinessType(bussinessTypeEntity); + if (bussinessTypeSaveRequest != null) { + BasicBussinessTypeEntity basicBussinessTypeEntity = new BasicBussinessTypeEntity(); + BeanUtil.copyProperties(bussinessTypeSaveRequest, basicBussinessTypeEntity); + basicBussinessTypeService.updateBussinessType(basicBussinessTypeEntity); } else { ResultVOUtils.error(999, "参数错误"); } diff --git a/src/main/java/com/glxp/api/dao/basic/BasicBussinessTypeDao.java b/src/main/java/com/glxp/api/dao/basic/BasicBussinessTypeDao.java index 0776db71..73aa8f31 100644 --- a/src/main/java/com/glxp/api/dao/basic/BasicBussinessTypeDao.java +++ b/src/main/java/com/glxp/api/dao/basic/BasicBussinessTypeDao.java @@ -34,5 +34,5 @@ public interface BasicBussinessTypeDao extends BaseMapper selectList(FilterBussinessTypeRequest bussinessTypeFilterRequest); + List selectBusList(FilterBussinessTypeRequest bussinessTypeFilterRequest); } diff --git a/src/main/java/com/glxp/api/entity/basic/BasicBussinessTypeEntity.java b/src/main/java/com/glxp/api/entity/basic/BasicBussinessTypeEntity.java index a1d36e1d..de618949 100644 --- a/src/main/java/com/glxp/api/entity/basic/BasicBussinessTypeEntity.java +++ b/src/main/java/com/glxp/api/entity/basic/BasicBussinessTypeEntity.java @@ -1,6 +1,7 @@ package com.glxp.api.entity.basic; import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import lombok.Data; @@ -23,265 +24,318 @@ public class BasicBussinessTypeEntity { /** * 主类型(出库,入库) */ + @TableField(value = "mainAction") private String mainAction; /** * 业务类型 */ + @TableField(value = "action") private String action; /** * 业务名称 */ + @TableField(value = "name") private String name; /** * 是否启用, 0:未启用 1:启用 */ - private Boolean enable; + @TableField(value = "enable") + private boolean enable; /** * 备注 */ + @TableField(value = "remark") private String remark; /** * 第三方系统外键 */ + @TableField(value = "thirdSysFk") private String thirdSysFk; /** * 是否自动生成往来单位:1.是;2.否 */ - private Boolean genUnit; + @TableField(value = "genUnit") + private boolean genUnit; /** * 是否是内部单据:1.是;0:否 */ - private Boolean innerOrder; + @TableField(value = "innerOrder") + private boolean innerOrder; /** * 是否二次验收 */ - private Boolean secCheckEnable; + @TableField(value = "secCheckEnable") + private boolean secCheckEnable; /** * 是否根据业务单据类型校验 */ - private Boolean checkEnable; + @TableField(value = "checkEnable") + private boolean checkEnable; /** * UDIMS平台来源是否需要校验 */ - private Boolean checkUdims; + @TableField(value = "checkUdims") + private boolean checkUdims; /** * pda已校验单据 */ - private Boolean checkPdaEd; + @TableField(value = "checkPdaEd") + private boolean checkPdaEd; /** * pda未检验单据 */ - private Boolean checkPdaUn; + @TableField(value = "checkPdaUn") + private boolean checkPdaUn; /** * PC端扫码精灵 */ - private Boolean checkPc; + @TableField(value = "checkPc") + private boolean checkPc; /** * web前端页面新增单据 */ - private Boolean checkWebNew; + @TableField(value = "checkWebNew") + private boolean checkWebNew; /** * 供应商平台导出单据 */ - private Boolean checkSp; + @TableField(value = "checkSp") + private boolean checkSp; /** * 流转生成单据 */ - private Boolean checkChange; + @TableField(value = "checkChange") + private boolean checkChange; /** * UDIMS平台单据 二次校验 */ - private Boolean secCheckUdims; + @TableField(value = "secCheckUdims") + private boolean secCheckUdims; /** * 手持终端已校验单据 二次校验 */ - private Boolean secCheckPdaEd; + @TableField(value = "secCheckPdaEd") + private boolean secCheckPdaEd; /** * 手持终端未校验单据 二次校验 */ - private Boolean secCheckPdaUn; + @TableField(value = "secCheckPdaUn") + private boolean secCheckPdaUn; /** * UDI扫码通 二次校验 */ - private Boolean secCheckPc; + @TableField(value = "secCheckPc") + private boolean secCheckPc; /** * web端新增单据 二次复核 */ - private Boolean secCheckWebNew; + @TableField(value = "secCheckWebNew") + private boolean secCheckWebNew; /** * 自动补单二次复核 */ - private Boolean secCheckChange; + @TableField(value = "secCheckChange") + private boolean secCheckChange; /** * 供应商平台导出单据 */ - private Boolean secCheckSp; + @TableField(value = "secCheckSp") + private boolean secCheckSp; /** * 往来单位类型 */ - private Boolean corpType; + @TableField(value = "corpType") + private int corpType; /** * 补单扫码单据类型 */ + @TableField(value = "supplementOrderType") private String supplementOrderType; /** * 平衡补单是否校验 */ - private Boolean checkBalance; + @TableField(value = "checkBalance") + private boolean checkBalance; /** * 平衡补单是否二次验收 */ - private Boolean secCheckBalance; + @TableField(value = "secCheckBalance") + private boolean secCheckBalance; /** * 允许科室多次使用出库 */ - private Boolean useDyCount; + @TableField(value = "useDyCount") + private boolean useDyCount; /** * 到期提示 */ - private Boolean expireTip; + @TableField(value = "expireTip") + private boolean expireTip; /** * 更新时间 */ + @TableField(value = "updateTime") private Date updateTime; /** * 默认往来单位 */ + @TableField(value = "defaultUnit") private String defaultUnit; /** * 创建单据前缀 */ + @TableField(value = "prefix") private String prefix; /** * 出库是否直接上传至自助平台 */ - private Boolean outToSpms; + @TableField(value = "outToSpms") + private boolean outToSpms; /** * 允许出库自动缺量补单 */ - private Boolean ullageFill; + @TableField(value = "ullageFill") + private boolean ullageFill; /** * 是否只采集预验收产品 */ - private Boolean scanPreIn; + @TableField(value = "scanPreIn") + private boolean scanPreIn; /** * 是否访问库存 */ - private Boolean vailInv; + @TableField(value = "vailInv") + private boolean vailInv; /** * 允许验收自助平台单据 */ - private Boolean entrutSpms; + @TableField(value = "entrutSpms") + private boolean entrutSpms; /** * 是否强制三期校验 */ - private Boolean codeFillCheck; + @TableField(value = "codeFillCheck") + private boolean codeFillCheck; /** * 默认分库 */ + @TableField(value = "defaultSubInv") private String defaultSubInv; /** * 默认仓库 */ + @TableField(value = "defaultInv") private String defaultInv; /** * 订单详情展示方式:0:根据批次号展示,1:根据条码展示 */ - private Boolean orderVisibleType; + @TableField(value = "orderVisibleType") + private boolean orderVisibleType; /** * 是否校验复制单据 */ - private Boolean checkCopy; + @TableField(value = "checkCopy") + private boolean checkCopy; /** * 是否二次校验复制单据 */ - private Boolean secCheckCopy; + @TableField(value = "secCheckCopy") + private boolean secCheckCopy; /** * 第三方系统单据类型 */ + @TableField(value = "originAction") private String originAction; /** * 是否预入库 */ - private Boolean advanceType; + @TableField(value = "advanceType") + private boolean advanceType; /** * 是否流转 */ - private Boolean changeEnable; + @TableField(value = "changeEnable") + private boolean changeEnable; /** * 是否供应商使用 */ - private Boolean spUse; + @TableField(value = "spUse") + private boolean spUse; /** * 是否预验收单据类型 */ - private Boolean preIn; + @TableField(value = "preIn") + private boolean preIn; /** * 缺量补单是否全量补单 */ - private Boolean supplementAll; + @TableField(value = "supplementAll") + private boolean supplementAll; /** * 创建人 */ + @TableField(value = "createUser") private String createUser; /** * 更新人 */ + @TableField(value = "updateUser") private String updateUser; /** * 创建时间 */ + @TableField(value = "createTime") private Date createTime; } \ No newline at end of file diff --git a/src/main/java/com/glxp/api/req/basic/BussinessTypeSaveRequest.java b/src/main/java/com/glxp/api/req/basic/BussinessTypeSaveRequest.java new file mode 100644 index 00000000..9c08a7da --- /dev/null +++ b/src/main/java/com/glxp/api/req/basic/BussinessTypeSaveRequest.java @@ -0,0 +1,275 @@ +package com.glxp.api.req.basic; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.util.Date; + +/** + * 添加单据类型请求参数 + */ +@Data +public class BussinessTypeSaveRequest { + + + /** + * id + */ + private Long id; + + /** + * 主类型(出库,入库) + */ + @NotBlank(message = "请选择出入库类型") + private String mainAction; + + /** + * 业务类型 + */ + private String action; + + /** + * 业务名称 + */ + @NotBlank(message = "请输入单据类型名称") + private String name; + + /** + * 是否启用, 0:未启用 1:启用 + */ + private Boolean enable; + + /** + * 备注 + */ + private String remark; + + /** + * 第三方系统外键 + */ + private String thirdSysFk; + + /** + * 是否自动生成往来单位:1.是;2.否 + */ + private Boolean genUnit; + + /** + * 是否是内部单据:1.是;0:否 + */ + private Boolean innerOrder; + + /** + * 是否二次验收 + */ + private Boolean secCheckEnable; + + /** + * 是否根据业务单据类型校验 + */ + private Boolean checkEnable; + + /** + * UDIMS平台来源是否需要校验 + */ + private Boolean checkUdims; + + /** + * pda已校验单据 + */ + private Boolean checkPdaEd; + + /** + * pda未检验单据 + */ + private Boolean checkPdaUn; + + /** + * PC端扫码精灵 + */ + private Boolean checkPc; + + /** + * web前端页面新增单据 + */ + private Boolean checkWebNew; + + /** + * 供应商平台导出单据 + */ + private Boolean checkSp; + + /** + * 流转生成单据 + */ + private Boolean checkChange; + + /** + * UDIMS平台单据 二次校验 + */ + private Boolean secCheckUdims; + + /** + * 手持终端已校验单据 二次校验 + */ + private Boolean secCheckPdaEd; + + /** + * 手持终端未校验单据 二次校验 + */ + private Boolean secCheckPdaUn; + + /** + * UDI扫码通 二次校验 + */ + private Boolean secCheckPc; + + /** + * web端新增单据 二次复核 + */ + private Boolean secCheckWebNew; + + /** + * 自动补单二次复核 + */ + private Boolean secCheckChange; + + /** + * 供应商平台导出单据 + */ + private Boolean secCheckSp; + + /** + * 往来单位类型 + */ + @NotNull(message = "请选择往来信息类型") + private Integer corpType; + + /** + * 补单扫码单据类型 + */ + private String supplementOrderType; + + /** + * 平衡补单是否校验 + */ + private Boolean checkBalance; + + /** + * 平衡补单是否二次验收 + */ + private Boolean secCheckBalance; + + /** + * 允许科室多次使用出库 + */ + private Boolean useDyCount; + + /** + * 到期提示 + */ + private Boolean expireTip; + + /** + * 更新时间 + */ + private Date updateTime; + + /** + * 默认往来单位 + */ + private String defaultUnit; + + /** + * 创建单据前缀 + */ + private String prefix; + + /** + * 出库是否直接上传至自助平台 + */ + private Boolean outToSpms; + + /** + * 允许出库自动缺量补单 + */ + private Boolean ullageFill; + + /** + * 是否只采集预验收产品 + */ + private Boolean scanPreIn; + + /** + * 是否访问库存 + */ + private Boolean vailInv; + + /** + * 允许验收自助平台单据 + */ + private Boolean entrutSpms; + + /** + * 是否强制三期校验 + */ + private Boolean codeFillCheck; + + /** + * 默认分库 + */ + private String defaultSubInv; + + /** + * 默认仓库 + */ + private String defaultInv; + + /** + * 订单详情展示方式:0:根据批次号展示,1:根据条码展示 + */ + private Boolean orderVisibleType; + + /** + * 是否校验复制单据 + */ + private Boolean checkCopy; + + /** + * 是否二次校验复制单据 + */ + private Boolean secCheckCopy; + + /** + * 第三方系统单据类型 + */ + private String originAction; + + /** + * 是否预入库 + */ + private Boolean advanceType; + + /** + * 是否流转 + */ + private Boolean changeEnable; + + /** + * 是否供应商使用 + */ + private Boolean spUse; + + /** + * 是否预验收单据类型 + */ + private Boolean preIn; + + /** + * 缺量补单是否全量补单 + */ + private Boolean supplementAll; + + +} diff --git a/src/main/java/com/glxp/api/service/basic/impl/BasicBussinessTypeServiceImpl.java b/src/main/java/com/glxp/api/service/basic/impl/BasicBussinessTypeServiceImpl.java index ce814014..425b25bb 100644 --- a/src/main/java/com/glxp/api/service/basic/impl/BasicBussinessTypeServiceImpl.java +++ b/src/main/java/com/glxp/api/service/basic/impl/BasicBussinessTypeServiceImpl.java @@ -99,7 +99,7 @@ public class BasicBussinessTypeServiceImpl implements IBasicBussinessTypeService @Override public List findList(FilterBussinessTypeRequest bussinessTypeFilterRequest) { //构造查询参数 - return basicBussinessTypeDao.selectList(bussinessTypeFilterRequest); + return basicBussinessTypeDao.selectBusList(bussinessTypeFilterRequest); } @Override diff --git a/src/main/resources/mybatis/mapper/basic/BasicBussinessTypeDao.xml b/src/main/resources/mybatis/mapper/basic/BasicBussinessTypeDao.xml index 636ff020..96e501e1 100644 --- a/src/main/resources/mybatis/mapper/basic/BasicBussinessTypeDao.xml +++ b/src/main/resources/mybatis/mapper/basic/BasicBussinessTypeDao.xml @@ -118,7 +118,7 @@ ) - select * from basic_bussiness_type bu