
12 changed files with 799 additions and 0 deletions
@ -0,0 +1,64 @@ |
|||
/********************************************************* |
|||
********************************************************* |
|||
******************** ******************* |
|||
************* ************ |
|||
******* _oo0oo_ ******* |
|||
*** o8888888o *** |
|||
* 88" . "88 * |
|||
* (| -_- |) * |
|||
* 0\ = /0 * |
|||
* ___/`---'\___ * |
|||
* .' \\| |// '. *
|
|||
* / \\||| : |||// \ *
|
|||
* / _||||| -:- |||||- \ * |
|||
* | | \\\ - /// | | *
|
|||
* | \_| ''\---/'' |_/ | * |
|||
* \ .-\__ '-' ___/-. / * |
|||
* ___'. .' /--.--\ `. .'___ * |
|||
* ."" '< `.___\_<|>_/___.' >' "". * |
|||
* | | : `- \`.;`\ _ /`;.`/ - ` : | | * |
|||
* \ \ `_. \_ __\ /__ _/ .-` / / * |
|||
* =====`-.____`.___ \_____/___.-`___.-'===== * |
|||
* `=---=' * |
|||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * |
|||
*********__佛祖保佑__永无BUG__验收通过__钞票多多__********* |
|||
*********************************************************/ |
|||
package com.yxt.anrui.scm.api.scmvehinventorymonth; |
|||
|
|||
|
|||
import com.yxt.common.core.query.Query; |
|||
import io.swagger.annotations.ApiModel; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* Project: aaa(aaa) <br/> |
|||
* File: ScmVehInventorymonthQuery.java <br/> |
|||
* Class: com.yxt.anrui.scm.api.api.scmvehinventorymonth.ScmVehInventorymonthQuery <br/> |
|||
* Description: 月度盘库 查询条件. <br/> |
|||
* Copyright: Copyright (c) 2011 <br/> |
|||
* Company: https://gitee.com/liuzp315 <br/>
|
|||
* Makedate: 2022-09-16 15:52:05 <br/> |
|||
* |
|||
* @author liupopo |
|||
* @version 1.0 |
|||
* @since 1.0 |
|||
*/ |
|||
@Data |
|||
@ApiModel(value = "月度盘库 查询条件", description = "月度盘库 查询条件") |
|||
public class AppScmVehInventorymonthQuery implements Query { |
|||
|
|||
@ApiModelProperty("用户sid") |
|||
private String userSid; |
|||
@ApiModelProperty("报告编号/创建人") |
|||
private String names; |
|||
@ApiModelProperty("创建日期") |
|||
private String date; |
|||
@ApiModelProperty("盘库报告sid") |
|||
private String reportSid; |
|||
@ApiModelProperty("盘库结果") |
|||
private String state; |
|||
@ApiModelProperty("使用组织名称") |
|||
private String useOrgSid; |
|||
|
|||
} |
@ -0,0 +1,80 @@ |
|||
/********************************************************* |
|||
********************************************************* |
|||
******************** ******************* |
|||
************* ************ |
|||
******* _oo0oo_ ******* |
|||
*** o8888888o *** |
|||
* 88" . "88 * |
|||
* (| -_- |) * |
|||
* 0\ = /0 * |
|||
* ___/`---'\___ * |
|||
* .' \\| |// '. *
|
|||
* / \\||| : |||// \ *
|
|||
* / _||||| -:- |||||- \ * |
|||
* | | \\\ - /// | | *
|
|||
* | \_| ''\---/'' |_/ | * |
|||
* \ .-\__ '-' ___/-. / * |
|||
* ___'. .' /--.--\ `. .'___ * |
|||
* ."" '< `.___\_<|>_/___.' >' "". * |
|||
* | | : `- \`.;`\ _ /`;.`/ - ` : | | * |
|||
* \ \ `_. \_ __\ /__ _/ .-` / / * |
|||
* =====`-.____`.___ \_____/___.-`___.-'===== * |
|||
* `=---=' * |
|||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * |
|||
*********__佛祖保佑__永无BUG__验收通过__钞票多多__********* |
|||
*********************************************************/ |
|||
package com.yxt.anrui.scm.api.scmvehinventorymonth; |
|||
|
|||
|
|||
import com.yxt.common.core.vo.Vo; |
|||
import io.swagger.annotations.ApiModel; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* Project: aaa(aaa) <br/> |
|||
* File: ScmVehInventorymonthVo.java <br/> |
|||
* Class: com.yxt.anrui.scm.api.api.scmvehinventorymonth.ScmVehInventorymonthVo <br/> |
|||
* Description: 月度盘库 视图数据对象. <br/> |
|||
* Copyright: Copyright (c) 2011 <br/> |
|||
* Company: https://gitee.com/liuzp315 <br/>
|
|||
* Makedate: 2022-09-16 15:52:05 <br/> |
|||
* |
|||
* @author liupopo |
|||
* @version 1.0 |
|||
* @since 1.0 |
|||
*/ |
|||
@Data |
|||
@ApiModel(value = "月度盘库 视图数据对象", description = "月度盘库 视图数据对象") |
|||
public class AppScmVehInventorymonthVo implements Vo { |
|||
|
|||
private String sid; // sid
|
|||
|
|||
@ApiModelProperty("编号(yyyyMMdd)") |
|||
private String billNo; // 编号(yyyyMMdd)
|
|||
@ApiModelProperty("创建组织") |
|||
private String createOrgSid; // 创建组织
|
|||
@ApiModelProperty("创建组织名称") |
|||
private String createOrgName; // 创建组织名称
|
|||
@ApiModelProperty("使用组织") |
|||
private String useOrgSid; // 使用组织
|
|||
@ApiModelProperty("使用组织名称") |
|||
private String useOrgName; // 使用组织名称
|
|||
@ApiModelProperty("剩余盘库记录数量") |
|||
private String surplusNumber; |
|||
@ApiModelProperty("盘库记录总数数量") |
|||
private String totalNumber; |
|||
@ApiModelProperty("盘亏数量") |
|||
private String lossNumber; |
|||
@ApiModelProperty("盘损数量") |
|||
private String damageNumber; |
|||
@ApiModelProperty("盘盈数量") |
|||
private String profitNumber; |
|||
@ApiModelProperty("实盘数量") |
|||
private String actualNumber; |
|||
@ApiModelProperty("是否显示生成报告按钮 剩余盘库记录=0时显示") |
|||
private Boolean showBtn; |
|||
|
|||
|
|||
|
|||
} |
@ -0,0 +1,65 @@ |
|||
/********************************************************* |
|||
********************************************************* |
|||
******************** ******************* |
|||
************* ************ |
|||
******* _oo0oo_ ******* |
|||
*** o8888888o *** |
|||
* 88" . "88 * |
|||
* (| -_- |) * |
|||
* 0\ = /0 * |
|||
* ___/`---'\___ * |
|||
* .' \\| |// '. *
|
|||
* / \\||| : |||// \ *
|
|||
* / _||||| -:- |||||- \ * |
|||
* | | \\\ - /// | | *
|
|||
* | \_| ''\---/'' |_/ | * |
|||
* \ .-\__ '-' ___/-. / * |
|||
* ___'. .' /--.--\ `. .'___ * |
|||
* ."" '< `.___\_<|>_/___.' >' "". * |
|||
* | | : `- \`.;`\ _ /`;.`/ - ` : | | * |
|||
* \ \ `_. \_ __\ /__ _/ .-` / / * |
|||
* =====`-.____`.___ \_____/___.-`___.-'===== * |
|||
* `=---=' * |
|||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * |
|||
*********__佛祖保佑__永无BUG__验收通过__钞票多多__********* |
|||
*********************************************************/ |
|||
package com.yxt.anrui.scm.biz.scmvehinventorymonth; |
|||
|
|||
import com.baomidou.mybatisplus.core.conditions.Wrapper; |
|||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
import com.baomidou.mybatisplus.core.toolkit.Constants; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
import org.apache.ibatis.annotations.Param; |
|||
import org.apache.ibatis.annotations.Select; |
|||
import com.yxt.anrui.scm.api.scmvehinventorymonth.ScmVehInventorymonth; |
|||
import com.yxt.anrui.scm.api.scmvehinventorymonth.ScmVehInventorymonthVo; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* Project: aaa(aaa) <br/> |
|||
* File: ScmVehInventorymonthMapper.java <br/> |
|||
* Class: com.yxt.anrui.scm.api.biz.scmvehinventorymonth.ScmVehInventorymonthMapper <br/> |
|||
* Description: 月度盘库. <br/> |
|||
* Copyright: Copyright (c) 2011 <br/> |
|||
* Company: https://gitee.com/liuzp315 <br/>
|
|||
* Makedate: 2022-09-16 15:52:05 <br/> |
|||
* |
|||
* @author liupopo |
|||
* @version 1.0 |
|||
* @since 1.0 |
|||
*/ |
|||
@Mapper |
|||
public interface ScmVehInventorymonthMapper extends BaseMapper<ScmVehInventorymonth> { |
|||
|
|||
//@Update("update scm_veh_inventorymonth set name=#{msg} where id=#{id}")
|
|||
//IPage<ScmVehInventorymonthVo> voPage(IPage<ScmVehInventorymonth> page, @Param(Constants.WRAPPER) QueryWrapper<ScmVehInventorymonth> qw);
|
|||
|
|||
IPage<ScmVehInventorymonthVo> selectPageVo(IPage<ScmVehInventorymonth> page, @Param(Constants.WRAPPER) Wrapper<ScmVehInventorymonth> qw); |
|||
|
|||
List<ScmVehInventorymonthVo> selectListAllVo(@Param(Constants.WRAPPER) Wrapper<ScmVehInventorymonth> qw); |
|||
|
|||
@Select("select * from scm_veh_inventorymonth") |
|||
List<ScmVehInventorymonthVo> selectListVo(); |
|||
} |
@ -0,0 +1,13 @@ |
|||
<?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.yxt.anrui.scm.biz.scmvehinventorymonth.ScmVehInventorymonthMapper"> |
|||
<!-- <where> ${ew.sqlSegment} </where>--> |
|||
<!-- ${ew.customSqlSegment} --> |
|||
<select id="selectPageVo" resultType="com.yxt.anrui.scm.api.scmvehinventorymonth.ScmVehInventorymonthVo"> |
|||
SELECT * FROM scm_veh_inventorymonth <where> ${ew.sqlSegment} </where> |
|||
</select> |
|||
|
|||
<select id="selectListAllVo" resultType="com.yxt.anrui.scm.api.scmvehinventorymonth.ScmVehInventorymonthVo"> |
|||
SELECT * FROM scm_veh_inventorymonth <where> ${ew.sqlSegment} </where> |
|||
</select> |
|||
</mapper> |
@ -0,0 +1,106 @@ |
|||
package com.yxt.anrui.scm.biz.scmvehinventorymonth; /********************************************************* |
|||
********************************************************* |
|||
******************** ******************* |
|||
************* ************ |
|||
******* _oo0oo_ ******* |
|||
*** o8888888o *** |
|||
* 88" . "88 * |
|||
* (| -_- |) * |
|||
* 0\ = /0 * |
|||
* ___/`---'\___ * |
|||
* .' \\| |// '. *
|
|||
* / \\||| : |||// \ *
|
|||
* / _||||| -:- |||||- \ * |
|||
* | | \\\ - /// | | *
|
|||
* | \_| ''\---/'' |_/ | * |
|||
* \ .-\__ '-' ___/-. / * |
|||
* ___'. .' /--.--\ `. .'___ * |
|||
* ."" '< `.___\_<|>_/___.' >' "". * |
|||
* | | : `- \`.;`\ _ /`;.`/ - ` : | | * |
|||
* \ \ `_. \_ __\ /__ _/ .-` / / * |
|||
* =====`-.____`.___ \_____/___.-`___.-'===== * |
|||
* `=---=' * |
|||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * |
|||
*********__佛祖保佑__永无BUG__验收通过__钞票多多__********* |
|||
*********************************************************/ |
|||
|
|||
|
|||
import com.yxt.anrui.scm.api.scmvehinventorymonth.*; |
|||
import com.yxt.anrui.scm.biz.scmvehinventorymonth.ScmVehInventorymonthService; |
|||
import com.yxt.common.core.query.PagerQuery; |
|||
import com.yxt.common.core.result.ResultBean; |
|||
import com.yxt.common.core.vo.PagerVo; |
|||
import io.swagger.annotations.Api; |
|||
import io.swagger.annotations.ApiOperation; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* Project: aaa(aaa) <br/> |
|||
* File: ScmVehInventorymonthFeignFallback.java <br/> |
|||
* Class: com.yxt.anrui.scm.api.biz.scmvehinventorymonth.ScmVehInventorymonthRest <br/> |
|||
* Description: 月度盘库. <br/> |
|||
* Copyright: Copyright (c) 2011 <br/> |
|||
* Company: https://gitee.com/liuzp315 <br/>
|
|||
* Makedate: 2022-09-16 15:52:05 <br/> |
|||
* |
|||
* @author liupopo |
|||
* @version 1.0 |
|||
* @since 1.0 |
|||
*/ |
|||
@Api(tags = "月度盘库") |
|||
@RestController("com.yxt.anrui.scm.api.scmvehinventorymonth.ScmVehInventorymonthRest") |
|||
@RequestMapping("v1/scmvehinventorymonth") |
|||
public class ScmVehInventorymonthRest implements ScmVehInventorymonthFeign { |
|||
|
|||
@Autowired |
|||
private ScmVehInventorymonthService scmVehInventorymonthService; |
|||
|
|||
@Override |
|||
@ApiOperation("根据条件分页查询数据的列表") |
|||
@PostMapping("/listPage") |
|||
public ResultBean<PagerVo<ScmVehInventorymonthVo>> listPage(@RequestBody PagerQuery<ScmVehInventorymonthQuery> pq) { |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
PagerVo<ScmVehInventorymonthVo> pv = scmVehInventorymonthService.listPageVo(pq); |
|||
return rb.success().setData(pv); |
|||
} |
|||
|
|||
@Override |
|||
@ApiOperation("新增或修改") |
|||
@PostMapping("/save") |
|||
public ResultBean save(@RequestBody ScmVehInventorymonthDto dto) { |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
scmVehInventorymonthService.saveOrUpdateDto(dto); |
|||
return rb.success(); |
|||
} |
|||
|
|||
@Override |
|||
@ApiOperation("根据sid批量删除") |
|||
@PostMapping("/delBySids") |
|||
public ResultBean delBySids(@RequestBody String[] sids) { |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
scmVehInventorymonthService.delBySids(sids); |
|||
return rb.success(); |
|||
} |
|||
|
|||
@Override |
|||
@ApiOperation("根据SID获取一条记录") |
|||
@GetMapping("/fetchDetailsBySid/{sid}") |
|||
public ResultBean<ScmVehInventorymonthDetailsVo> fetchDetailsBySid(@PathVariable("sid") String sid) { |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
ScmVehInventorymonthDetailsVo vo = scmVehInventorymonthService.fetchDetailsVoBySid(sid); |
|||
return rb.success().setData(vo); |
|||
} |
|||
|
|||
@Override |
|||
public ResultBean getInventoryRecords(String userSid) { |
|||
return scmVehInventorymonthService.getInventoryRecords(userSid); |
|||
} |
|||
|
|||
@Override |
|||
public ResultBean<PagerVo<AppScmVehInventorymonthVo>> getCarInventoryReportList(PagerQuery<AppScmVehInventorymonthQuery> pagerQuery) { |
|||
return null; |
|||
} |
|||
} |
@ -0,0 +1,170 @@ |
|||
/********************************************************* |
|||
********************************************************* |
|||
******************** ******************* |
|||
************* ************ |
|||
******* _oo0oo_ ******* |
|||
*** o8888888o *** |
|||
* 88" . "88 * |
|||
* (| -_- |) * |
|||
* 0\ = /0 * |
|||
* ___/`---'\___ * |
|||
* .' \\| |// '. *
|
|||
* / \\||| : |||// \ *
|
|||
* / _||||| -:- |||||- \ * |
|||
* | | \\\ - /// | | *
|
|||
* | \_| ''\---/'' |_/ | * |
|||
* \ .-\__ '-' ___/-. / * |
|||
* ___'. .' /--.--\ `. .'___ * |
|||
* ."" '< `.___\_<|>_/___.' >' "". * |
|||
* | | : `- \`.;`\ _ /`;.`/ - ` : | | * |
|||
* \ \ `_. \_ __\ /__ _/ .-` / / * |
|||
* =====`-.____`.___ \_____/___.-`___.-'===== * |
|||
* `=---=' * |
|||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * |
|||
*********__佛祖保佑__永无BUG__验收通过__钞票多多__********* |
|||
*********************************************************/ |
|||
package com.yxt.anrui.scm.biz.scmvehinventorymonth; |
|||
|
|||
import cn.hutool.core.bean.BeanUtil; |
|||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|||
import com.yxt.anrui.base.api.basevehicle.AppScmInventoryRecordsVo; |
|||
import com.yxt.anrui.base.api.basevehicle.BaseVehicleFeign; |
|||
import com.yxt.anrui.portal.api.sysstafforg.SysStaffOrg; |
|||
import com.yxt.anrui.portal.api.sysstafforg.SysStaffOrgFeign; |
|||
import com.yxt.anrui.portal.api.sysuser.SysUserFeign; |
|||
import com.yxt.anrui.portal.api.sysuser.SysUserVo; |
|||
import com.yxt.anrui.scm.api.scmvehicleinventory.ScmVehicleInventory; |
|||
import com.yxt.anrui.scm.biz.scmvehicleinventory.ScmVehicleInventoryService; |
|||
import org.apache.commons.lang3.StringUtils; |
|||
import com.yxt.common.base.service.MybatisBaseService; |
|||
import com.yxt.common.base.utils.PagerUtil; |
|||
import com.yxt.common.core.query.PagerQuery; |
|||
import com.yxt.common.core.result.ResultBean; |
|||
import com.yxt.common.core.vo.PagerVo; |
|||
import com.yxt.anrui.scm.api.scmvehinventorymonth.ScmVehInventorymonth; |
|||
import com.yxt.anrui.scm.api.scmvehinventorymonth.ScmVehInventorymonthQuery; |
|||
import com.yxt.anrui.scm.api.scmvehinventorymonth.ScmVehInventorymonthVo; |
|||
import com.yxt.anrui.scm.api.scmvehinventorymonth.ScmVehInventorymonthDetailsVo; |
|||
import com.yxt.anrui.scm.api.scmvehinventorymonth.ScmVehInventorymonthDto; |
|||
import com.yxt.anrui.scm.api.scmvehinventorymonth.ScmVehInventorymonthFeign; |
|||
|
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
import org.springframework.transaction.annotation.Transactional; |
|||
|
|||
import java.util.Collections; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* Project: aaa(aaa) <br/> |
|||
* File: ScmVehInventorymonthService.java <br/> |
|||
* Class: com.yxt.anrui.scm.api.biz.scmvehinventorymonth.ScmVehInventorymonthService <br/> |
|||
* Description: 月度盘库 业务逻辑. <br/> |
|||
* Copyright: Copyright (c) 2011 <br/> |
|||
* Company: https://gitee.com/liuzp315 <br/>
|
|||
* Makedate: 2022-09-16 15:52:05 <br/> |
|||
* |
|||
* @author liupopo |
|||
* @version 1.0 |
|||
* @since 1.0 |
|||
*/ |
|||
@Service |
|||
public class ScmVehInventorymonthService extends MybatisBaseService<ScmVehInventorymonthMapper, ScmVehInventorymonth> { |
|||
|
|||
@Autowired |
|||
SysStaffOrgFeign sysStaffOrgFeign; |
|||
@Autowired |
|||
BaseVehicleFeign baseVehicleFeign; |
|||
@Autowired |
|||
SysUserFeign sysUserFeign; |
|||
@Autowired |
|||
ScmVehicleInventoryService scmVehicleInventoryService; |
|||
|
|||
|
|||
private QueryWrapper<ScmVehInventorymonth> createQueryWrapper(ScmVehInventorymonthQuery query) { |
|||
// todo: 这里根据具体业务调整查询条件
|
|||
// 多字段Like示例:qw.and(wrapper -> wrapper.like("name", query.getName()).or().like("remark", query.getName()));
|
|||
QueryWrapper<ScmVehInventorymonth> qw = new QueryWrapper<>(); |
|||
return qw; |
|||
} |
|||
|
|||
public PagerVo<ScmVehInventorymonthVo> listPageVo(PagerQuery<ScmVehInventorymonthQuery> pq) { |
|||
ScmVehInventorymonthQuery query = pq.getParams(); |
|||
QueryWrapper<ScmVehInventorymonth> qw = createQueryWrapper(query); |
|||
IPage<ScmVehInventorymonth> page = PagerUtil.queryToPage(pq); |
|||
IPage<ScmVehInventorymonthVo> pagging = baseMapper.selectPageVo(page, qw); |
|||
PagerVo<ScmVehInventorymonthVo> p = PagerUtil.pageToVo(pagging, null); |
|||
return p; |
|||
} |
|||
|
|||
public void saveOrUpdateDto(ScmVehInventorymonthDto dto) { |
|||
String dtoSid = dto.getSid(); |
|||
if (StringUtils.isBlank(dtoSid)) { |
|||
this.insertByDto(dto); |
|||
return; |
|||
} |
|||
this.updateByDto(dto); |
|||
} |
|||
|
|||
public void insertByDto(ScmVehInventorymonthDto dto) { |
|||
ScmVehInventorymonth entity = new ScmVehInventorymonth(); |
|||
BeanUtil.copyProperties(dto, entity, "id", "sid"); |
|||
baseMapper.insert(entity); |
|||
} |
|||
|
|||
public void updateByDto(ScmVehInventorymonthDto dto) { |
|||
String dtoSid = dto.getSid(); |
|||
if (StringUtils.isBlank(dtoSid)) { |
|||
return; |
|||
} |
|||
ScmVehInventorymonth entity = fetchBySid(dtoSid); |
|||
BeanUtil.copyProperties(dto, entity, "id", "sid"); |
|||
baseMapper.updateById(entity); |
|||
} |
|||
|
|||
public ScmVehInventorymonthDetailsVo fetchDetailsVoBySid(String sid) { |
|||
ScmVehInventorymonth entity = fetchBySid(sid); |
|||
ScmVehInventorymonthDetailsVo vo = new ScmVehInventorymonthDetailsVo(); |
|||
BeanUtil.copyProperties(entity, vo); |
|||
return vo; |
|||
} |
|||
|
|||
@Transactional(rollbackFor = Exception.class) |
|||
public ResultBean getInventoryRecords(String userSid) { |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
String useOrgSid = sysStaffOrgFeign.getPathSidByUserSid(userSid).getData(); |
|||
SysUserVo sysUserVo = sysUserFeign.fetchBySid(userSid).getData(); |
|||
SysStaffOrg sysStaffOrg = sysStaffOrgFeign.getOrgByStaffSid(sysUserVo.getStaffSid()).getData(); |
|||
boolean inventoryState = scmVehicleInventoryService.getInventoryState(userSid); |
|||
if (inventoryState) { |
|||
return rb.setMsg("盘库记录生成失败,记录存在未确认数据"); |
|||
} |
|||
List<AppScmInventoryRecordsVo> list = baseVehicleFeign.selectInventoryRecords(userSid).getData(); |
|||
ScmVehInventorymonth scmVehInventorymonth = new ScmVehInventorymonth(); |
|||
scmVehInventorymonth.setBillNo(""); |
|||
scmVehInventorymonth.setCreateOrgSid(useOrgSid); |
|||
scmVehInventorymonth.setCreateOrgName(sysStaffOrg.getOrgName()); |
|||
scmVehInventorymonth.setUseOrgSid(useOrgSid); |
|||
scmVehInventorymonth.setUseOrgName(sysStaffOrg.getOrgName()); |
|||
save(scmVehInventorymonth); |
|||
list.removeAll(Collections.singleton(null)); |
|||
if (!list.isEmpty()) { |
|||
for (AppScmInventoryRecordsVo appScmInventoryRecordsVo : list) { |
|||
ScmVehicleInventory scmVehicleInventory = new ScmVehicleInventory(); |
|||
scmVehicleInventory.setVinNo(appScmInventoryRecordsVo.getVin()); |
|||
scmVehicleInventory.setMainSid(scmVehInventorymonth.getSid()); |
|||
scmVehicleInventory.setLocation(appScmInventoryRecordsVo.getWarehouse()); |
|||
scmVehicleInventory.setLocationSid(appScmInventoryRecordsVo.getWarehouseSid()); |
|||
scmVehicleInventory.setInventoryState("无"); |
|||
scmVehicleInventory.setInventoryStateKey(""); |
|||
scmVehicleInventory.setCreateOrgSid(useOrgSid); |
|||
scmVehicleInventory.setUseOrgSid(useOrgSid); |
|||
scmVehicleInventoryService.save(scmVehicleInventory); |
|||
} |
|||
} else { |
|||
return rb.setMsg("暂无需要盘库记录"); |
|||
} |
|||
return rb.success(); |
|||
} |
|||
} |
@ -0,0 +1,65 @@ |
|||
/********************************************************* |
|||
********************************************************* |
|||
******************** ******************* |
|||
************* ************ |
|||
******* _oo0oo_ ******* |
|||
*** o8888888o *** |
|||
* 88" . "88 * |
|||
* (| -_- |) * |
|||
* 0\ = /0 * |
|||
* ___/`---'\___ * |
|||
* .' \\| |// '. *
|
|||
* / \\||| : |||// \ *
|
|||
* / _||||| -:- |||||- \ * |
|||
* | | \\\ - /// | | *
|
|||
* | \_| ''\---/'' |_/ | * |
|||
* \ .-\__ '-' ___/-. / * |
|||
* ___'. .' /--.--\ `. .'___ * |
|||
* ."" '< `.___\_<|>_/___.' >' "". * |
|||
* | | : `- \`.;`\ _ /`;.`/ - ` : | | * |
|||
* \ \ `_. \_ __\ /__ _/ .-` / / * |
|||
* =====`-.____`.___ \_____/___.-`___.-'===== * |
|||
* `=---=' * |
|||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * |
|||
*********__佛祖保佑__永无BUG__验收通过__钞票多多__********* |
|||
*********************************************************/ |
|||
package com.yxt.anrui.scm.biz.scmvehinventoryreport; |
|||
|
|||
import com.baomidou.mybatisplus.core.conditions.Wrapper; |
|||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
import com.baomidou.mybatisplus.core.toolkit.Constants; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
import org.apache.ibatis.annotations.Param; |
|||
import org.apache.ibatis.annotations.Select; |
|||
import com.yxt.anrui.scm.api.scmvehinventoryreport.ScmVehInventoryreport; |
|||
import com.yxt.anrui.scm.api.scmvehinventoryreport.ScmVehInventoryreportVo; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* Project: aaa(aaa) <br/> |
|||
* File: ScmVehInventoryreportMapper.java <br/> |
|||
* Class: com.yxt.anrui.scm.api.biz.scmvehinventoryreport.ScmVehInventoryreportMapper <br/> |
|||
* Description: 盘库报告. <br/> |
|||
* Copyright: Copyright (c) 2011 <br/> |
|||
* Company: https://gitee.com/liuzp315 <br/>
|
|||
* Makedate: 2022-09-16 15:52:05 <br/> |
|||
* |
|||
* @author liupopo |
|||
* @version 1.0 |
|||
* @since 1.0 |
|||
*/ |
|||
@Mapper |
|||
public interface ScmVehInventoryreportMapper extends BaseMapper<ScmVehInventoryreport> { |
|||
|
|||
//@Update("update scm_veh_inventoryreport set name=#{msg} where id=#{id}")
|
|||
//IPage<ScmVehInventoryreportVo> voPage(IPage<ScmVehInventoryreport> page, @Param(Constants.WRAPPER) QueryWrapper<ScmVehInventoryreport> qw);
|
|||
|
|||
IPage<ScmVehInventoryreportVo> selectPageVo(IPage<ScmVehInventoryreport> page, @Param(Constants.WRAPPER) Wrapper<ScmVehInventoryreport> qw); |
|||
|
|||
List<ScmVehInventoryreportVo> selectListAllVo(@Param(Constants.WRAPPER) Wrapper<ScmVehInventoryreport> qw); |
|||
|
|||
@Select("select * from scm_veh_inventoryreport") |
|||
List<ScmVehInventoryreportVo> selectListVo(); |
|||
} |
@ -0,0 +1,13 @@ |
|||
<?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.yxt.anrui.scm.biz.scmvehinventoryreport.ScmVehInventoryreportMapper"> |
|||
<!-- <where> ${ew.sqlSegment} </where>--> |
|||
<!-- ${ew.customSqlSegment} --> |
|||
<select id="selectPageVo" resultType="com.yxt.anrui.scm.api.scmvehinventoryreport.ScmVehInventoryreportVo"> |
|||
SELECT * FROM scm_veh_inventoryreport <where> ${ew.sqlSegment} </where> |
|||
</select> |
|||
|
|||
<select id="selectListAllVo" resultType="com.yxt.anrui.scm.api.scmvehinventoryreport.ScmVehInventoryreportVo"> |
|||
SELECT * FROM scm_veh_inventoryreport <where> ${ew.sqlSegment} </where> |
|||
</select> |
|||
</mapper> |
@ -0,0 +1,100 @@ |
|||
/********************************************************* |
|||
********************************************************* |
|||
******************** ******************* |
|||
************* ************ |
|||
******* _oo0oo_ ******* |
|||
*** o8888888o *** |
|||
* 88" . "88 * |
|||
* (| -_- |) * |
|||
* 0\ = /0 * |
|||
* ___/`---'\___ * |
|||
* .' \\| |// '. *
|
|||
* / \\||| : |||// \ *
|
|||
* / _||||| -:- |||||- \ * |
|||
* | | \\\ - /// | | *
|
|||
* | \_| ''\---/'' |_/ | * |
|||
* \ .-\__ '-' ___/-. / * |
|||
* ___'. .' /--.--\ `. .'___ * |
|||
* ."" '< `.___\_<|>_/___.' >' "". * |
|||
* | | : `- \`.;`\ _ /`;.`/ - ` : | | * |
|||
* \ \ `_. \_ __\ /__ _/ .-` / / * |
|||
* =====`-.____`.___ \_____/___.-`___.-'===== * |
|||
* `=---=' * |
|||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * |
|||
*********__佛祖保佑__永无BUG__验收通过__钞票多多__********* |
|||
*********************************************************/ |
|||
package com.yxt.anrui.scm.biz.scmvehinventoryreport; |
|||
|
|||
import com.yxt.common.core.query.PagerQuery; |
|||
import com.yxt.common.core.result.ResultBean; |
|||
import com.yxt.common.core.vo.PagerVo; |
|||
import io.swagger.annotations.Api; |
|||
import io.swagger.annotations.ApiOperation; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import java.util.List; |
|||
import com.yxt.anrui.scm.api.scmvehinventoryreport.ScmVehInventoryreport; |
|||
import com.yxt.anrui.scm.api.scmvehinventoryreport.ScmVehInventoryreportQuery; |
|||
import com.yxt.anrui.scm.api.scmvehinventoryreport.ScmVehInventoryreportVo; |
|||
import com.yxt.anrui.scm.api.scmvehinventoryreport.ScmVehInventoryreportDetailsVo; |
|||
import com.yxt.anrui.scm.api.scmvehinventoryreport.ScmVehInventoryreportDto; |
|||
import com.yxt.anrui.scm.api.scmvehinventoryreport.ScmVehInventoryreportFeign; |
|||
|
|||
/** |
|||
* Project: aaa(aaa) <br/> |
|||
* File: ScmVehInventoryreportFeignFallback.java <br/> |
|||
* Class: com.yxt.anrui.scm.api.biz.scmvehinventoryreport.ScmVehInventoryreportRest <br/> |
|||
* Description: 盘库报告. <br/> |
|||
* Copyright: Copyright (c) 2011 <br/> |
|||
* Company: https://gitee.com/liuzp315 <br/>
|
|||
* Makedate: 2022-09-16 15:52:05 <br/> |
|||
* |
|||
* @author liupopo |
|||
* @version 1.0 |
|||
* @since 1.0 |
|||
*/ |
|||
@Api(tags = "盘库报告") |
|||
@RestController("com.yxt.anrui.scm.api.scmvehinventoryreport.ScmVehInventoryreportRest") |
|||
@RequestMapping("v1/scmvehinventoryreport") |
|||
public class ScmVehInventoryreportRest implements ScmVehInventoryreportFeign { |
|||
|
|||
@Autowired |
|||
private ScmVehInventoryreportService scmVehInventoryreportService; |
|||
|
|||
@Override |
|||
@ApiOperation("根据条件分页查询数据的列表") |
|||
@PostMapping("/listPage") |
|||
public ResultBean<PagerVo<ScmVehInventoryreportVo>> listPage(@RequestBody PagerQuery<ScmVehInventoryreportQuery> pq){ |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
PagerVo<ScmVehInventoryreportVo> pv = scmVehInventoryreportService.listPageVo(pq); |
|||
return rb.success().setData(pv); |
|||
} |
|||
|
|||
@Override |
|||
@ApiOperation("新增或修改") |
|||
@PostMapping("/save") |
|||
public ResultBean save(@RequestBody ScmVehInventoryreportDto dto){ |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
scmVehInventoryreportService.saveOrUpdateDto(dto); |
|||
return rb.success(); |
|||
} |
|||
|
|||
@Override |
|||
@ApiOperation("根据sid批量删除") |
|||
@PostMapping("/delBySids") |
|||
public ResultBean delBySids(@RequestBody String[] sids){ |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
scmVehInventoryreportService.delBySids(sids); |
|||
return rb.success(); |
|||
} |
|||
|
|||
@Override |
|||
@ApiOperation("根据SID获取一条记录") |
|||
@GetMapping("/fetchDetailsBySid/{sid}") |
|||
public ResultBean<ScmVehInventoryreportDetailsVo> fetchDetailsBySid(@PathVariable("sid") String sid){ |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
ScmVehInventoryreportDetailsVo vo = scmVehInventoryreportService.fetchDetailsVoBySid(sid); |
|||
return rb.success().setData(vo); |
|||
} |
|||
} |
@ -0,0 +1,110 @@ |
|||
/********************************************************* |
|||
********************************************************* |
|||
******************** ******************* |
|||
************* ************ |
|||
******* _oo0oo_ ******* |
|||
*** o8888888o *** |
|||
* 88" . "88 * |
|||
* (| -_- |) * |
|||
* 0\ = /0 * |
|||
* ___/`---'\___ * |
|||
* .' \\| |// '. *
|
|||
* / \\||| : |||// \ *
|
|||
* / _||||| -:- |||||- \ * |
|||
* | | \\\ - /// | | *
|
|||
* | \_| ''\---/'' |_/ | * |
|||
* \ .-\__ '-' ___/-. / * |
|||
* ___'. .' /--.--\ `. .'___ * |
|||
* ."" '< `.___\_<|>_/___.' >' "". * |
|||
* | | : `- \`.;`\ _ /`;.`/ - ` : | | * |
|||
* \ \ `_. \_ __\ /__ _/ .-` / / * |
|||
* =====`-.____`.___ \_____/___.-`___.-'===== * |
|||
* `=---=' * |
|||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * |
|||
*********__佛祖保佑__永无BUG__验收通过__钞票多多__********* |
|||
*********************************************************/ |
|||
package com.yxt.anrui.scm.biz.scmvehinventoryreport; |
|||
|
|||
import cn.hutool.core.bean.BeanUtil; |
|||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|||
import org.apache.commons.lang3.StringUtils; |
|||
import com.yxt.common.base.service.MybatisBaseService; |
|||
import com.yxt.common.base.utils.PagerUtil; |
|||
import com.yxt.common.core.query.PagerQuery; |
|||
import com.yxt.common.core.result.ResultBean; |
|||
import com.yxt.common.core.vo.PagerVo; |
|||
import com.yxt.anrui.scm.api.scmvehinventoryreport.ScmVehInventoryreport; |
|||
import com.yxt.anrui.scm.api.scmvehinventoryreport.ScmVehInventoryreportQuery; |
|||
import com.yxt.anrui.scm.api.scmvehinventoryreport.ScmVehInventoryreportVo; |
|||
import com.yxt.anrui.scm.api.scmvehinventoryreport.ScmVehInventoryreportDetailsVo; |
|||
import com.yxt.anrui.scm.api.scmvehinventoryreport.ScmVehInventoryreportDto; |
|||
import com.yxt.anrui.scm.api.scmvehinventoryreport.ScmVehInventoryreportFeign; |
|||
|
|||
import org.springframework.stereotype.Service; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* Project: aaa(aaa) <br/> |
|||
* File: ScmVehInventoryreportService.java <br/> |
|||
* Class: com.yxt.anrui.scm.api.biz.scmvehinventoryreport.ScmVehInventoryreportService <br/> |
|||
* Description: 盘库报告 业务逻辑. <br/> |
|||
* Copyright: Copyright (c) 2011 <br/> |
|||
* Company: https://gitee.com/liuzp315 <br/>
|
|||
* Makedate: 2022-09-16 15:52:05 <br/> |
|||
* |
|||
* @author liupopo |
|||
* @version 1.0 |
|||
* @since 1.0 |
|||
*/ |
|||
@Service |
|||
public class ScmVehInventoryreportService extends MybatisBaseService<ScmVehInventoryreportMapper, ScmVehInventoryreport> { |
|||
private QueryWrapper<ScmVehInventoryreport> createQueryWrapper(ScmVehInventoryreportQuery query) { |
|||
// todo: 这里根据具体业务调整查询条件
|
|||
// 多字段Like示例:qw.and(wrapper -> wrapper.like("name", query.getName()).or().like("remark", query.getName()));
|
|||
QueryWrapper<ScmVehInventoryreport> qw = new QueryWrapper<>(); |
|||
return qw; |
|||
} |
|||
|
|||
public PagerVo<ScmVehInventoryreportVo> listPageVo(PagerQuery<ScmVehInventoryreportQuery> pq) { |
|||
ScmVehInventoryreportQuery query = pq.getParams(); |
|||
QueryWrapper<ScmVehInventoryreport> qw = createQueryWrapper(query); |
|||
IPage<ScmVehInventoryreport> page = PagerUtil.queryToPage(pq); |
|||
IPage<ScmVehInventoryreportVo> pagging = baseMapper.selectPageVo(page, qw); |
|||
PagerVo<ScmVehInventoryreportVo> p = PagerUtil.pageToVo(pagging, null); |
|||
return p; |
|||
} |
|||
|
|||
public void saveOrUpdateDto(ScmVehInventoryreportDto dto){ |
|||
String dtoSid = dto.getSid(); |
|||
if (StringUtils.isBlank(dtoSid)) { |
|||
this.insertByDto(dto); |
|||
return; |
|||
} |
|||
this.updateByDto(dto); |
|||
} |
|||
|
|||
public void insertByDto(ScmVehInventoryreportDto dto){ |
|||
ScmVehInventoryreport entity = new ScmVehInventoryreport(); |
|||
BeanUtil.copyProperties(dto, entity, "id", "sid"); |
|||
baseMapper.insert(entity); |
|||
} |
|||
|
|||
public void updateByDto(ScmVehInventoryreportDto dto){ |
|||
String dtoSid = dto.getSid(); |
|||
if (StringUtils.isBlank(dtoSid)) { |
|||
return; |
|||
} |
|||
ScmVehInventoryreport entity = fetchBySid(dtoSid); |
|||
BeanUtil.copyProperties(dto, entity, "id", "sid"); |
|||
baseMapper.updateById(entity); |
|||
} |
|||
|
|||
public ScmVehInventoryreportDetailsVo fetchDetailsVoBySid(String sid){ |
|||
ScmVehInventoryreport entity = fetchBySid(sid); |
|||
ScmVehInventoryreportDetailsVo vo = new ScmVehInventoryreportDetailsVo(); |
|||
BeanUtil.copyProperties(entity, vo); |
|||
return vo; |
|||
} |
|||
} |
Loading…
Reference in new issue