Browse Source

aps-客户功能修改,增加更新接口

sucheng 1 month ago
parent
commit
c3054222e1

+ 2 - 0
cx-aps/cx-aps-common/src/main/java/com/rongwei/bscommon/sys/dao/ApsCustomerManagementDao.java

@@ -2,12 +2,14 @@ package com.rongwei.bscommon.sys.dao;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.rongwei.bsentity.domain.ApsCustomerManagementDo;
+import org.apache.ibatis.annotations.Param;
 
 /**
  * @Entity generator.domain.ApsCustomerManagement
  */
 public interface ApsCustomerManagementDao extends BaseMapper<ApsCustomerManagementDo> {
 
+    void myUpdateById(@Param("item") ApsCustomerManagementDo item);
 }
 
 

+ 15 - 0
cx-aps/cx-aps-common/src/main/java/com/rongwei/bscommon/sys/dao/ApsCustomerStoreDao.java

@@ -0,0 +1,15 @@
+package com.rongwei.bscommon.sys.dao;
+
+import com.rongwei.bsentity.domain.ApsCustomerStoreDo;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * @Entity generator.domain.ApsCustomerStore
+ */
+public interface ApsCustomerStoreDao extends BaseMapper<ApsCustomerStoreDo> {
+
+}
+
+
+
+

+ 3 - 0
cx-aps/cx-aps-common/src/main/java/com/rongwei/bscommon/sys/service/ApsCustomerManagementService.java

@@ -2,10 +2,13 @@ package com.rongwei.bscommon.sys.service;
 
 import com.rongwei.bsentity.domain.ApsCustomerManagementDo;
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.rongwei.bsentity.vo.ApsCustomerManagementUpdateVo;
+import com.rongwei.rwcommon.base.R;
 
 /**
  *
  */
 public interface ApsCustomerManagementService extends IService<ApsCustomerManagementDo> {
 
+    R updateCustomerManagement(ApsCustomerManagementUpdateVo req);
 }

+ 11 - 0
cx-aps/cx-aps-common/src/main/java/com/rongwei/bscommon/sys/service/ApsCustomerStoreService.java

@@ -0,0 +1,11 @@
+package com.rongwei.bscommon.sys.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.rongwei.bsentity.domain.ApsCustomerStoreDo;
+
+/**
+ *
+ */
+public interface ApsCustomerStoreService extends IService<ApsCustomerStoreDo> {
+
+}

+ 24 - 1
cx-aps/cx-aps-common/src/main/java/com/rongwei/bscommon/sys/service/impl/ApsCustomerManagementServiceImpl.java

@@ -3,16 +3,39 @@ package com.rongwei.bscommon.sys.service.impl;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.rongwei.bscommon.sys.dao.ApsCustomerManagementDao;
 import com.rongwei.bscommon.sys.service.ApsCustomerManagementService;
+import com.rongwei.bscommon.sys.service.ApsCustomerStoreService;
 import com.rongwei.bsentity.domain.ApsCustomerManagementDo;
+import com.rongwei.bsentity.domain.ApsCustomerStoreDo;
+import com.rongwei.bsentity.vo.ApsCustomerManagementUpdateVo;
+import com.rongwei.rwcommon.base.R;
+import com.rongwei.rwcommon.utils.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.util.List;
+
 /**
  *
  */
 @Service
 public class ApsCustomerManagementServiceImpl extends ServiceImpl<ApsCustomerManagementDao, ApsCustomerManagementDo>
