29 changed files with 981 additions and 323 deletions
@ -0,0 +1,58 @@
|
||||
package com.logpm.basicdata.entity; |
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import io.swagger.annotations.ApiModel; |
||||
import io.swagger.annotations.ApiModelProperty; |
||||
import lombok.Data; |
||||
import lombok.EqualsAndHashCode; |
||||
import org.springblade.core.tenant.mp.TenantEntity; |
||||
|
||||
@Data |
||||
@TableName("logpm_basicdata_main_category") |
||||
@ApiModel(value = "BasicdataMainCategory对象", description = "物料映射子表") |
||||
@EqualsAndHashCode(callSuper = true) |
||||
public class BasicdataMainCategoryEntity extends TenantEntity { |
||||
|
||||
/** |
||||
* 预留1 |
||||
*/ |
||||
@ApiModelProperty(value = "预留1") |
||||
private String reserve1; |
||||
/** |
||||
* 预留2 |
||||
*/ |
||||
@ApiModelProperty(value = "预留2") |
||||
private String reserve2; |
||||
/** |
||||
* 预留3 |
||||
*/ |
||||
@ApiModelProperty(value = "预留3") |
||||
private String reserve3; |
||||
/** |
||||
* 预留4 |
||||
*/ |
||||
@ApiModelProperty(value = "预留4") |
||||
private String reserve4; |
||||
/** |
||||
* 预留5 |
||||
*/ |
||||
@ApiModelProperty(value = "预留5") |
||||
private String reserve5; |
||||
|
||||
@ApiModelProperty(value = "映射品类id") |
||||
private Long factoryCategoryId; |
||||
|
||||
@ApiModelProperty(value = "品类id") |
||||
private Long categoryId; |
||||
|
||||
@ApiModelProperty(value = "品类名称") |
||||
private String category; |
||||
|
||||
@ApiModelProperty(value = "主体id") |
||||
private Long mainId; |
||||
|
||||
@ApiModelProperty(value = "主体名称") |
||||
private String mainName; |
||||
|
||||
|
||||
} |
@ -0,0 +1,106 @@
|
||||
package com.logpm.basicdata.controller; |
||||
|
||||
import cn.hutool.core.collection.CollUtil; |
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
||||
import com.logpm.basicdata.dto.ForwardingUnitDTO; |
||||
import com.logpm.basicdata.entity.BasicdataForwardingUnitEntity; |
||||
import com.logpm.basicdata.service.IBasicdataForwardingUnitService; |
||||
import io.swagger.annotations.Api; |
||||
import io.swagger.annotations.ApiOperation; |
||||
import lombok.AllArgsConstructor; |
||||
import lombok.extern.slf4j.Slf4j; |
||||
import org.springblade.common.exception.CustomerException; |
||||
import org.springblade.core.tool.api.R; |
||||
import org.springframework.web.bind.annotation.*; |
||||
|
||||
import java.util.List; |
||||
import java.util.Objects; |
||||
|
||||
@Slf4j |
||||
@RestController |
||||
@AllArgsConstructor |
||||
@RequestMapping("/forwardingUnit") |
||||
@Api(value = "始发仓默认发货单位", tags = "始发仓默认发货单位") |
||||
public class BasicdataForwardingUnitController { |
||||
|
||||
private final IBasicdataForwardingUnitService basicdataForwardingUnitService; |
||||
|
||||
@ResponseBody |
||||
@PostMapping("/pageList") |
||||
@ApiOperationSupport(order = 1) |
||||
@ApiOperation(value = "默认发货单位列表", notes = "传入forwardingUnitDTO") |
||||
public R pageList(@RequestBody ForwardingUnitDTO forwardingUnitDTO) { |
||||
String method = "############pageList: "; |
||||
log.info(method + "请求参数{}", forwardingUnitDTO); |
||||
try { |
||||
|
||||
IPage<BasicdataForwardingUnitEntity> pages = basicdataForwardingUnitService.pageList(forwardingUnitDTO); |
||||
return R.data(pages); |
||||
} catch (CustomerException e) { |
||||
log.error(e.message, e); |
||||
return R.fail(e.code, e.message); |
||||
} catch (Exception e) { |
||||
log.error(method + "系统异常", e); |
||||
return R.fail(500, method + "系统异常"); |
||||
} |
||||
} |
||||
|
||||
@ResponseBody |
||||
@PostMapping("/editUnit") |
||||
@ApiOperationSupport(order = 1) |
||||
@ApiOperation(value = "新增或更新默认发货单位", notes = "传入forwardingUnitDTO") |
||||
public R editUnit(@RequestBody ForwardingUnitDTO forwardingUnitDTO) { |
||||
String method = "############editUnit: "; |
||||
log.info(method + "请求参数{}", forwardingUnitDTO); |
||||
try { |
||||
Long warehouseId = forwardingUnitDTO.getWarehouseId(); |
||||
if(Objects.isNull(warehouseId)){ |
||||
log.warn(method+"仓库id为空"); |
||||
return R.fail(405,"仓库id为空"); |
||||
} |
||||
Long clientId = forwardingUnitDTO.getClientId(); |
||||
if(Objects.isNull(clientId)){ |
||||
log.warn(method+"客户id为空"); |
||||
return R.fail(405,"客户id为空"); |
||||
} |
||||
|
||||
return basicdataForwardingUnitService.editUnit(forwardingUnitDTO); |
||||
} catch (CustomerException e) { |
||||
log.error(e.message, e); |
||||
return R.fail(e.code, e.message); |
||||
} catch (Exception e) { |
||||
log.error(method + "系统异常", e); |
||||
return R.fail(500, method + "系统异常"); |
||||
} |
||||
} |
||||
|
||||
|
||||
@ResponseBody |
||||
@PostMapping("/removeUnit") |
||||
@ApiOperationSupport(order = 1) |
||||
@ApiOperation(value = "删除默认发货单位", notes = "传入forwardingUnitDTO") |
||||
public R removeUnit(@RequestBody ForwardingUnitDTO forwardingUnitDTO) { |
||||
String method = "############removeUnit: "; |
||||
log.info(method + "请求参数{}", forwardingUnitDTO); |
||||
try { |
||||
List<Long> ids = forwardingUnitDTO.getIds(); |
||||
if(CollUtil.isEmpty(ids)){ |
||||
log.warn(method+"移除id为空"); |
||||
return R.fail(405,"移除id为空"); |
||||
} |
||||
|
||||
return basicdataForwardingUnitService.removeUnit(forwardingUnitDTO); |
||||
} catch (CustomerException e) { |
||||
log.error(e.message, e); |
||||
return R.fail(e.code, e.message); |
||||
} catch (Exception e) { |
||||
log.error(method + "系统异常", e); |
||||
return R.fail(500, method + "系统异常"); |
||||
} |
||||
} |
||||
|
||||
|
||||
|
||||
|
||||
} |
@ -0,0 +1,111 @@
|
||||
package com.logpm.basicdata.controller; |
||||
|
||||
import cn.hutool.core.collection.CollUtil; |
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
||||
import com.logpm.basicdata.dto.MainDTO; |
||||
import com.logpm.basicdata.entity.BasicdataMainCategoryEntity; |
||||
import com.logpm.basicdata.service.IBasicdataMainCategoryService; |
||||
import io.swagger.annotations.Api; |
||||
import io.swagger.annotations.ApiOperation; |
||||
import lombok.AllArgsConstructor; |
||||
import lombok.extern.slf4j.Slf4j; |
||||
import org.springblade.common.exception.CustomerException; |
||||
import org.springblade.core.tool.api.R; |
||||
import org.springframework.web.bind.annotation.*; |
||||
|
||||
import java.util.List; |
||||
import java.util.Objects; |
||||
|
||||
@Slf4j |
||||
@RestController |
||||
@AllArgsConstructor |
||||
@RequestMapping("/basicdataMainCategory") |
||||
@Api(value = "主体结算品类", tags = "主体结算品类") |
||||
public class BasicdataMainCategoryController { |
||||
|
||||
private final IBasicdataMainCategoryService basicdataMainCategoryService; |
||||
|
||||
@ResponseBody |
||||
@PostMapping("/pageList") |
||||
@ApiOperationSupport(order = 1) |
||||
@ApiOperation(value = "映射品类子类列表", notes = "传入mainDTO") |
||||
public R pageList(@RequestBody MainDTO mainDTO) { |
||||
String method = "############pageList: "; |
||||
log.info(method + "请求参数{}", mainDTO); |
||||
try { |
||||
|
||||
IPage<BasicdataMainCategoryEntity> pages = basicdataMainCategoryService.pageList(mainDTO); |
||||
return R.data(pages); |
||||
} catch (CustomerException e) { |
||||
log.error(e.message, e); |
||||
return R.fail(e.code, e.message); |
||||
} catch (Exception e) { |
||||
log.error(method + "系统异常", e); |
||||
return R.fail(500, method + "系统异常"); |
||||
} |
||||
} |
||||
|
||||
@ResponseBody |
||||
@PostMapping("/editMainCategory") |
||||
@ApiOperationSupport(order = 1) |
||||
@ApiOperation(value = "新增或更新映射品类子类", notes = "传入mainDTO") |
||||
public R editMainCategory(@RequestBody MainDTO mainDTO) { |
||||
String method = "############editMainCategory: "; |
||||
log.info(method + "请求参数{}", mainDTO); |
||||
try { |
||||
Long factoryCategoryId = mainDTO.getFactoryCategoryId(); |
||||
if(Objects.isNull(factoryCategoryId)){ |
||||
log.warn(method+"映射id为空"); |
||||
return R.fail(405,"映射id为空"); |
||||
} |
||||
Long mainId = mainDTO.getMainId(); |
||||
if(Objects.isNull(mainId)){ |
||||
log.warn(method+"主体id为空"); |
||||
return R.fail(405,"主体id为空"); |
||||
} |
||||
|
||||
Long categoryId = mainDTO.getCategoryId(); |
||||
if(Objects.isNull(categoryId)){ |
||||
log.warn(method+"品类id为空"); |
||||
return R.fail(405,"品类id为空"); |
||||
} |
||||
|
||||
return basicdataMainCategoryService.editMainCategory(mainDTO); |
||||
} catch (CustomerException e) { |
||||
log.error(e.message, e); |
||||
return R.fail(e.code, e.message); |
||||
} catch (Exception e) { |
||||
log.error(method + "系统异常", e); |
||||
return R.fail(500, method + "系统异常"); |
||||
} |
||||
} |
||||
|
||||
|
||||
@ResponseBody |
||||
@PostMapping("/removeMainCategory") |
||||
@ApiOperationSupport(order = 1) |
||||
@ApiOperation(value = "删除主体映射", notes = "传入mainDTO") |
||||
public R removeMainCategory(@RequestBody MainDTO mainDTO) { |
||||
String method = "############removeMainCategory: "; |
||||
log.info(method + "请求参数{}", mainDTO); |
||||
try { |
||||
List<Long> ids = mainDTO.getIds(); |
||||
if(CollUtil.isEmpty(ids)){ |
||||
log.warn(method+"移除id为空"); |
||||
return R.fail(405,"移除id为空"); |
||||
} |
||||
|
||||
return basicdataMainCategoryService.removeMainCategory(mainDTO); |
||||
} catch (CustomerException e) { |
||||
log.error(e.message, e); |
||||
return R.fail(e.code, e.message); |
||||
} catch (Exception e) { |
||||
log.error(method + "系统异常", e); |
||||
return R.fail(500, method + "系统异常"); |
||||
} |
||||
} |
||||
|
||||
|
||||
|
||||
} |
@ -0,0 +1,27 @@
|
||||
package com.logpm.basicdata.dto; |
||||
|
||||
import lombok.Data; |
||||
|
||||
import java.io.Serializable; |
||||
import java.util.List; |
||||
|
||||
@Data |
||||
public class ForwardingUnitDTO implements Serializable { |
||||
|
||||
private Integer pageNum; |
||||
private Integer pageSize; |
||||
|
||||
private List<Long> warehouseIds; |
||||
|
||||
private List<Long> ids; |
||||
|
||||
|
||||
private Long warehouseId; |
||||
private String warehouseName; |
||||
|
||||
private Long clientId; |
||||
private String clientName; |
||||
|
||||
|
||||
|
||||
} |
@ -0,0 +1,23 @@
|
||||
package com.logpm.basicdata.dto; |
||||
|
||||
import lombok.Data; |
||||
|
||||
import java.io.Serializable; |
||||
import java.util.List; |
||||
|
||||
@Data |
||||
public class MainDTO implements Serializable { |
||||
|
||||
private String mainName; |
||||
|
||||
private Integer pageNum; |
||||
private Integer pageSize; |
||||
|
||||
private Long factoryCategoryId; |
||||
private Long mainId; |
||||
private Long categoryId; |
||||
private String category; |
||||
|
||||
private List<Long> ids; |
||||
|
||||
} |
@ -1,11 +1,20 @@
|
||||
package com.logpm.basicdata.mapper; |
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
import com.logpm.basicdata.dto.ForwardingUnitDTO; |
||||
import com.logpm.basicdata.entity.BasicdataForwardingUnitEntity; |
||||
import org.apache.ibatis.annotations.Mapper; |
||||
import org.apache.ibatis.annotations.Param; |
||||
|
||||
import java.util.List; |
||||
|
||||
@Mapper |
||||
public interface BasicdataForwardingUnitMapper extends BaseMapper<BasicdataForwardingUnitEntity> { |
||||
|
||||
IPage<BasicdataForwardingUnitEntity> pageList(IPage<Object> page, @Param("param") ForwardingUnitDTO forwardingUnitDTO); |
||||
|
||||
BasicdataForwardingUnitEntity findByWarehouseId(@Param("warehouseId") Long warehouseId); |
||||
|
||||
void removeUnit(@Param("ids") List<Long> ids); |
||||
} |
||||
|
@ -0,0 +1,34 @@
|
||||
<?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.logpm.basicdata.mapper.BasicdataForwardingUnitMapper"> |
||||
|
||||
<select id="pageList" resultType="com.logpm.basicdata.entity.BasicdataForwardingUnitEntity"> |
||||
select * |
||||
from logpm_basicdata_forwarding_unit |
||||
<where> |
||||
and is_deleted = 0 |
||||
<if test="param.warehouseIds != null and param.warehouseIds.size() > 0"> |
||||
and warehouse_id in |
||||
<foreach collection="param.warehouseIds" item="warehouseId" open="(" separator="," close=")"> |
||||
#{warehouseId} |
||||
</foreach> |
||||
</if> |
||||
</where> |
||||
</select> |
||||
|
||||
<select id="findByWarehouseId" resultType="com.logpm.basicdata.entity.BasicdataForwardingUnitEntity"> |
||||
select * |
||||
from logpm_basicdata_forwarding_unit |
||||
where warehouse_id = #{warehouseId} |
||||
and is_deleted = 0 |
||||
</select> |
||||
|
||||
<delete id="removeUnit" > |
||||
delete from logpm_basicdata_forwarding_unit |
||||
where id in |
||||
<foreach collection="ids" item="id" open="(" separator="," close=")"> |
||||
#{id} |
||||
</foreach> |
||||
</delete> |
||||
|
||||
</mapper> |
@ -0,0 +1,16 @@
|
||||
package com.logpm.basicdata.mapper; |
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
import com.logpm.basicdata.dto.MainDTO; |
||||
import com.logpm.basicdata.entity.BasicdataMainCategoryEntity; |
||||
import org.apache.ibatis.annotations.Mapper; |
||||
import org.apache.ibatis.annotations.Param; |
||||
|
||||
@Mapper |
||||
public interface BasicdataMainCategoryMapper extends BaseMapper<BasicdataMainCategoryEntity> { |
||||
|
||||
IPage<BasicdataMainCategoryEntity> pageList(IPage<Object> page, @Param("param") MainDTO mainDTO); |
||||
|
||||
BasicdataMainCategoryEntity findEntityByParam(@Param("param") MainDTO mainDTO); |
||||
} |
@ -0,0 +1,24 @@
|
||||
<?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.logpm.basicdata.mapper.BasicdataMainCategoryMapper"> |
||||
|
||||
<select id="pageList" resultType="com.logpm.basicdata.entity.BasicdataMainCategoryEntity"> |
||||
select * |
||||
from logpm_basicdata_main_category |
||||
<where> |
||||
and is_deleted = 0 |
||||
<if test="param.factoryCategoryId != null "> |
||||
and factory_category_id = #{param.factoryCategoryId} |
||||
</if> |
||||
</where> |
||||
</select> |
||||
|
||||
<select id="findEntityByParam" resultType="com.logpm.basicdata.entity.BasicdataMainCategoryEntity"> |
||||
select * |
||||
from logpm_basicdata_main_category |
||||
where factory_category_id = #{param.factoryCategoryId} |
||||
and main_id = #{param.mainId} |
||||
and is_deleted = 0 |
||||
</select> |
||||
|
||||
</mapper> |
@ -1,7 +1,16 @@
|
||||
package com.logpm.basicdata.service; |
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
import com.logpm.basicdata.dto.ForwardingUnitDTO; |
||||
import com.logpm.basicdata.entity.BasicdataForwardingUnitEntity; |
||||
import org.springblade.core.mp.base.BaseService; |
||||
import org.springblade.core.tool.api.R; |
||||
|
||||
public interface IBasicdataForwardingUnitService extends BaseService<BasicdataForwardingUnitEntity> { |
||||
|
||||
IPage<BasicdataForwardingUnitEntity> pageList(ForwardingUnitDTO forwardingUnitDTO); |
||||
|
||||
R editUnit(ForwardingUnitDTO forwardingUnitDTO); |
||||
|
||||
R removeUnit(ForwardingUnitDTO forwardingUnitDTO); |
||||
} |
||||
|
@ -0,0 +1,15 @@
|
||||
package com.logpm.basicdata.service; |
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
import com.logpm.basicdata.dto.MainDTO; |
||||
import com.logpm.basicdata.entity.BasicdataMainCategoryEntity; |
||||
import org.springblade.core.mp.base.BaseService; |
||||
import org.springblade.core.tool.api.R; |
||||
|
||||
public interface IBasicdataMainCategoryService extends BaseService<BasicdataMainCategoryEntity> { |
||||
IPage<BasicdataMainCategoryEntity> pageList(MainDTO mainDTO); |
||||
|
||||
R editMainCategory(MainDTO mainDTO); |
||||
|
||||
R removeMainCategory(MainDTO mainDTO); |
||||
} |
@ -1,13 +1,18 @@
|
||||
package com.logpm.basicdata.service; |
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
import com.logpm.basicdata.entity.BasicdataHistoricalContractEntity; |
||||
import com.logpm.basicdata.dto.MainDTO; |
||||
import com.logpm.basicdata.entity.BasicdataMainEntity; |
||||
import org.springblade.core.mp.base.BaseService; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* 结算主体表 服务类 |
||||
*/ |
||||
public interface IBasicdataMainService extends BaseService<BasicdataMainEntity> { |
||||
IPage<BasicdataMainEntity> selectBasicdataMainEntityPage(IPage<BasicdataMainEntity> page, BasicdataMainEntity basicdataMainEntity); |
||||
|
||||
List<BasicdataMainEntity> mainList(MainDTO mainDTO); |
||||
|
||||
} |
||||
|
@ -1,16 +1,67 @@
|
||||
package com.logpm.basicdata.service.impl; |
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
||||
import com.logpm.basicdata.dto.ForwardingUnitDTO; |
||||
import com.logpm.basicdata.entity.BasicdataForwardingUnitEntity; |
||||
import com.logpm.basicdata.mapper.BasicdataForwardingUnitMapper; |
||||
import com.logpm.basicdata.service.IBasicdataForwardingUnitService; |
||||
import lombok.AllArgsConstructor; |
||||
import lombok.extern.slf4j.Slf4j; |
||||
import org.springblade.core.mp.base.BaseServiceImpl; |
||||
import org.springblade.core.tool.api.R; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
import java.util.List; |
||||
import java.util.Objects; |
||||
|
||||
@Slf4j |
||||
@Service |
||||
@AllArgsConstructor |
||||
public class BasicdataForwardingUnitServiceImpl extends BaseServiceImpl<BasicdataForwardingUnitMapper, BasicdataForwardingUnitEntity> implements IBasicdataForwardingUnitService { |
||||
|
||||
@Override |
||||
public IPage<BasicdataForwardingUnitEntity> pageList(ForwardingUnitDTO forwardingUnitDTO) { |
||||
|
||||
IPage<Object> page = new Page<>(); |
||||
page.setCurrent(forwardingUnitDTO.getPageNum()); |
||||
page.setSize(forwardingUnitDTO.getPageSize()); |
||||
|
||||
IPage<BasicdataForwardingUnitEntity> pageList = baseMapper.pageList(page,forwardingUnitDTO); |
||||
|
||||
return pageList; |
||||
} |
||||
|
||||
@Override |
||||
public R editUnit(ForwardingUnitDTO forwardingUnitDTO) { |
||||
|
||||
Long warehouseId = forwardingUnitDTO.getWarehouseId(); |
||||
|
||||
BasicdataForwardingUnitEntity forwardingUnitEntity = baseMapper.findByWarehouseId(warehouseId); |
||||
|
||||
if(Objects.isNull(forwardingUnitEntity)){ |
||||
forwardingUnitEntity = new BasicdataForwardingUnitEntity(); |
||||
} |
||||
|
||||
forwardingUnitEntity.setWarehouseId(warehouseId); |
||||
forwardingUnitEntity.setWarehouseName(forwardingUnitDTO.getWarehouseName()); |
||||
forwardingUnitEntity.setClientId(forwardingUnitDTO.getClientId()); |
||||
forwardingUnitEntity.setClientName(forwardingUnitDTO.getClientName()); |
||||
|
||||
saveOrUpdate(forwardingUnitEntity); |
||||
|
||||
return R.success("操作成功"); |
||||
} |
||||
|
||||
@Override |
||||
public R removeUnit(ForwardingUnitDTO forwardingUnitDTO) { |
||||
|
||||
List<Long> ids = forwardingUnitDTO.getIds(); |
||||
|
||||
// baseMapper.removeUnit(ids);
|
||||
|
||||
deleteLogic(ids); |
||||
|
||||
return R.success("操作成功"); |
||||
} |
||||
} |
||||
|
@ -0,0 +1,58 @@
|
||||
package com.logpm.basicdata.service.impl; |
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
||||
import com.logpm.basicdata.dto.MainDTO; |
||||
import com.logpm.basicdata.entity.BasicdataMainCategoryEntity; |
||||
import com.logpm.basicdata.mapper.BasicdataMainCategoryMapper; |
||||
import com.logpm.basicdata.service.IBasicdataMainCategoryService; |
||||
import lombok.AllArgsConstructor; |
||||
import lombok.extern.slf4j.Slf4j; |
||||
import org.springblade.core.mp.base.BaseServiceImpl; |
||||
import org.springblade.core.tool.api.R; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
import java.util.Objects; |
||||
|
||||
@Slf4j |
||||
@AllArgsConstructor |
||||
@Service |
||||
public class BasicdataMainCategoryServiceImpl extends BaseServiceImpl<BasicdataMainCategoryMapper,BasicdataMainCategoryEntity> implements IBasicdataMainCategoryService { |
||||
@Override |
||||
public IPage<BasicdataMainCategoryEntity> pageList(MainDTO mainDTO) { |
||||
IPage<Object> page = new Page<>(); |
||||
page.setCurrent(mainDTO.getPageNum()); |
||||
page.setSize(mainDTO.getPageSize()); |
||||
|
||||
IPage<BasicdataMainCategoryEntity> pageList = baseMapper.pageList(page,mainDTO); |
||||
|
||||
return pageList; |
||||
} |
||||
|
||||
@Override |
||||
public R editMainCategory(MainDTO mainDTO) { |
||||
BasicdataMainCategoryEntity mainCategoryEntity = baseMapper.findEntityByParam(mainDTO); |
||||
|
||||
if(Objects.isNull(mainCategoryEntity)){ |
||||
mainCategoryEntity = new BasicdataMainCategoryEntity(); |
||||
mainCategoryEntity.setFactoryCategoryId(mainDTO.getFactoryCategoryId()); |
||||
mainCategoryEntity.setMainId(mainDTO.getMainId()); |
||||
mainCategoryEntity.setMainName(mainDTO.getMainName()); |
||||
} |
||||
|
||||
mainCategoryEntity.setCategory(mainDTO.getCategory()); |
||||
mainCategoryEntity.setCategoryId(mainDTO.getCategoryId()); |
||||
|
||||
saveOrUpdate(mainCategoryEntity); |
||||
|
||||
return R.success("操作成功"); |
||||
} |
||||
|
||||
@Override |
||||
public R removeMainCategory(MainDTO mainDTO) { |
||||
|
||||
deleteLogic(mainDTO.getIds()); |
||||
|
||||
return R.success("操作成功"); |
||||
} |
||||
} |
Loading…
Reference in new issue