供应商接口对接修改及供货商统计相关接口编写
This commit is contained in:
parent
c8e3ca6f11
commit
894bd4e91a
|
|
@ -77,7 +77,6 @@ public class SupplierController extends BaseController {
|
|||
* 获取供应商信息详细信息
|
||||
*/
|
||||
@ApiOperation(value = "获取供应商信息详细信息")
|
||||
//@RequiresPermissions("ims:supplier:query")
|
||||
@GetMapping(value = "/{supplierId}")
|
||||
public AjaxResult getInfo(@PathVariable("supplierId") Long supplierId) {
|
||||
return success(supplierService.selectSupplierBySupplierId(supplierId));
|
||||
|
|
@ -87,8 +86,6 @@ public class SupplierController extends BaseController {
|
|||
* 新增供应商信息
|
||||
*/
|
||||
@ApiOperation(value = "新增供应商信息")
|
||||
//@PreventRepeatSubmit
|
||||
//@RequiresPermissions("ims:supplier:add")
|
||||
@SysLog(title = "供应商信息", businessType = OperaType.INSERT, logType = 1,module = "仓储管理->新增供应商信息")
|
||||
@PostMapping("/add")
|
||||
public AjaxResult add(@RequestBody SupplierAddDTO supplier) {
|
||||
|
|
@ -103,8 +100,6 @@ public class SupplierController extends BaseController {
|
|||
* 修改供应商信息
|
||||
*/
|
||||
@ApiOperation(value = "修改供应商信息")
|
||||
//@PreventRepeatSubmit
|
||||
//@RequiresPermissions("ims:supplier:edit")
|
||||
@SysLog(title = "供应商信息", businessType = OperaType.UPDATE, logType = 1,module = "仓储管理->修改供应商信息")
|
||||
@PostMapping("/edit")
|
||||
public AjaxResult edit(@RequestBody SupplierEditDTO supplierEditDTO) {
|
||||
|
|
@ -119,8 +114,6 @@ public class SupplierController extends BaseController {
|
|||
* 删除供应商信息
|
||||
*/
|
||||
@ApiOperation(value = "删除供应商信息")
|
||||
//@PreventRepeatSubmit
|
||||
//@RequiresPermissions("ims:supplier:remove")
|
||||
@SysLog(title = "供应商信息", businessType = OperaType.DELETE, logType = 1,module = "仓储管理->删除供应商信息")
|
||||
@PostMapping("/remove")
|
||||
public AjaxResult remove(@RequestBody SupplierDeleteDTO supplierDeleteDTO) {
|
||||
|
|
@ -133,4 +126,13 @@ public class SupplierController extends BaseController {
|
|||
this.supplierService.editSupplierStatus(content);
|
||||
return success();
|
||||
}
|
||||
|
||||
@GetMapping({"/supply_statistics"})
|
||||
@ApiOperation("供应商供货情况统计")
|
||||
public TableDataInfo supplyStatistics(SupplyStatisticsPageDTO content) {
|
||||
startPage();
|
||||
return getDataTable(supplierService.supplyStatistics(content));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,28 @@
|
|||
package com.bonus.canteen.core.ims.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
|
||||
@ApiModel
|
||||
@Data
|
||||
public class SupplyStatisticsPageDTO {
|
||||
|
||||
@ApiModelProperty("开始日期")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
private LocalDate startTime;
|
||||
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
@ApiModelProperty("结束日期")
|
||||
private LocalDate endTime;
|
||||
|
||||
@ApiModelProperty("供应商id")
|
||||
private Long supplierId;
|
||||
|
||||
@ApiModelProperty("区域id列表")
|
||||
private List<Long> areaIdList;
|
||||
}
|
||||
|
|
@ -5,7 +5,9 @@ import java.util.List;
|
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.bonus.canteen.core.ims.domain.Supplier;
|
||||
import com.bonus.canteen.core.ims.dto.SupplierPageDTO;
|
||||
import com.bonus.canteen.core.ims.dto.SupplyStatisticsPageDTO;
|
||||
import com.bonus.canteen.core.ims.vo.SupplierPageVO;
|
||||
import com.bonus.canteen.core.ims.vo.SupplyStatisticsPageVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
|
|
@ -66,4 +68,6 @@ public interface SupplierMapper extends BaseMapper<Supplier> {
|
|||
String getMaxSupplierCode();
|
||||
|
||||
List<SupplierPageVO> selectAllList(@Param("content") SupplierPageDTO content, @Param("delFlag") Integer delFlag);
|
||||
|
||||
List<SupplyStatisticsPageVO> supplyStatistics(@Param("content")SupplyStatisticsPageDTO supplyStatisticsPageDTO, @Param("delFlag") Integer key);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,11 +4,9 @@ import java.util.List;
|
|||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.bonus.canteen.core.ims.domain.Supplier;
|
||||
import com.bonus.canteen.core.ims.dto.SupplierAddDTO;
|
||||
import com.bonus.canteen.core.ims.dto.SupplierEditDTO;
|
||||
import com.bonus.canteen.core.ims.dto.SupplierEditStatusDTO;
|
||||
import com.bonus.canteen.core.ims.dto.SupplierPageDTO;
|
||||
import com.bonus.canteen.core.ims.dto.*;
|
||||
import com.bonus.canteen.core.ims.vo.SupplierPageVO;
|
||||
import com.bonus.canteen.core.ims.vo.SupplyStatisticsPageVO;
|
||||
|
||||
/**
|
||||
* 供应商信息Service接口
|
||||
|
|
@ -66,4 +64,6 @@ public interface ISupplierService extends IService<Supplier> {
|
|||
public int deleteSupplierBySupplierId(Long supplierId);
|
||||
|
||||
void editSupplierStatus(SupplierEditStatusDTO content);
|
||||
|
||||
List<SupplyStatisticsPageVO> supplyStatistics(SupplyStatisticsPageDTO content);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ import com.bonus.canteen.core.ims.service.*;
|
|||
import com.bonus.canteen.core.ims.vo.SupplierDeliverVO;
|
||||
import com.bonus.canteen.core.ims.vo.SupplierPageVO;
|
||||
import com.bonus.canteen.core.ims.vo.SupplierQualificationDetailPageVO;
|
||||
import com.bonus.canteen.core.ims.vo.SupplyStatisticsPageVO;
|
||||
import com.bonus.canteen.core.kitchen.domain.KitchenDeviceInfo;
|
||||
import com.bonus.common.core.exception.ServiceException;
|
||||
import com.bonus.common.core.utils.DateUtils;
|
||||
|
|
@ -259,4 +260,13 @@ public class SupplierServiceImpl extends ServiceImpl<SupplierMapper, Supplier>
|
|||
String username = SecurityUtils.getLoginUser().getUserid()+"";
|
||||
this.baseMapper.update(null,Wrappers.lambdaUpdate(Supplier.class).eq(Supplier::getSupplierId, content.getSupplierId()).set(Supplier::getStatus, content.getStatus()).set(Supplier::getUpdateBy, username));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SupplyStatisticsPageVO> supplyStatistics(SupplyStatisticsPageDTO supplyStatisticsPageDTO) {
|
||||
List<SupplyStatisticsPageVO> pageVOList = supplierMapper.supplyStatistics(supplyStatisticsPageDTO, DelFlagEnum.DEL_FALSE.key());
|
||||
//TODO 合格率
|
||||
//TODO 订单数量
|
||||
|
||||
return pageVOList;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,38 @@
|
|||
package com.bonus.canteen.core.ims.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
|
||||
@ApiModel
|
||||
@Data
|
||||
public class SupplyStatisticsPageVO {
|
||||
@ApiModelProperty("供应商编号")
|
||||
private String supplierCode;
|
||||
@ApiModelProperty("供应商id")
|
||||
private Long supplierId;
|
||||
@ApiModelProperty("供应商名称")
|
||||
private String supplierName;
|
||||
@ApiModelProperty("所属区域id")
|
||||
private Long areaId;
|
||||
@ApiModelProperty("所属区域")
|
||||
private String areaName;
|
||||
@ApiModelProperty("中标次数")
|
||||
private Integer bidNumbers;
|
||||
@ApiModelProperty("累计中标金额")
|
||||
private Long cumulativeBidAmount;
|
||||
@ApiModelProperty("交货合格率(%)")
|
||||
private BigDecimal deliveryPassRate;
|
||||
@ApiModelProperty("上次中标日期")
|
||||
private LocalDate lastBidDate;
|
||||
@ApiModelProperty("上次中标金额")
|
||||
private Long lastBidAmount;
|
||||
@ApiModelProperty("订单数量")
|
||||
private Integer orderNum;
|
||||
@ApiModelProperty("订单金额")
|
||||
private Long orderAmount;
|
||||
|
||||
}
|
||||
|
|
@ -380,4 +380,27 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
|
||||
|
||||
</select>
|
||||
|
||||
<select id="supplyStatistics" resultType="com.bonus.canteen.core.ims.vo.SupplyStatisticsPageVO">
|
||||
SELECT
|
||||
a.supplier_code,
|
||||
a.supplier_id,
|
||||
a.supplier_name,
|
||||
a.area_id,
|
||||
aa.area_name
|
||||
FROM
|
||||
ims_supplier a
|
||||
LEFT JOIN basic_area aa on a.area_id = aa.area_id
|
||||
WHERE
|
||||
a.del_flag = #{delFlag}
|
||||
<if test="content.supplierId != null">
|
||||
AND a.supplier_id = #{content.supplierId}
|
||||
</if>
|
||||
<if test="content.areaIdList != null and content.areaIdList.size() > 0">
|
||||
and a.area_id in
|
||||
<foreach collection="content.areaIdList" item="item" separator="," open="(" close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
Loading…
Reference in New Issue