-    implements ApsCustomerManagementService {
+        implements ApsCustomerManagementService {
+    @Autowired
+    private ApsCustomerStoreService apsCustomerStoreService;
 
+    @Override
+    public R updateCustomerManagement(ApsCustomerManagementUpdateVo req) {
+        String id = req.getId();
+        if (StringUtils.isBlank(id)) {
+            return R.error("id不能为空");
+        }
+        this.baseMapper.myUpdateById(req);
+        List<ApsCustomerStoreDo> apsCustomerStoreDoList = req.getApsCustomerStoreDoList();
+        if (apsCustomerStoreDoList != null && !apsCustomerStoreDoList.isEmpty()) {
+            apsCustomerStoreService.saveOrUpdateBatch(apsCustomerStoreDoList);
+        }
+        return R.ok();
+    }
 }
 
 

+ 20 - 0
cx-aps/cx-aps-common/src/main/java/com/rongwei/bscommon/sys/service/impl/ApsCustomerStoreServiceImpl.java

@@ -0,0 +1,20 @@
+package com.rongwei.bscommon.sys.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.rongwei.bscommon.sys.dao.ApsCustomerStoreDao;
+import com.rongwei.bscommon.sys.service.ApsCustomerStoreService;
+import com.rongwei.bsentity.domain.ApsCustomerStoreDo;
+import org.springframework.stereotype.Service;
+
+/**
+ *
+ */
+@Service
+public class ApsCustomerStoreServiceImpl extends ServiceImpl<ApsCustomerStoreDao, ApsCustomerStoreDo>
+    implements ApsCustomerStoreService {
+
+}
+
+
+
+

+ 37 - 0
cx-aps/cx-aps-common/src/main/resources/mybatis/ApsCustomerManagementDao.xml

@@ -0,0 +1,37 @@
+<?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.rongwei.bscommon.sys.dao.ApsCustomerManagementDao">
+
+
+    <update id="myUpdateById">
+        update aps_customer_management
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="item.tenantid!= null">TENANTID=#{item.tenantid},</if>
+            <if test="item.roption!= null">ROPTION=#{item.roption},</if>
+            <if test="item.deleted!= null">DELETED=#{item.deleted},</if>
+            <if test="item.remark!= null">REMARK=#{item.remark},</if>
+            <if test="item.createdate!= null">CREATEDATE=#{item.createdate},</if>
+            <if test="item.createuserid!= null">CREATEUSERID=#{item.createuserid},</if>
+            <if test="item.modifydate!= null">MODIFYDATE=#{item.modifydate},</if>
+            <if test="item.modifyuserid!= null">MODIFYUSERID=#{item.modifyuserid},</if>
+            <if test="item.createusername!= null">CREATEUSERNAME=#{item.createusername},</if>
+            <if test="item.modifyusername!= null">MODIFYUSERNAME=#{item.modifyusername},</if>
+            <if test="item.customerunit!= null">CUSTOMERUNIT=#{item.customerunit},</if>
+            <if test="item.customername!= null">CUSTOMERNAME=#{item.customername},</if>
+            <if test="item.customerabbreviation!= null">CUSTOMERABBREVIATION=#{item.customerabbreviation},</if>
+            <if test="item.deliveryaddress!= null">DELIVERYADDRESS=#{item.deliveryaddress},</if>
+            <if test="item.deliverytime!= null">DELIVERYTIME=#{item.deliverytime},</if>
+            <if test="item.contacts!= null">CONTACTS=#{item.contacts},</if>
+            <if test="item.contactsmobile!= null">CONTACTSMOBILE=#{item.contactsmobile},</if>
+            <if test="item.storeid!= null">STOREID=#{item.storeid},</if>
+            <if test="item.socialcode!= null">SOCIALCODE=#{item.socialcode},</if>
+            <if test="item.email!= null">EMAIL=#{item.email},</if>
+            <if test="item.customertype!= null">CUSTOMERTYPE=#{item.customertype},</if>
+            <if test="item.isdeleted!= null">ISDELETED=#{item.isdeleted},</if>
+            <if test="item.manufactroy!= null">MANUFACTROY=#{item.manufactroy},</if>
+        </trim>
+        where ID = #{item.id}
+    </update>
+</mapper>

+ 115 - 0
cx-aps/cx-aps-entity/src/main/java/com/rongwei/bsentity/domain/ApsCustomerStoreDo.java

@@ -0,0 +1,115 @@
+package com.rongwei.bsentity.domain;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import java.io.Serializable;
+import java.util.Date;
+import lombok.Data;
+
+/**
+ * 客户仓库信息
+ * @TableName aps_customer_store
+ */
+@TableName(value ="aps_customer_store")
+@Data
+public class ApsCustomerStoreDo implements Serializable {
+    /**
+     * 主键ID
+     */
+    @TableId(value = "ID")
+    private String id;
+
+    /**
+     * 
+     */
+    @TableField(value = "TENANTID")
+    private String tenantid;
+
+    /**
+     * 扩展json格式配置
+     */
+    @TableField(value = "ROPTION")
+    private String roption;
+
+    /**
+     * 是否删除Y/N
+     */
+    @TableField(value = "DELETED")
+    private String deleted;
+
+    /**
+     * 备注
+     */
+    @TableField(value = "REMARK")
+    private String remark;
+
+    /**
+     * 创建时间
+     */
+    @TableField(value = "CREATEDATE")
+    private Date createdate;
+
+    /**
+     * 创建用户ID
+     */
+    @TableField(value = "CREATEUSERID")
+    private String createuserid;
+
+    /**
+     * 修改日期
+     */
+    @TableField(value = "MODIFYDATE")
+    private Date modifydate;
+
+    /**
+     * 修改用户ID
+     */
+    @TableField(value = "MODIFYUSERID")
+    private String modifyuserid;
+
+    /**
+     * 创建人
+     */
+    @TableField(value = "CREATEUSERNAME")
+    private String createusername;
+
+    /**
+     * 修改人
+     */
+    @TableField(value = "MODIFYUSERNAME")
+    private String modifyusername;
+
+    /**
+     * 客户ID
+     */
+    @TableField(value = "STOREID")
+    private String storeid;
+
+    /**
+     * 仓库编号
+     */
+    @TableField(value = "STOREUNIT")
+    private String storeunit;
+
+    /**
+     * 仓库名称
+     */
+    @TableField(value = "STORENAME")
+    private String storename;
+
+    /**
+     * 仓库地址
+     */
+    @TableField(value = "STOREADDRESS")
+    private String storeaddress;
+
+    /**
+     * 送货时长
+     */
+    @TableField(value = "STORETIME")
+    private Integer storetime;
+
+    @TableField(exist = false)
+    private static final long serialVersionUID = 1L;
+}

+ 18 - 0
cx-aps/cx-aps-entity/src/main/java/com/rongwei/bsentity/vo/ApsCustomerManagementUpdateVo.java

@@ -0,0 +1,18 @@
+package com.rongwei.bsentity.vo;
+
+import com.rongwei.bsentity.domain.ApsCustomerManagementDo;
+import com.rongwei.bsentity.domain.ApsCustomerStoreDo;
+import lombok.Data;
+
+import java.util.List;
+
+/**
+ * @author :sc
+ * @since :2025/7/8
+ */
+@Data
+public class ApsCustomerManagementUpdateVo extends ApsCustomerManagementDo {
+
+    //客户仓库
+    private List<ApsCustomerStoreDo> apsCustomerStoreDoList;
+}

+ 36 - 0
cx-aps/cx-aps-server/src/main/java/com/rongwei/bsserver/controller/ApsCustomerManagementController.java

@@ -0,0 +1,36 @@
+package com.rongwei.bsserver.controller;
+
+
+import com.rongwei.bscommon.sys.service.ApsCustomerManagementService;
+import com.rongwei.bsentity.domain.ApsProductionTechnicalRequirementDo;
+import com.rongwei.bsentity.vo.ApsCustomerManagementUpdateVo;
+import com.rongwei.rwcommon.base.R;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+/**
+ * <p>
+ * 客户信息 前端控制器
+ * </p>
+ *
+ * @author sc
+ * @since 2025-07-08
+ */
+@Slf4j
+@RestController
+@RequestMapping("/apsCustomerManagement")
+public class ApsCustomerManagementController {
+
+    @Autowired
+    private ApsCustomerManagementService apsCustomerManagementService;
+
+    @PostMapping("/update")
+    public R updateCustomerManagement(@RequestBody ApsCustomerManagementUpdateVo req) {
+            log.info("更新客户信息,入参:{}", req);
+            return apsCustomerManagementService.updateCustomerManagement(req);
+    }
+
+
+}
+