路线管理列表
This commit is contained in:
@@ -191,4 +191,8 @@ public interface UserServiceFeign {
|
||||
@ApiOperation("根据用户ID查询货主信息")
|
||||
@GetMapping("/userShipperApi/getShipperByUserId/{userId}")
|
||||
public AjaxResult<?> getShipperByUserId(@PathVariable("userId") Long userId);
|
||||
|
||||
@ApiOperation("设置路线")
|
||||
@PostMapping("/userApi/updateLineManagement")
|
||||
public AjaxResult updateLineManagement(@RequestBody UserDTO userDTO);
|
||||
}
|
||||
@@ -40,4 +40,17 @@ public class UserDTO extends BaseVOEntity {
|
||||
@ApiModelProperty(name = "用户角色")
|
||||
private String userRole;
|
||||
|
||||
|
||||
@ApiModelProperty("路线id")
|
||||
private String lineManagementId;
|
||||
|
||||
@ApiModelProperty("路线编码")
|
||||
private String routeCode;
|
||||
|
||||
@ApiModelProperty("路线名称")
|
||||
private String routeName;
|
||||
|
||||
@ApiModelProperty("配送顺序")
|
||||
private String deliveryOrder;
|
||||
|
||||
}
|
||||
|
||||
+5
@@ -181,6 +181,11 @@ public class RemoteUserFeignFallbackFactory implements FallbackFactory<UserServi
|
||||
public AjaxResult<?> getShipperByUserId(Long userId) {
|
||||
return AjaxResult.error("查询失败" + throwable.getMessage());
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult updateLineManagement(UserDTO userDTO) {
|
||||
return AjaxResult.error("失败" + throwable.getMessage());
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
+10
@@ -5232,4 +5232,14 @@ public class UserApplicationService {
|
||||
public UserPo selectUserTableByUserId(Long userId){
|
||||
return userDomainService.selectByUserId(userId);
|
||||
}
|
||||
|
||||
|
||||
public void updateLineManagement(CustomerDO customerDO) {
|
||||
if (customerDO.getUserId() == null){
|
||||
throw new ServiceException("用户id不能为空");
|
||||
}
|
||||
UserDO userDO = new UserDO();
|
||||
BeanUtils.copyProperties(customerDO, userDO);
|
||||
userDomainService.updateUser(userDO);
|
||||
}
|
||||
}
|
||||
+13
@@ -192,4 +192,17 @@ public class UserEntity extends BaseVOEntity {
|
||||
|
||||
@ApiModelProperty("税号")
|
||||
private String taxNumber;
|
||||
|
||||
|
||||
@ApiModelProperty("路线id")
|
||||
private String lineManagementId;
|
||||
|
||||
@ApiModelProperty("路线编码")
|
||||
private String routeCode;
|
||||
|
||||
@ApiModelProperty("路线名称")
|
||||
private String routeName;
|
||||
|
||||
@ApiModelProperty("配送顺序")
|
||||
private String deliveryOrder;
|
||||
}
|
||||
+12
@@ -78,4 +78,16 @@ public class CustomerDO extends BaseVOEntity {
|
||||
|
||||
@ApiModelProperty(name = "备注")
|
||||
private String userRemark;
|
||||
|
||||
@ApiModelProperty("路线id")
|
||||
private String lineManagementId;
|
||||
|
||||
@ApiModelProperty("路线编码")
|
||||
private String routeCode;
|
||||
|
||||
@ApiModelProperty("路线名称")
|
||||
private String routeName;
|
||||
|
||||
@ApiModelProperty("配送顺序")
|
||||
private String deliveryOrder;
|
||||
}
|
||||
|
||||
+12
@@ -281,4 +281,16 @@ public class UserDO extends BaseVOEntity {
|
||||
|
||||
@ApiModelProperty("税号")
|
||||
private String taxNumber;
|
||||
|
||||
@ApiModelProperty("路线id")
|
||||
private String lineManagementId;
|
||||
|
||||
@ApiModelProperty("路线编码")
|
||||
private String routeCode;
|
||||
|
||||
@ApiModelProperty("路线名称")
|
||||
private String routeName;
|
||||
|
||||
@ApiModelProperty("配送顺序")
|
||||
private String deliveryOrder;
|
||||
}
|
||||
|
||||
@@ -19,15 +19,12 @@ public class CustomerDTO extends BaseVOEntity {
|
||||
private Long userId;
|
||||
|
||||
@ApiModelProperty("职务/角色权限字符,控制器中定义的权限字符,如:@PreAuthorize(`@ss.hasRole('admin')`)")
|
||||
@NotBlank(message = "角色编码不能为空")
|
||||
private String roleCode;
|
||||
|
||||
@ApiModelProperty("货主/供应商/客户编码")
|
||||
@NotBlank(message = "货主/供应商/客户编码不能为空")
|
||||
private String userMemberCode;
|
||||
|
||||
@ApiModelProperty("货主/供应商/客户名称")
|
||||
@NotBlank(message = "货主/供应商/客户名称不能为空")
|
||||
private String userName;
|
||||
|
||||
@ApiModelProperty("联系人")
|
||||
@@ -77,4 +74,16 @@ public class CustomerDTO extends BaseVOEntity {
|
||||
|
||||
@ApiModelProperty(name = "备注")
|
||||
private String userRemark;
|
||||
|
||||
@ApiModelProperty("路线id")
|
||||
private String lineManagementId;
|
||||
|
||||
@ApiModelProperty("路线编码")
|
||||
private String routeCode;
|
||||
|
||||
@ApiModelProperty("路线名称")
|
||||
private String routeName;
|
||||
|
||||
@ApiModelProperty("配送顺序")
|
||||
private String deliveryOrder;
|
||||
}
|
||||
|
||||
@@ -247,4 +247,16 @@ public class UserDTO extends BaseVOEntity {
|
||||
|
||||
@ApiModelProperty(value = "紧急联系电话")
|
||||
private String emergencyContactPhone;
|
||||
|
||||
@ApiModelProperty("路线id")
|
||||
private String lineManagementId;
|
||||
|
||||
@ApiModelProperty("路线编码")
|
||||
private String routeCode;
|
||||
|
||||
@ApiModelProperty("路线名称")
|
||||
private String routeName;
|
||||
|
||||
@ApiModelProperty("配送顺序")
|
||||
private String deliveryOrder;
|
||||
}
|
||||
|
||||
@@ -941,6 +941,24 @@ public class UserAPI extends BaseController {
|
||||
}
|
||||
}
|
||||
|
||||
@Log(title = "新增修改客户线路", description ="新增修改客户线路",businessType = BusinessType.UPDATE)
|
||||
@ApiOperation("新增修改客户线路")
|
||||
@PostMapping("/updateLineManagement")
|
||||
public AjaxResult updateLineManagement(@Valid @RequestBody CustomerDTO customerDTO) {
|
||||
try {
|
||||
CustomerDO customerDO = new CustomerDO();
|
||||
BeanUtils.copyProperties(customerDTO,customerDO);
|
||||
userApplicationService.updateLineManagement(customerDO);
|
||||
return AjaxResult.success();
|
||||
} catch (com.mhd.common.core.exception.ServiceException e) {
|
||||
e.printStackTrace();
|
||||
return AjaxResult.error(500, e.getMessage());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return AjaxResult.error(500, "操作失败:" + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@Log(title = "作废货主、供应商、客户", description ="作废货主、供应商、客户",businessType = BusinessType.UPDATE)
|
||||
@ApiOperation("作废货主、供应商、客户")
|
||||
@PostMapping("/nullifyCustomer")
|
||||
|
||||
@@ -61,6 +61,33 @@ ALTER TABLE NGWL_TEST_WMS.PICKING_MATERIAL_DETAIL ADD IN_ORDER_NUMBER varchar(10
|
||||
|
||||
ALTER TABLE stock_receipt_order ADD oms_stock_in_order_id VARCHAR(64);
|
||||
|
||||
CREATE TABLE NGWL_TEST_SYSTEM.LINE_MANAGEMENT (
|
||||
ID BIGINT NOT NULL AUTO_INCREMENT,
|
||||
ORGANIZATION_ID BIGINT DEFAULT NULL,
|
||||
ORGANIZATION_NAME VARCHAR(100) DEFAULT NULL,
|
||||
TOP_ORGANIZATION_ID BIGINT DEFAULT NULL,
|
||||
WAREHOUSE_ID BIGINT DEFAULT NULL,
|
||||
WAREHOUSE_NAME VARCHAR(100) DEFAULT NULL,
|
||||
ROUTE_CODE VARCHAR(100) DEFAULT NULL,
|
||||
ROUTE_NAME VARCHAR(200) DEFAULT NULL,
|
||||
CUSTOMER_JSON CLOB DEFAULT NULL,
|
||||
CREATE_BY BIGINT DEFAULT NULL,
|
||||
CREATE_BY_NAME VARCHAR(50) DEFAULT NULL,
|
||||
CREATE_TIME TIMESTAMP DEFAULT CURRENT_TIMESTAMP NULL,
|
||||
UPDATE_BY BIGINT DEFAULT NULL,
|
||||
UPDATE_BY_NAME VARCHAR(50) DEFAULT NULL,
|
||||
UPDATE_TIME TIMESTAMP DEFAULT CURRENT_TIMESTAMP NULL,
|
||||
DEL_FLAG TINYINT DEFAULT 1 NULL,
|
||||
CONSTRAINT PK_LINE_MANAGEMENT PRIMARY KEY (ID)
|
||||
);
|
||||
ALTER TABLE NGWL_TEST_USER."USER" ADD LINE_MANAGEMENT_ID varchar(100) NULL;
|
||||
ALTER TABLE NGWL_TEST_USER."USER" ADD ROUTE_CODE varchar(100) NULL;
|
||||
ALTER TABLE NGWL_TEST_USER."USER" ADD ROUTE_NAME varchar(100) NULL;
|
||||
ALTER TABLE NGWL_TEST_USER."USER" ADD DELIVERY_ORDER varchar(100) NULL;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
package com.mhd.wms.domain.lineManagement.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.mhd.common.core.annotation.Excel;
|
||||
import com.mhd.common.core.web.domain.BaseVOEntity;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalTime;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 路线管理对象
|
||||
*
|
||||
*/
|
||||
|
||||
@Data
|
||||
public class LineManagement extends BaseVOEntity{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("id")
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty("组织表ID")
|
||||
@Excel(name = "组织表ID")
|
||||
private Long organizationId;
|
||||
|
||||
@ApiModelProperty("组织名称")
|
||||
@Excel(name = "组织名称")
|
||||
private String organizationName;
|
||||
|
||||
@ApiModelProperty("一级组织表ID")
|
||||
@Excel(name = "一级组织表ID")
|
||||
private Long topOrganizationId;
|
||||
|
||||
@ApiModelProperty("仓库ID")
|
||||
private Long warehouseId;
|
||||
|
||||
@ApiModelProperty("仓库名字")
|
||||
private String warehouseName;
|
||||
|
||||
/**
|
||||
* 路线编码
|
||||
*/
|
||||
@ApiModelProperty("路线编码")
|
||||
private String routeCode;
|
||||
|
||||
/**
|
||||
* 路线名称
|
||||
*/
|
||||
@ApiModelProperty("路线名称")
|
||||
private String routeName;
|
||||
|
||||
/**
|
||||
* 客户
|
||||
*/
|
||||
@ApiModelProperty("客户Json数据")
|
||||
private String customerJson;
|
||||
}
|
||||
+45
@@ -0,0 +1,45 @@
|
||||
package com.mhd.wms.domain.lineManagement.repository.facade;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.mhd.wms.domain.lineManagement.entity.LineManagement;
|
||||
import com.mhd.wms.domain.lineManagement.repository.po.LineManagementPO;
|
||||
import com.mhd.wms.domain.lineManagement.repository.todo.LineManagementDO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 路线管理Service接口
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-05-07
|
||||
*/
|
||||
public interface ILineManagementService extends IService<LineManagement>
|
||||
{
|
||||
/**
|
||||
* 分页查询路线管理列表
|
||||
*/
|
||||
public List<LineManagementPO> queryList(LineManagementDO lineManagementDO);
|
||||
|
||||
/**
|
||||
* 新增路线管理
|
||||
*/
|
||||
public Boolean insert(LineManagementDO lineManagementDO);
|
||||
|
||||
public LineManagement insertReturn(LineManagementDO lineManagementDO);
|
||||
|
||||
/**
|
||||
* 修改路线管理
|
||||
*/
|
||||
public Boolean update(LineManagementDO lineManagementDO);
|
||||
|
||||
/**
|
||||
* 批量删除路线管理
|
||||
*/
|
||||
public Boolean delete(Long[] ids);
|
||||
|
||||
|
||||
/**
|
||||
* 查询路线管理
|
||||
*/
|
||||
public LineManagementPO getInfo(Long id);
|
||||
}
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
package com.mhd.wms.domain.lineManagement.repository.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.mhd.wms.domain.lineManagement.entity.LineManagement;
|
||||
import com.mhd.wms.domain.lineManagement.repository.po.LineManagementPO;
|
||||
import com.mhd.wms.domain.lineManagement.repository.todo.LineManagementDO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 路线管理Mapper接口
|
||||
*
|
||||
*/
|
||||
public interface LineManagementMapper extends BaseMapper<LineManagement>
|
||||
{
|
||||
/**
|
||||
* 查询路线管理列表
|
||||
*/
|
||||
public List<LineManagementPO> queryList(LineManagementDO lineManagementDO);
|
||||
|
||||
}
|
||||
+149
@@ -0,0 +1,149 @@
|
||||
package com.mhd.wms.domain.lineManagement.repository.persistence;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.alibaba.nacos.shaded.com.google.gson.JsonObject;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.mhd.common.security.utils.SecurityUtils;
|
||||
import com.mhd.system.api.UserServiceFeign;
|
||||
import com.mhd.system.api.domain.UserDTO;
|
||||
import com.mhd.system.api.model.LoginUser;
|
||||
import com.mhd.wms.domain.lineManagement.entity.LineManagement;
|
||||
import com.mhd.wms.domain.lineManagement.repository.facade.ILineManagementService;
|
||||
import com.mhd.wms.domain.lineManagement.repository.mapper.LineManagementMapper;
|
||||
import com.mhd.wms.domain.lineManagement.repository.po.LineManagementPO;
|
||||
import com.mhd.wms.domain.lineManagement.repository.todo.LineManagementCustomer;
|
||||
import com.mhd.wms.domain.lineManagement.repository.todo.LineManagementDO;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 路线管理Service业务层处理
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-05-07
|
||||
*/
|
||||
@Service
|
||||
public class LineManagementImpl extends ServiceImpl<LineManagementMapper, LineManagement> implements ILineManagementService {
|
||||
@Autowired
|
||||
private LineManagementMapper lineManagementMapper;
|
||||
@Autowired
|
||||
private UserServiceFeign userServiceFeign;
|
||||
|
||||
/**
|
||||
* 查询路线管理列表
|
||||
*/
|
||||
@Override
|
||||
public List<LineManagementPO> queryList(LineManagementDO lineManagementDO)
|
||||
{
|
||||
return lineManagementMapper.queryList(lineManagementDO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增路线管理
|
||||
*/
|
||||
@Override
|
||||
public Boolean insert(LineManagementDO lineManagementDO) {
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
LineManagement LineManagement = new LineManagement();
|
||||
BeanUtils.copyProperties(lineManagementDO,LineManagement);
|
||||
boolean save = this.save(LineManagement);
|
||||
//客户列表补充id
|
||||
List<LineManagementCustomer> lineManagementCustomers =
|
||||
JSONObject.parseArray(lineManagementDO.getCustomerJson(), LineManagementCustomer.class);
|
||||
for (LineManagementCustomer lineManagementCustomer : lineManagementCustomers) {
|
||||
UserDTO userDTO = new UserDTO();
|
||||
userDTO.setUserId(lineManagementCustomer.getUserId());
|
||||
userDTO.setDeliveryOrder(lineManagementCustomer.getDeliveryOrder());
|
||||
userDTO.setLineManagementId(LineManagement.getId().toString());
|
||||
userDTO.setRouteCode(lineManagementDO.getRouteCode());
|
||||
userDTO.setRouteName(lineManagementDO.getRouteName());
|
||||
userServiceFeign.updateLineManagement(userDTO);
|
||||
}
|
||||
return save;
|
||||
}
|
||||
|
||||
@Override
|
||||
public LineManagement insertReturn(LineManagementDO lineManagementDO) {
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
LineManagement lineManagement = new LineManagement();
|
||||
BeanUtils.copyProperties(lineManagementDO,lineManagement);
|
||||
boolean save = this.save(lineManagement);
|
||||
if (save) {
|
||||
return lineManagement;
|
||||
}
|
||||
return lineManagement;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改路线管理
|
||||
*/
|
||||
@Override
|
||||
public Boolean update(LineManagementDO lineManagementDO) {
|
||||
LineManagement lineManagement = new LineManagement();
|
||||
BeanUtils.copyProperties(lineManagementDO,lineManagement);
|
||||
LineManagement lineManagementDB = this.getById(lineManagement.getId());
|
||||
//删除用户
|
||||
List<LineManagementCustomer> lineManagementCustomers =
|
||||
JSONObject.parseArray(lineManagementDB.getCustomerJson(), LineManagementCustomer.class);
|
||||
for (LineManagementCustomer lineManagementCustomer : lineManagementCustomers) {
|
||||
UserDTO userDTO = new UserDTO();
|
||||
userDTO.setUserId(lineManagementCustomer.getUserId());
|
||||
userDTO.setDeliveryOrder("");
|
||||
userDTO.setLineManagementId("");
|
||||
userDTO.setRouteCode("");
|
||||
userDTO.setRouteName("");
|
||||
userServiceFeign.updateLineManagement(userDTO);
|
||||
}
|
||||
List<LineManagementCustomer> lineManagementCustomers2 =
|
||||
JSONObject.parseArray(lineManagementDO.getCustomerJson(), LineManagementCustomer.class);
|
||||
for (LineManagementCustomer lineManagementCustomer : lineManagementCustomers) {
|
||||
UserDTO userDTO = new UserDTO();
|
||||
userDTO.setUserId(lineManagementCustomer.getUserId());
|
||||
userDTO.setDeliveryOrder(lineManagementCustomer.getDeliveryOrder());
|
||||
userDTO.setLineManagementId(lineManagement.getId().toString());
|
||||
userDTO.setRouteCode(lineManagementDO.getRouteCode());
|
||||
userDTO.setRouteName(lineManagementDO.getRouteName());
|
||||
userServiceFeign.updateLineManagement(userDTO);
|
||||
}
|
||||
return this.updateById(lineManagement);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除路线管理
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean delete(Long[] lineManagementIds ) {
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
List<LineManagement> list = new ArrayList<>();
|
||||
for (Long id : lineManagementIds) {
|
||||
LineManagement lineManagement = new LineManagement();
|
||||
lineManagement.setId(id);
|
||||
lineManagement.setDelFlag(2);
|
||||
lineManagement.setUpdateBy(loginUser.getUserid());
|
||||
lineManagement.setUpdateByName(loginUser.getUsername());
|
||||
lineManagement.setUpdateTime(new Date());
|
||||
list.add(lineManagement);
|
||||
}
|
||||
return this.updateBatchById(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改路线管理
|
||||
*/
|
||||
@Override
|
||||
public LineManagementPO getInfo(Long lineManagementId) {
|
||||
LineManagement LineManagement = this.getById(lineManagementId);
|
||||
LineManagementPO lineManagementPO = new LineManagementPO();
|
||||
BeanUtils.copyProperties(LineManagement,lineManagementPO);
|
||||
return lineManagementPO;
|
||||
}
|
||||
|
||||
}
|
||||
+58
@@ -0,0 +1,58 @@
|
||||
package com.mhd.wms.domain.lineManagement.repository.po;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.mhd.common.core.annotation.Excel;
|
||||
import com.mhd.common.core.web.domain.BaseVOEntity;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 路线管理对象
|
||||
*
|
||||
*/
|
||||
|
||||
@Data
|
||||
public class LineManagementPO extends BaseVOEntity{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("id")
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty("组织表ID")
|
||||
@Excel(name = "组织表ID")
|
||||
private Long organizationId;
|
||||
|
||||
@ApiModelProperty("组织名称")
|
||||
@Excel(name = "组织名称")
|
||||
private String organizationName;
|
||||
|
||||
@ApiModelProperty("一级组织表ID")
|
||||
@Excel(name = "一级组织表ID")
|
||||
private Long topOrganizationId;
|
||||
|
||||
@ApiModelProperty("仓库ID")
|
||||
private Long warehouseId;
|
||||
|
||||
@ApiModelProperty("仓库名字")
|
||||
private String warehouseName;
|
||||
|
||||
/**
|
||||
* 路线编码
|
||||
*/
|
||||
@ApiModelProperty("路线编码")
|
||||
private String routeCode;
|
||||
|
||||
/**
|
||||
* 路线名称
|
||||
*/
|
||||
@ApiModelProperty("路线名称")
|
||||
private String routeName;
|
||||
|
||||
/**
|
||||
* 客户
|
||||
*/
|
||||
@ApiModelProperty("客户Json数据")
|
||||
private String customerJson;
|
||||
}
|
||||
+42
@@ -0,0 +1,42 @@
|
||||
package com.mhd.wms.domain.lineManagement.repository.todo;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.mhd.common.core.annotation.Excel;
|
||||
import com.mhd.common.core.web.domain.BaseVOEntity;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 路线管理对象
|
||||
*
|
||||
*/
|
||||
|
||||
@Data
|
||||
public class LineManagementCustomer {
|
||||
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
@ApiModelProperty("用户id")
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 客户编码
|
||||
*/
|
||||
@ApiModelProperty("客户编码")
|
||||
private String customerCode;
|
||||
|
||||
/**
|
||||
* 客户名称
|
||||
*/
|
||||
@ApiModelProperty("客户名称")
|
||||
private String customerName;
|
||||
|
||||
/**
|
||||
* 配送顺序
|
||||
*/
|
||||
@ApiModelProperty("配送顺序")
|
||||
private String deliveryOrder;
|
||||
}
|
||||
+58
@@ -0,0 +1,58 @@
|
||||
package com.mhd.wms.domain.lineManagement.repository.todo;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.mhd.common.core.annotation.Excel;
|
||||
import com.mhd.common.core.web.domain.BaseVOEntity;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 路线管理对象
|
||||
*
|
||||
*/
|
||||
|
||||
@Data
|
||||
public class LineManagementDO extends BaseVOEntity{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("id")
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty("组织表ID")
|
||||
@Excel(name = "组织表ID")
|
||||
private Long organizationId;
|
||||
|
||||
@ApiModelProperty("组织名称")
|
||||
@Excel(name = "组织名称")
|
||||
private String organizationName;
|
||||
|
||||
@ApiModelProperty("一级组织表ID")
|
||||
@Excel(name = "一级组织表ID")
|
||||
private Long topOrganizationId;
|
||||
|
||||
@ApiModelProperty("仓库ID")
|
||||
private Long warehouseId;
|
||||
|
||||
@ApiModelProperty("仓库名字")
|
||||
private String warehouseName;
|
||||
|
||||
/**
|
||||
* 路线编码
|
||||
*/
|
||||
@ApiModelProperty("路线编码")
|
||||
private String routeCode;
|
||||
|
||||
/**
|
||||
* 路线名称
|
||||
*/
|
||||
@ApiModelProperty("路线名称")
|
||||
private String routeName;
|
||||
|
||||
/**
|
||||
* 客户
|
||||
*/
|
||||
@ApiModelProperty("客户Json数据")
|
||||
private String customerJson;
|
||||
}
|
||||
+88
@@ -0,0 +1,88 @@
|
||||
package com.mhd.wms.domain.lineManagement.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.mhd.common.security.utils.SecurityUtils;
|
||||
import com.mhd.system.api.model.LoginUser;
|
||||
import com.mhd.wms.domain.lineManagement.entity.LineManagement;
|
||||
import com.mhd.wms.domain.lineManagement.repository.facade.ILineManagementService;
|
||||
import com.mhd.wms.domain.lineManagement.repository.po.LineManagementPO;
|
||||
import com.mhd.wms.domain.lineManagement.repository.todo.LineManagementDO;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 租赁管理
|
||||
*
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class LineManagementDomainService {
|
||||
|
||||
@Autowired
|
||||
private ILineManagementService lineManagementService;
|
||||
|
||||
|
||||
/**
|
||||
* 分页查询租赁管理列表
|
||||
*/
|
||||
public List<LineManagementPO> queryList(LineManagementDO lineManagementDO) {
|
||||
return lineManagementService.queryList(lineManagementDO);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 新增租赁管理
|
||||
*/
|
||||
public Boolean insert(LineManagementDO lineManagementDO) {
|
||||
|
||||
return lineManagementService.insert(lineManagementDO);
|
||||
}
|
||||
|
||||
public LineManagement insertReturn(LineManagementDO lineManagementDO) {
|
||||
|
||||
return lineManagementService.insertReturn(lineManagementDO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改租赁管理
|
||||
*/
|
||||
public Boolean update(LineManagementDO lineManagementDO) {
|
||||
return lineManagementService.update(lineManagementDO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除租赁管理
|
||||
*/
|
||||
public Boolean delete(Long[] leaseIds) {
|
||||
return lineManagementService.delete(leaseIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取租赁管理详细信息
|
||||
*/
|
||||
public LineManagementPO getInfo(Long leaseId)
|
||||
{
|
||||
return lineManagementService.getInfo(leaseId);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @description 批量作废租赁
|
||||
* @author ZhouGY
|
||||
* @date 2024/5/13 9:46
|
||||
* @param leaseIds
|
||||
* @return Boolean
|
||||
*/
|
||||
public Boolean nullifyByIds(List<Long> leaseIds) {
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
return lineManagementService.update(new UpdateWrapper<LineManagement>().lambda()
|
||||
.set(LineManagement::getUpdateBy, loginUser.getUserid())
|
||||
.set(LineManagement::getUpdateTime, new Date())
|
||||
.in(LineManagement::getId, leaseIds)
|
||||
.eq(LineManagement::getDelFlag, 1));
|
||||
}
|
||||
}
|
||||
@@ -97,13 +97,4 @@ public class ReviewOrderPO extends BaseVOEntity {
|
||||
/** 详情与上架单一致:头字段扁平 + 明细列表 */
|
||||
@ApiModelProperty("复核明细")
|
||||
private List<ReviewMaterialDetailPO> materialDetailList;
|
||||
|
||||
@ApiModelProperty("货主id")
|
||||
private String shipperId;
|
||||
|
||||
@ApiModelProperty("货主编码")
|
||||
private String shipperCode;
|
||||
|
||||
@ApiModelProperty("货主名字")
|
||||
private String shipperName;
|
||||
}
|
||||
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
package com.mhd.wms.interfaces.assember.copyCodeReference;
|
||||
|
||||
|
||||
import com.mhd.common.core.utils.bean.BeanUtils;
|
||||
import com.mhd.wms.domain.copyCodeReference.repository.todo.CopyCodeReferenceDO;
|
||||
import com.mhd.wms.domain.lineManagement.repository.todo.LineManagementDO;
|
||||
import com.mhd.wms.interfaces.dto.LineManagement.LineManagementDTO;
|
||||
import com.mhd.wms.interfaces.dto.copyCodeReference.CopyCodeReferenceDTO;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
public class LineManagementAssembler {
|
||||
|
||||
public LineManagementDO toDO(LineManagementDTO lineManagementDTO){
|
||||
if(lineManagementDTO == null){
|
||||
return null;
|
||||
}
|
||||
LineManagementDO lineManagementDO = new LineManagementDO();
|
||||
BeanUtils.copyProperties(lineManagementDTO,lineManagementDO);
|
||||
return lineManagementDO;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
+64
@@ -0,0 +1,64 @@
|
||||
package com.mhd.wms.interfaces.dto.LineManagement;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.mhd.common.core.annotation.Excel;
|
||||
import com.mhd.common.core.web.domain.BaseVOEntity;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalTime;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 线路管理对象 container
|
||||
*
|
||||
*/
|
||||
|
||||
@Data
|
||||
public class LineManagementDTO extends BaseVOEntity{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("id")
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty("组织表ID")
|
||||
@Excel(name = "组织表ID")
|
||||
private Long organizationId;
|
||||
|
||||
@ApiModelProperty("组织名称")
|
||||
@Excel(name = "组织名称")
|
||||
private String organizationName;
|
||||
|
||||
@ApiModelProperty("一级组织表ID")
|
||||
@Excel(name = "一级组织表ID")
|
||||
private Long topOrganizationId;
|
||||
|
||||
@ApiModelProperty("仓库ID")
|
||||
private Long warehouseId;
|
||||
|
||||
@ApiModelProperty("仓库名字")
|
||||
private String warehouseName;
|
||||
|
||||
/**
|
||||
* 路线编码
|
||||
*/
|
||||
@ApiModelProperty("路线编码")
|
||||
private String routeCode;
|
||||
|
||||
/**
|
||||
* 路线名称
|
||||
*/
|
||||
@ApiModelProperty("路线名称")
|
||||
private String routeName;
|
||||
|
||||
/**
|
||||
* 客户
|
||||
*/
|
||||
@ApiModelProperty("客户Json数据")
|
||||
private String customerJson;
|
||||
}
|
||||
+96
@@ -0,0 +1,96 @@
|
||||
package com.mhd.wms.interfaces.facadeApi.lineManagement;
|
||||
|
||||
import com.mhd.common.core.web.controller.BaseController;
|
||||
import com.mhd.common.core.web.domain.AjaxResult;
|
||||
import com.mhd.common.core.web.page.TableDataInfo;
|
||||
import com.mhd.wms.domain.lineManagement.repository.facade.ILineManagementService;
|
||||
import com.mhd.wms.domain.lineManagement.repository.po.LineManagementPO;
|
||||
import com.mhd.wms.domain.lineManagement.repository.todo.LineManagementDO;
|
||||
import com.mhd.wms.interfaces.assember.copyCodeReference.LineManagementAssembler;
|
||||
import com.mhd.wms.interfaces.dto.LineManagement.LineManagementDTO;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 路线管理Api
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/lineManagementApi")
|
||||
public class LineManagementApi extends BaseController{
|
||||
|
||||
@Autowired
|
||||
private ILineManagementService lineManagementService;
|
||||
|
||||
@Resource
|
||||
private LineManagementAssembler lineManagementAssembler;
|
||||
|
||||
/**
|
||||
* 分页查询路线管理列表
|
||||
*/
|
||||
@ApiOperation("查询路线管理列表")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(LineManagementDTO lineManagementDTO)
|
||||
{
|
||||
//转换实体
|
||||
LineManagementDO lineManagementDO = lineManagementAssembler.toDO(lineManagementDTO);
|
||||
startPage();
|
||||
List<LineManagementPO> list = lineManagementService.queryList(lineManagementDO);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询路线管理列表
|
||||
*/
|
||||
@ApiOperation("查询路线管理列表")
|
||||
@GetMapping("/listByApp")
|
||||
public AjaxResult listByApp(LineManagementDTO lineManagementDTO)
|
||||
{
|
||||
//转换实体
|
||||
LineManagementDO lineManagementDO = lineManagementAssembler.toDO(lineManagementDTO);
|
||||
List<LineManagementPO> list = lineManagementService.queryList(lineManagementDO);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑路线管理
|
||||
*/
|
||||
@ApiOperation("编辑路线管理")
|
||||
@PostMapping("/edit")
|
||||
public AjaxResult edit(@RequestBody LineManagementDTO lineManagementDTO)
|
||||
{
|
||||
//转换实体
|
||||
LineManagementDO lineManagementDO = lineManagementAssembler.toDO(lineManagementDTO);
|
||||
if(lineManagementDTO.getId() != null){
|
||||
return toAjax(lineManagementService.update(lineManagementDO));
|
||||
}else {
|
||||
return toAjax(lineManagementService.insert(lineManagementDO));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除路线管理
|
||||
*/
|
||||
@ApiOperation("批量删除路线管理")
|
||||
@DeleteMapping("/deleteByIds/{leaseIds}")
|
||||
public AjaxResult delete(@PathVariable Long[] leaseIds)
|
||||
{
|
||||
return toAjax(lineManagementService.delete(leaseIds));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取路线管理详细信息
|
||||
*/
|
||||
@ApiOperation("获取路线管理")
|
||||
@GetMapping(value = "/getInfo/{leaseId}")
|
||||
public AjaxResult getInfo(@PathVariable("leaseId") Long leaseId)
|
||||
{
|
||||
return AjaxResult.success(lineManagementService.getInfo(leaseId));
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,131 @@
|
||||
<?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.mhd.wms.domain.lineManagement.repository.mapper.LineManagementMapper">
|
||||
|
||||
<resultMap type="com.mhd.wms.domain.lineManagement.repository.po.LineManagementPO" id="LineManagementResult">
|
||||
<!-- 租赁相关字段 -->
|
||||
<result property="id" column="id" />
|
||||
<result property="organizationId" column="organization_id" />
|
||||
<result property="organizationName" column="organization_name" />
|
||||
<result property="topOrganizationId" column="top_organization_id" />
|
||||
<result property="warehouseId" column="warehouse_id" />
|
||||
<result property="warehouseName" column="warehouse_name" />
|
||||
<result property="routeCode" column="route_code" />
|
||||
<result property="routeName" column="route_name" />
|
||||
<result property="customerJson" column="customer_json" />
|
||||
<!-- 继承自BaseVOEntity的字段 -->
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createByName" column="create_by_name" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateByName" column="update_by_name" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
</resultMap>
|
||||
|
||||
|
||||
<sql id="selectLineManagementPo">
|
||||
select
|
||||
a.id,
|
||||
a.organization_id,
|
||||
a.organization_name,
|
||||
a.top_organization_id,
|
||||
a.warehouse_id,
|
||||
COALESCE(w.warehouse_name, a.warehouse_name) as warehouse_name,
|
||||
a.route_code,
|
||||
a.route_name,
|
||||
a.customer_json,
|
||||
a.create_time,
|
||||
a.create_by,
|
||||
a.create_by_name,
|
||||
a.update_time,
|
||||
a.update_by,
|
||||
a.update_by_name,
|
||||
a.del_flag,
|
||||
a.service_items_code,
|
||||
a.second_subject_code,
|
||||
a.second_subject_name,
|
||||
a.service_items_name,
|
||||
a.bill_days,
|
||||
a.bill_time,
|
||||
a.salesman_name,
|
||||
a.settlement_currency,
|
||||
a.salesman_id
|
||||
from lease a
|
||||
LEFT JOIN warehouse w ON a.warehouse_id = w.warehouse_id AND w.del_flag = 1
|
||||
</sql>
|
||||
|
||||
<sql id="selectLineManagementPo1">
|
||||
<where>
|
||||
<!-- ID查询 -->
|
||||
<if test="id != null">
|
||||
and a.id = #{id}
|
||||
</if>
|
||||
<!-- 组织相关查询 -->
|
||||
<if test="organizationId != null">
|
||||
and a.organization_id = #{organizationId}
|
||||
</if>
|
||||
<if test="topOrganizationId != null">
|
||||
and a.top_organization_id = #{topOrganizationId}
|
||||
</if>
|
||||
<if test="organizationName != null and organizationName != ''">
|
||||
and a.organization_name like concat('%', #{organizationName}, '%')
|
||||
</if>
|
||||
<!-- 仓库相关查询 -->
|
||||
<if test="warehouseId != null">
|
||||
and a.warehouse_id = #{warehouseId}
|
||||
</if>
|
||||
<if test="warehouseName != null and warehouseName != ''">
|
||||
and (w.warehouse_name like concat('%', #{warehouseName}, '%') or a.warehouse_name like concat('%', #{warehouseName}, '%'))
|
||||
</if>
|
||||
<!-- 线路管理字段查询 -->
|
||||
<if test="routeCode != null and routeCode != ''">
|
||||
and a.route_code like concat('%', #{routeCode}, '%')
|
||||
</if>
|
||||
<if test="routeName != null and routeName != ''">
|
||||
and a.route_name like concat('%', #{routeName}, '%')
|
||||
</if>
|
||||
<if test="customerJson != null and customerJson != ''">
|
||||
and a.customer_json like concat('%', #{customerJson}, '%')
|
||||
</if>
|
||||
<!-- 创建和更新相关条件 -->
|
||||
<if test="createByName != null and createByName != ''">
|
||||
and a.create_by_name like concat('%', #{createByName}, '%')
|
||||
</if>
|
||||
<if test="updateByName != null and updateByName != ''">
|
||||
and a.update_by_name like concat('%', #{updateByName}, '%')
|
||||
</if>
|
||||
<!-- 时间范围查询 -->
|
||||
<if test="createTimeStart != null and createTimeStart != ''">
|
||||
and a.create_time >= #{createTimeStart}
|
||||
</if>
|
||||
<if test="createTimeEnd != null and createTimeEnd != ''">
|
||||
and a.create_time <= #{createTimeEnd}
|
||||
</if>
|
||||
<if test="updateTimeStart != null and updateTimeStart != ''">
|
||||
and a.update_time >= #{updateTimeStart}
|
||||
</if>
|
||||
<if test="updateTimeEnd != null and updateTimeEnd != ''">
|
||||
and a.update_time <= #{updateTimeEnd}
|
||||
</if>
|
||||
<!-- 删除标记 -->
|
||||
<choose>
|
||||
<when test="delFlag != null">
|
||||
and a.del_flag = #{delFlag}
|
||||
</when>
|
||||
<otherwise>
|
||||
and a.del_flag = 1
|
||||
</otherwise>
|
||||
</choose>
|
||||
</where>
|
||||
</sql>
|
||||
|
||||
<!-- 查询列表 -->
|
||||
<select id="queryList" parameterType="com.mhd.wms.domain.lineManagement.repository.po.LineManagementPO" resultMap="LineManagementResult">
|
||||
<include refid="selectLineManagementPo"/>
|
||||
<include refid="selectLineManagementPo1"/>
|
||||
ORDER BY a.create_time DESC
|
||||
</select>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user