Browse Source

收件信息

haogh 10 months ago
parent
commit
61a0ea2612

+ 88 - 0
sop-api/src/main/java/com/qmth/sop/server/api/SysCustomReceiverController.java

@@ -0,0 +1,88 @@
+package com.qmth.sop.server.api;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.qmth.boot.api.constant.ApiConstant;
+import com.qmth.sop.business.bean.params.CustomReceiverParam;
+import com.qmth.sop.business.bean.result.SysCustomReceiverResult;
+import com.qmth.sop.business.entity.SysCustomReceiver;
+import com.qmth.sop.business.entity.SysUser;
+import com.qmth.sop.business.service.SysCustomReceiverService;
+import com.qmth.sop.common.annotation.OperationLog;
+import com.qmth.sop.common.contant.SystemConstant;
+import com.qmth.sop.common.enums.LogTypeEnum;
+import com.qmth.sop.common.enums.ProductTypeEnum;
+import com.qmth.sop.common.util.Result;
+import com.qmth.sop.common.util.ResultUtil;
+import com.qmth.sop.common.util.ServletUtil;
+import io.swagger.annotations.*;
+import org.springframework.validation.BindingResult;
+import org.springframework.web.bind.annotation.*;
+
+import javax.annotation.Resource;
+import javax.validation.Valid;
+import javax.validation.constraints.Max;
+import javax.validation.constraints.Min;
+
+/**
+ * @Description 客户收件信息控制类
+ * @Author haoguanghui
+ * @date 2024/09/04
+ */
+@Api(tags = "客户收件信息表Controller")
+@RestController
+@RequestMapping(ApiConstant.DEFAULT_URI_PREFIX + SystemConstant.PREFIX_URL_CUSTOM_RECEIVER)
+public class SysCustomReceiverController {
+
+    @Resource
+    SysCustomReceiverService sysCustomReceiverService;
+
+
+    @ApiOperation(value = "客户列表")
+    @RequestMapping(value = "/list", method = RequestMethod.POST)
+    @ApiResponses({ @ApiResponse(code = 200, message = "返回信息", response = SysCustomReceiver.class) })
+    public Result list(@ApiParam(value = "客户类型", required = false) @RequestParam(required = false) ProductTypeEnum type) {
+        return ResultUtil.ok(sysCustomReceiverService.listCustom(type));
+    }
+
+    @ApiOperation(value = "收件信息分页")
+    @RequestMapping(value = "/page", method = RequestMethod.POST)
+    @ApiResponses({ @ApiResponse(code = 200, message = "收件信息分页", response = SysCustomReceiverResult.class) })
+    public Result page(
+            @ApiParam(value = "客户类型", required = false) @RequestParam(required = false) ProductTypeEnum type,
+            @ApiParam(value = "客户名称", required = false) @RequestParam(required = false) String name,
+            @ApiParam(value = "分页页码", required = true) @RequestParam @Min(SystemConstant.PAGE_NUMBER_MIN) Integer pageNumber,
+            @ApiParam(value = "分页数", required = true) @RequestParam @Min(SystemConstant.PAGE_SIZE_MIN) @Max(SystemConstant.PAGE_SIZE_MAX) Integer pageSize) {
+        return ResultUtil.ok(sysCustomReceiverService.pageReceiver(new Page<>(pageNumber, pageSize), type, name));
+    }
+
+    @ApiOperation(value = "收件信息保存/修改")
+    @RequestMapping(value = "/save", method = RequestMethod.POST)
+    @ApiResponses({ @ApiResponse(code = 200, message = "保存成功", response = Result.class) })
+    @OperationLog(logType = LogTypeEnum.EDIT)
+    public Result saveCustomReceiver(@Valid @RequestBody CustomReceiverParam param, BindingResult bindingResult) {
+        if (bindingResult.hasErrors()) {
+            return ResultUtil.error(bindingResult.getAllErrors().get(0).getDefaultMessage());
+        }
+        SysUser requestUser = (SysUser) ServletUtil.getRequestUser();
+        return ResultUtil.ok(sysCustomReceiverService.saveCustomReceiver(param, requestUser));
+    }
+
+    @ApiOperation(value = "收件信息删除")
+    @RequestMapping(value = "/delete", method = RequestMethod.POST)
+    @ApiResponses({@ApiResponse(code = 200, message = "删除收件信息", response = Object.class)})
+    @OperationLog(logType = LogTypeEnum.DELETE)
+    public Result delete(@ApiParam(value = "id", required = true) @RequestParam(required = true) long id) {
+        sysCustomReceiverService.removeById(id);
+        return ResultUtil.ok();
+    }
+
+    @ApiOperation(value = "收件信息导出")
+    @RequestMapping(value = "/export", method = RequestMethod.POST)
+    @ApiResponses({ @ApiResponse(code = 200, message = "返回信息", response = Object.class) })
+    @OperationLog(logType = LogTypeEnum.EXPORT)
+    public void export(@ApiParam(value = "客户类型", required = false) @RequestParam(required = false) ProductTypeEnum type,
+            @ApiParam(value = "客户名称", required = false) @RequestParam(required = false) String name) throws Exception {
+        sysCustomReceiverService.export(type,name);
+    }
+
+}

+ 96 - 0
sop-business/src/main/java/com/qmth/sop/business/bean/params/CustomReceiverParam.java

@@ -0,0 +1,96 @@
+package com.qmth.sop.business.bean.params;
+
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
+import com.qmth.sop.common.annotation.EditKey;
+import com.qmth.sop.common.enums.ProductTypeEnum;
+import io.swagger.annotations.ApiModelProperty;
+
+import javax.validation.constraints.NotNull;
+
+public class CustomReceiverParam {
+
+    @ApiModelProperty(value = "ID")
+    @JsonSerialize(using = ToStringSerializer.class)
+    @EditKey
+    private Long id;
+
+    @ApiModelProperty(value = "业务类型")
+    @NotNull(message = "请选择业务类型")
+    private ProductTypeEnum type;
+
+    @ApiModelProperty(value = "客户名称")
+    @NotNull(message = "请输入客户名称")
+    private String name;
+
+    @ApiModelProperty(value = "具体单位")
+    private String unit;
+
+    @ApiModelProperty(value = "收件人")
+    @NotNull(message = "请输入收件人")
+    private String consignee;
+
+    @ApiModelProperty(value = "收件人电话")
+    @NotNull(message = "请输入收件人电话")
+    private String consigneePhone;
+
+    @ApiModelProperty(value = "收件人地址")
+    @NotNull(message = "请输入收件人地址")
+    private String consigneeAddress;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public ProductTypeEnum getType() {
+        return type;
+    }
+
+    public void setType(ProductTypeEnum type) {
+        this.type = type;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getUnit() {
+        return unit;
+    }
+
+    public void setUnit(String unit) {
+        this.unit = unit;
+    }
+
+    public String getConsignee() {
+        return consignee;
+    }
+
+    public void setConsignee(String consignee) {
+        this.consignee = consignee;
+    }
+
+    public String getConsigneePhone() {
+        return consigneePhone;
+    }
+
+    public void setConsigneePhone(String consigneePhone) {
+        this.consigneePhone = consigneePhone;
+    }
+
+    public String getConsigneeAddress() {
+        return consigneeAddress;
+    }
+
+    public void setConsigneeAddress(String consigneeAddress) {
+        this.consigneeAddress = consigneeAddress;
+    }
+}

+ 123 - 0
sop-business/src/main/java/com/qmth/sop/business/bean/result/SysCustomReceiverResult.java

@@ -0,0 +1,123 @@
+package com.qmth.sop.business.bean.result;
+
+import com.alibaba.excel.annotation.ExcelIgnore;
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.alibaba.excel.annotation.write.style.ColumnWidth;
+import com.alibaba.excel.annotation.write.style.HeadFontStyle;
+import com.alibaba.excel.annotation.write.style.HeadStyle;
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
+import com.qmth.sop.common.enums.ProductTypeEnum;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.io.Serializable;
+
+/**
+ * @Description 客户收件信息
+ * @Author haoguanghui
+ * @date 2024/09/04
+ */
+@ColumnWidth(value = 30)
+@HeadStyle(fillForegroundColor = 12)
+@HeadFontStyle(color = 1)
+public class SysCustomReceiverResult implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @ApiModelProperty(value = "ID")
+    @JsonSerialize(using = ToStringSerializer.class)
+    @ExcelIgnore
+    private Long id;
+
+    @ApiModelProperty(value = "业务类型")
+    @ExcelIgnore
+    private ProductTypeEnum type;
+
+    @ApiModelProperty(value = "业务类型")
+    @ExcelProperty(value = "业务类型")
+    private String typeName;
+
+    @ApiModelProperty(value = "客户名称")
+    @ExcelProperty(value = "客户名称")
+    private String name;
+
+    @ApiModelProperty(value = "具体单位")
+    @ExcelProperty(value = "具体单位")
+    private String unit;
+
+    @ApiModelProperty(value = "收件人")
+    @ExcelProperty(value = "收件人")
+    private String consignee;
+
+    @ApiModelProperty(value = "收件人电话")
+    @ExcelProperty(value = "收件人电话")
+    private String consigneePhone;
+
+    @ApiModelProperty(value = "收件人地址")
+    @ExcelProperty(value = "收件人地址")
+    private String consigneeAddress;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public ProductTypeEnum getType() {
+        return type;
+    }
+
+    public void setType(ProductTypeEnum type) {
+        this.type = type;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getUnit() {
+        return unit;
+    }
+
+    public void setUnit(String unit) {
+        this.unit = unit;
+    }
+
+    public String getConsignee() {
+        return consignee;
+    }
+
+    public void setConsignee(String consignee) {
+        this.consignee = consignee;
+    }
+
+    public String getConsigneePhone() {
+        return consigneePhone;
+    }
+
+    public void setConsigneePhone(String consigneePhone) {
+        this.consigneePhone = consigneePhone;
+    }
+
+    public String getConsigneeAddress() {
+        return consigneeAddress;
+    }
+
+    public void setConsigneeAddress(String consigneeAddress) {
+        this.consigneeAddress = consigneeAddress;
+    }
+
+    public String getTypeName() {
+        return typeName;
+    }
+
+    public void setTypeName(String typeName) {
+        this.typeName = typeName;
+    }
+}

+ 91 - 0
sop-business/src/main/java/com/qmth/sop/business/entity/SysCustomReceiver.java

@@ -0,0 +1,91 @@
+package com.qmth.sop.business.entity;
+
+import com.qmth.sop.common.base.BaseEntity;
+import com.qmth.sop.common.enums.ProductTypeEnum;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+import javax.validation.constraints.NotBlank;
+import java.io.Serializable;
+
+/**
+ * @Description 客户收件信息表
+ * @Author haoguanghui
+ * @date 2024/09/04
+ */
+@ApiModel(value = "SysCustomReceiver对象", description = "客户收件信息表")
+public class SysCustomReceiver extends BaseEntity implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @ApiModelProperty(value = "类型,OFFICE:教务处,CLOUD_MARK:研究生")
+    @NotBlank(message = "客户类型不能为空")
+    private ProductTypeEnum type;
+
+    @ApiModelProperty(value = "客户名称")
+    @NotBlank(message = "客户名称不能为空")
+    private String name;
+
+    @ApiModelProperty(value = "具体单位")
+    private String unit;
+
+    @ApiModelProperty(value = "收件人")
+    @NotBlank(message = "收件人不能为空")
+    private String consignee;
+
+    @ApiModelProperty(value = "收件人电话")
+    @NotBlank(message = "收件人电话不能为空")
+    private String consigneePhone;
+
+    @ApiModelProperty(value = "收件人地址")
+    @NotBlank(message = "收件人地址不能为空")
+    private String consigneeAddress;
+
+    public ProductTypeEnum getType() {
+        return type;
+    }
+
+    public void setType(ProductTypeEnum type) {
+        this.type = type;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getUnit() {
+        return unit;
+    }
+
+    public void setUnit(String unit) {
+        this.unit = unit;
+    }
+
+    public String getConsignee() {
+        return consignee;
+    }
+
+    public void setConsignee(String consignee) {
+        this.consignee = consignee;
+    }
+
+    public String getConsigneePhone() {
+        return consigneePhone;
+    }
+
+    public void setConsigneePhone(String consigneePhone) {
+        this.consigneePhone = consigneePhone;
+    }
+
+    public String getConsigneeAddress() {
+        return consigneeAddress;
+    }
+
+    public void setConsigneeAddress(String consigneeAddress) {
+        this.consigneeAddress = consigneeAddress;
+    }
+}

+ 25 - 0
sop-business/src/main/java/com/qmth/sop/business/mapper/SysCustomReceiverMapper.java

@@ -0,0 +1,25 @@
+package com.qmth.sop.business.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.qmth.sop.business.bean.dto.DataPermissionDto;
+import com.qmth.sop.business.bean.result.SysCustomReceiverResult;
+import com.qmth.sop.business.entity.SysCustomReceiver;
+import com.qmth.sop.common.enums.ProductTypeEnum;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+public interface SysCustomReceiverMapper extends BaseMapper<SysCustomReceiver> {
+
+    List<SysCustomReceiver> listCustom(@Param(value = "type") ProductTypeEnum type);
+
+    IPage<SysCustomReceiverResult> page(Page<SysCustomReceiverResult> page, @Param(value = "type") ProductTypeEnum type, @Param(value = "name") String name,
+            @Param(value = "dpr") DataPermissionDto dpr);
+
+    List<SysCustomReceiverResult> listCustomReceiver(@Param(value = "type") ProductTypeEnum type, @Param(value = "name") String name,
+            @Param(value = "dpr") DataPermissionDto dpr);
+
+
+}

+ 23 - 0
sop-business/src/main/java/com/qmth/sop/business/service/SysCustomReceiverService.java

@@ -0,0 +1,23 @@
+package com.qmth.sop.business.service;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.qmth.sop.business.bean.params.CustomReceiverParam;
+import com.qmth.sop.business.bean.result.SysCustomReceiverResult;
+import com.qmth.sop.business.entity.SysCustomReceiver;
+import com.qmth.sop.business.entity.SysUser;
+import com.qmth.sop.common.enums.ProductTypeEnum;
+
+import java.util.List;
+
+public interface SysCustomReceiverService extends IService<SysCustomReceiver> {
+
+    List<SysCustomReceiver> listCustom(ProductTypeEnum type);
+
+    IPage<SysCustomReceiverResult> pageReceiver(Page<SysCustomReceiverResult> page, ProductTypeEnum type, String name);
+
+    Long saveCustomReceiver(CustomReceiverParam param, SysUser requestUser);
+
+    void export(ProductTypeEnum type, String name);
+}

+ 111 - 0
sop-business/src/main/java/com/qmth/sop/business/service/impl/SysCustomReceiverServiceImpl.java

@@ -0,0 +1,111 @@
+package com.qmth.sop.business.service.impl;
+
+import com.alibaba.excel.EasyExcel;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.qmth.boot.core.exception.StatusException;
+import com.qmth.sop.business.bean.dto.DataPermissionDto;
+import com.qmth.sop.business.bean.params.CustomReceiverParam;
+import com.qmth.sop.business.bean.result.SysCustomReceiverResult;
+import com.qmth.sop.business.bean.result.TBDeviceDeliveryResult;
+import com.qmth.sop.business.entity.SysCustomReceiver;
+import com.qmth.sop.business.entity.SysUser;
+import com.qmth.sop.business.mapper.SysCustomReceiverMapper;
+import com.qmth.sop.business.service.SysCustomReceiverService;
+import com.qmth.sop.business.service.SysUserService;
+import com.qmth.sop.common.contant.SystemConstant;
+import com.qmth.sop.common.enums.ExceptionResultEnum;
+import com.qmth.sop.common.enums.ProductTypeEnum;
+import com.qmth.sop.common.util.FileUtil;
+import com.qmth.sop.common.util.ServletUtil;
+import org.springframework.beans.BeanUtils;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletResponse;
+import java.io.File;
+import java.io.IOException;
+import java.util.List;
+import java.util.Objects;
+
+/**
+ * @Description
+ * @Author haoguanghui
+ * @date 2024/09/04
+ */
+@Service
+public class SysCustomReceiverServiceImpl extends ServiceImpl<SysCustomReceiverMapper, SysCustomReceiver> implements SysCustomReceiverService {
+
+    @Resource
+    private SysUserService sysUserService;
+
+    @Override
+    public List<SysCustomReceiver> listCustom(ProductTypeEnum type) {
+        return baseMapper.listCustom(type);
+    }
+
+    @Override
+    public IPage<SysCustomReceiverResult> pageReceiver(Page<SysCustomReceiverResult> page, ProductTypeEnum type, String name) {
+        SysUser requestUser = (SysUser) ServletUtil.getRequestUser();
+        DataPermissionDto dpr = sysUserService.buildUserDataPermission(requestUser.getId());
+        return baseMapper.page(new Page<>(page.getCurrent(), page.getSize()), type, name, dpr);
+    }
+
+    @Override
+    public Long saveCustomReceiver(CustomReceiverParam param, SysUser requestUser) {
+        Long id = param.getId();
+        SysCustomReceiver sysCustomReceiver = new SysCustomReceiver();
+        BeanUtils.copyProperties(param, sysCustomReceiver);
+
+        //新增
+        if (id == null) {
+            LambdaQueryWrapper<SysCustomReceiver> queryWrapper = new LambdaQueryWrapper<>();
+            queryWrapper.eq(SysCustomReceiver::getType, param.getType());
+            queryWrapper.eq(SysCustomReceiver::getName, param.getName());
+            queryWrapper.eq(SysCustomReceiver::getUnit, param.getUnit());
+            queryWrapper.eq(SysCustomReceiver::getConsignee, param.getConsignee());
+            List<SysCustomReceiver> customReceiverList = this.list(queryWrapper);
+            if (!customReceiverList.isEmpty()) {
+                throw ExceptionResultEnum.ERROR.exception(String.format("该客户下已经存在收件人:%s,请不要重复新增", param.getConsignee()));
+            }
+
+            sysCustomReceiver.insertInfo(requestUser.getId());
+            this.save(sysCustomReceiver);
+            id = sysCustomReceiver.getId();
+        } else { //编辑
+            SysCustomReceiver existCustomReceiver = this.getById(id);
+            if (Objects.isNull(existCustomReceiver)) {
+                throw ExceptionResultEnum.ERROR.exception("操作的数据记录不存在");
+            }
+
+            sysCustomReceiver.updateInfo(requestUser.getId());
+            this.updateById(sysCustomReceiver);
+        }
+        return id;
+    }
+
+    @Override
+    public void export(ProductTypeEnum type, String name) {
+        SysUser requestUser = (SysUser) ServletUtil.getRequestUser();
+        DataPermissionDto dpr = sysUserService.buildUserDataPermission(requestUser.getId());
+        List<SysCustomReceiverResult> receiverResultList = baseMapper.listCustomReceiver(type, name, dpr);
+        receiverResultList.forEach(item -> {
+            item.setTypeName(item.getType().getTitle());
+        });
+        File fileTemp = null;
+        try {
+            fileTemp = SystemConstant.getFileTempVar(SystemConstant.XLSX_PREFIX);
+            EasyExcel.write(fileTemp, SysCustomReceiverResult.class).sheet("客户收件信息").doWrite(receiverResultList);
+            HttpServletResponse response = ServletUtil.getResponse();
+            FileUtil.outputFile(response, fileTemp, "客户收件信息.xlsx");
+        } catch (IOException e) {
+            throw ExceptionResultEnum.ERROR.exception(e.getMessage());
+        } finally {
+            if (Objects.nonNull(fileTemp)) {
+                fileTemp.delete();
+            }
+        }
+    }
+}

+ 28 - 31
sop-business/src/main/resources/db/log/haoguanghui_update_log.sql

@@ -1,32 +1,29 @@
--- 2024-05-15
-ALTER TABLE t_b_device_delivery
-    ADD COLUMN `device_status` varchar(30) NULL COMMENT '设备状态,正常:NORMAL; 故障:FAULT' AFTER `effect`;
-ALTER TABLE t_b_device_delivery
-    ADD COLUMN `source_id` bigint NULL COMMENT '设备来源ID,不为空,说明该设备由其他单号中转过来' AFTER `device_status`;
+-- 2024-09-04
+CREATE TABLE sys_custom_receiver  (
+    `id` bigint(0) NOT NULL COMMENT '主键',
+    `type` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '类型,OFFICE:教务处,CLOUD_MARK:研究生',
+    `name` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '客户名称',
+    `unit` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '具体单位',
+    `consignee` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '收件人',
+    `consignee_phone` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '收件人电话',
+    `consignee_address` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '收件人地址',
+    `create_id` bigint(0) NULL DEFAULT NULL COMMENT '创建人id',
+    `create_time` bigint(0) NULL DEFAULT NULL COMMENT '创建时间',
+    `update_id` bigint(0) NULL DEFAULT NULL COMMENT '更新人id',
+    `update_time` bigint(0) NULL DEFAULT NULL COMMENT '更新时间',
+    PRIMARY KEY (`id`) USING BTREE
+) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '客户收件人信息表' ROW_FORMAT = Dynamic;
 
--- 2024-05-16
-ALTER TABLE t_b_device_delivery
-    ADD COLUMN `remark` varchar(200) NULL COMMENT '其他的运输方式说明' AFTER `source_id`;
-
--- 2024-05-17
-ALTER TABLE t_b_device_delivery
-    ADD COLUMN `mail_type` varchar(20) NULL COMMENT '邮寄方式:邮寄、其他' AFTER `remark`;
-
--- 2024-05-21
-INSERT INTO sys_privilege(id, name, url, type, parent_id, sequence, property, related, enable, default_auth, front_display) VALUES (4000, '设备管理', 'deviceDeliveryManage', 'MENU', 36, 1, NULL, NULL, 1, 0, 1);
-INSERT INTO sys_privilege(id, name, url, type, parent_id, sequence, property, related, enable, default_auth, front_display) VALUES (4010, '设备签收列表', 'List', 'LIST', 4000, 1, 'AUTH', '4018', 1, 0, 1);
-INSERT INTO sys_privilege(id, name, url, type, parent_id, sequence, property, related, enable, default_auth, front_display) VALUES (4011, '签收', 'Sign', 'LINK', 4000, 2, 'AUTH', '4019', 1, 0, 1);
-INSERT INTO sys_privilege(id, name, url, type, parent_id, sequence, property, related, enable, default_auth, front_display) VALUES (4012, '未签收', 'UnSigned', 'LINK', 4000, 3, 'AUTH', '4020', 1, 0, 1);
-INSERT INTO sys_privilege(id, name, url, type, parent_id, sequence, property, related, enable, default_auth, front_display) VALUES (4013, '编辑', 'Update', 'LINK', 4000, 4, 'AUTH', '4021', 1, 0, 1);
-INSERT INTO sys_privilege(id, name, url, type, parent_id, sequence, property, related, enable, default_auth, front_display) VALUES (4014, '设备去处列表', 'List', 'LIST', 4000, 1, 'AUTH', '4022', 1, 0, 1);
-INSERT INTO sys_privilege(id, name, url, type, parent_id, sequence, property, related, enable, default_auth, front_display) VALUES (4015, '入库', 'In', 'LINK', 4000, 2, 'AUTH', '4023', 1, 0, 1);
-INSERT INTO sys_privilege(id, name, url, type, parent_id, sequence, property, related, enable, default_auth, front_display) VALUES (4016, '中转', 'Transfer', 'LINK', 4000, 3, 'AUTH', '4024', 1, 0, 1);
-INSERT INTO sys_privilege(id, name, url, type, parent_id, sequence, property, related, enable, default_auth, front_display) VALUES (4017, '编辑', 'Update', 'LINK', 4000, 4, 'AUTH', '4025', 1, 0, 1);
-INSERT INTO sys_privilege(id, name, url, type, parent_id, sequence, property, related, enable, default_auth, front_display) VALUES (4018, '设备签收列表', '/api/admin/device/manage/sign/list', 'URL', 4000, 1, 'AUTH', NULL, 1, 1, 0);
-INSERT INTO sys_privilege(id, name, url, type, parent_id, sequence, property, related, enable, default_auth, front_display) VALUES (4019, '设备签收', '/api/admin/device/manage/sign', 'URL', 4000, 2, 'AUTH', NULL, 1, 1, 0);
-INSERT INTO sys_privilege(id, name, url, type, parent_id, sequence, property, related, enable, default_auth, front_display) VALUES (4020, '设备未签收', '/api/admin/device/manage/unsigned', 'URL', 4000, 3, 'AUTH', NULL, 1, 1, 0);
-INSERT INTO sys_privilege(id, name, url, type, parent_id, sequence, property, related, enable, default_auth, front_display) VALUES (4021, '设备签收编辑', '/api/admin/device/manage/sign/edit', 'URL', 4000, 4, 'AUTH', NULL, 1, 1, 0);
-INSERT INTO sys_privilege(id, name, url, type, parent_id, sequence, property, related, enable, default_auth, front_display) VALUES (4022, '设备去处列表', '/api/admin/device/manage/place/list', 'URL', 4000, 1, 'AUTH', NULL, 1, 1, 0);
-INSERT INTO sys_privilege(id, name, url, type, parent_id, sequence, property, related, enable, default_auth, front_display) VALUES (4023, '设备去处入库', '/api/admin/device/manage/in', 'URL', 4000, 2, 'AUTH', NULL, 1, 1, 0);
-INSERT INTO sys_privilege(id, name, url, type, parent_id, sequence, property, related, enable, default_auth, front_display) VALUES (4024, '设备去处中转', '/api/admin/device/manage/transfer', 'URL', 4000, 3, 'AUTH', NULL, 1, 1, 0);
-INSERT INTO sys_privilege(id, name, url, type, parent_id, sequence, property, related, enable, default_auth, front_display) VALUES (4025, '设备去处编辑', '/api/admin/device/manage/place/edit', 'URL', 4000, 4, 'AUTH', NULL, 1, 1, 0);
+INSERT INTO sys_privilege(`id`, `name`, `url`, `type`, `parent_id`, `sequence`, `property`, `related`, `enable`, `default_auth`, `front_display`) VALUES (400, '收件信息', 'receiver', 'MENU', 2, 6, NULL, NULL, 1, 0, 1);
+INSERT INTO sys_privilege(`id`, `name`, `url`, `type`, `parent_id`, `sequence`, `property`, `related`, `enable`, `default_auth`, `front_display`) VALUES (401, '新增', 'Add', 'BUTTON', 400, 1, 'AUTH', '407', 1, 0, 1);
+INSERT INTO sys_privilege(`id`, `name`, `url`, `type`, `parent_id`, `sequence`, `property`, `related`, `enable`, `default_auth`, `front_display`) VALUES (402, '查询', 'Select', 'BUTTON', 400, 2, 'AUTH', '411,412', 1, 0, 1);
+INSERT INTO sys_privilege(`id`, `name`, `url`, `type`, `parent_id`, `sequence`, `property`, `related`, `enable`, `default_auth`, `front_display`) VALUES (403, '导出', 'Export', 'BUTTON', 400, 3, 'AUTH', '410', 1, 0, 1);
+INSERT INTO sys_privilege(`id`, `name`, `url`, `type`, `parent_id`, `sequence`, `property`, `related`, `enable`, `default_auth`, `front_display`) VALUES (404, '列表', 'List', 'LIST', 400, 4, 'AUTH', '411,412', 1, 0, 1);
+INSERT INTO sys_privilege(`id`, `name`, `url`, `type`, `parent_id`, `sequence`, `property`, `related`, `enable`, `default_auth`, `front_display`) VALUES (405, '修改', 'Update', 'LINK', 400, 1, 'AUTH', '408', 1, 0, 1);
+INSERT INTO sys_privilege(`id`, `name`, `url`, `type`, `parent_id`, `sequence`, `property`, `related`, `enable`, `default_auth`, `front_display`) VALUES (406, '删除', 'Delete', 'LINK', 400, 2, 'AUTH', '409', 1, 0, 1);
+INSERT INTO sys_privilege(`id`, `name`, `url`, `type`, `parent_id`, `sequence`, `property`, `related`, `enable`, `default_auth`, `front_display`) VALUES (407, '收件信息新增', '/api/sys/custom/receiver/save', 'URL', 400, 1, 'AUTH', NULL, 1, 1, 0);
+INSERT INTO sys_privilege(`id`, `name`, `url`, `type`, `parent_id`, `sequence`, `property`, `related`, `enable`, `default_auth`, `front_display`) VALUES (408, '收件信息修改', '/api/sys/custom/receiver/save', 'URL', 400, 2, 'AUTH', NULL, 1, 1, 0);
+INSERT INTO sys_privilege(`id`, `name`, `url`, `type`, `parent_id`, `sequence`, `property`, `related`, `enable`, `default_auth`, `front_display`) VALUES (409, '收件信息删除', '/api/sys/custom/receiver/delete', 'URL', 400, 3, 'AUTH', NULL, 1, 1, 0);
+INSERT INTO sys_privilege(`id`, `name`, `url`, `type`, `parent_id`, `sequence`, `property`, `related`, `enable`, `default_auth`, `front_display`) VALUES (410, '收件信息导出', '/api/sys/custom/receiver/export', 'URL', 400, 4, 'AUTH', NULL, 1, 1, 0);
+INSERT INTO sys_privilege(`id`, `name`, `url`, `type`, `parent_id`, `sequence`, `property`, `related`, `enable`, `default_auth`, `front_display`) VALUES (411, '收件信息列表', '/api/sys/custom/receiver/page', 'URL', 400, 5, 'AUTH', NULL, 1, 1, 0);
+INSERT INTO sys_privilege(`id`, `name`, `url`, `type`, `parent_id`, `sequence`, `property`, `related`, `enable`, `default_auth`, `front_display`) VALUES (412, '客户列表', '/api/sys/custom/receiver/list', 'URL', 400, 6, 'AUTH', NULL, 1, 1, 0);

+ 67 - 0
sop-business/src/main/resources/mapper/SysCustomReceiverMapper.xml

@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.qmth.sop.business.mapper.SysCustomReceiverMapper">
+
+    <select id="listCustom" resultType="com.qmth.sop.business.entity.SysCustomReceiver" parameterType="com.qmth.sop.common.enums.ProductTypeEnum">
+        select distinct name from sys_custom_receiver
+        <where>
+            <if test="type !=null">
+                AND type=#{type}
+            </if>
+        </where>
+    </select>
+
+    <select id="page" resultType="com.qmth.sop.business.bean.result.SysCustomReceiverResult">
+        SELECT
+        r.id,
+        r.type,
+        r.NAME,
+        r.unit,
+        r.consignee,
+        r.consignee_phone consigneePhone,
+        r.consignee_address consigneeAddress
+        FROM
+        sys_custom_receiver r
+        <where>
+            <if test="type != null">
+                AND r.type=#{type}
+            </if>
+            <if test="name != null and name != ''">
+                AND r.name=#{name}
+            </if>
+            <if test="dpr != null and !dpr.hasAdmin and !dpr.hasPmo and !dpr.hasBusiness">
+                <if test="dpr.hasAccountManager">
+                    AND r.create_id = #{dpr.requestUserId}
+                </if>
+            </if>
+        </where>
+        order by r.update_time desc
+    </select>
+
+    <select id="listCustomReceiver" resultType="com.qmth.sop.business.bean.result.SysCustomReceiverResult">
+        SELECT
+        r.type,
+        r.NAME,
+        r.unit,
+        r.consignee,
+        r.consignee_phone consigneePhone,
+        r.consignee_address consigneeAddress
+        FROM
+        sys_custom_receiver r
+        <where>
+            <if test="type != null">
+                AND r.type=#{type}
+            </if>
+            <if test="name != null and name != ''">
+                AND r.name=#{name}
+            </if>
+            <if test="dpr != null and !dpr.hasAdmin and !dpr.hasPmo and !dpr.hasBusiness">
+                <if test="dpr.hasAccountManager">
+                    AND r.create_id = #{dpr.requestUserId}
+                </if>
+            </if>
+        </where>
+        order by r.update_time desc
+    </select>
+
+</mapper>

+ 1 - 0
sop-common/src/main/java/com/qmth/sop/common/contant/SystemConstant.java

@@ -240,6 +240,7 @@ public class SystemConstant {
     public static final String PREFIX_URL_SYS = "/admin/sys";
     public static final String PREFIX_URL_ORG = "/admin/org";
     public static final String PREFIX_URL_CUSTOM = "/sys/custom";
+    public static final String PREFIX_URL_CUSTOM_RECEIVER = "/sys/custom/receiver";
     public static final String PREFIX_URL_LEVEL = "/sys/level";
     public static final String PREFIX_URL_DEVICE = "/sys/device";
     public static final String PREFIX_URL_DING_GROUP = "/sys/ding/group";