订单管理

This commit is contained in:
weihongyang
2020-08-22 16:08:20 +08:00
parent a5f5da8b79
commit 46c208ac4b
14 changed files with 190 additions and 62 deletions

View File

@@ -2,5 +2,9 @@ package com.deer.wms.produce.manage.dao;
import com.deer.wms.produce.manage.model.MtAloneByAShelf;
import com.deer.wms.project.seed.core.mapper.Mapper;
import java.util.List;
public interface MtAloneByAShelfMapper extends Mapper<MtAloneByAShelf> {
List<MtAloneByAShelf> getAllByShelfStatus(MtAloneByAShelf aShelfStatus);
}

View File

@@ -2,7 +2,6 @@ package com.deer.wms.produce.manage.dao;
import com.deer.wms.produce.manage.model.MtAloneByOrderInfo;
import com.deer.wms.produce.manage.model.MtAloneByOrderInfoParams;
import com.deer.wms.produce.manage.model.MtAloneByOrderInfoVo;
import com.deer.wms.project.seed.core.mapper.Mapper;
import java.util.List;

View File

@@ -14,4 +14,11 @@
<result column="a_shelf_name" jdbcType="VARCHAR" property="aShelfName" />
<result column="note" jdbcType="VARCHAR" property="note" />
</resultMap>
<select id="getAllByShelfStatus" parameterType="Integer" resultMap="BaseResultMap">
SELECT *
FROM mt_alone_by_a_shelf
WHERE a_shelf_status = #{aShelfStatus}
AND company_id = #{companyId}
</select>
</mapper>

View File

@@ -49,6 +49,7 @@
<if test="companyId != null">
AND mappb.company_id = #{companyId}
</if>
AND order_status = 0
</where>
</select>
</mapper>

View File

@@ -44,5 +44,6 @@
SELECT *
FROM mt_alone_by_product_info
WHERE order_info_id = #{id}
AND product_status = 0
</select>
</mapper>

View File

@@ -2,6 +2,8 @@ package com.deer.wms.produce.manage.model;
import com.deer.wms.project.seed.core.service.QueryParams;
import java.util.List;
/**
* Created by on 2020/08/18.
*/
@@ -11,6 +13,12 @@ public class MtAloneByOrderInfoParams extends QueryParams {
private String endTime;
private Integer id;
private MtAloneByOrderInfo mtAloneByOrderInfo;
private List<MtAloneByProductInfo> mtAloneByProductInfoList;
public String getBeginTime() {
return beginTime;
}
@@ -26,4 +34,28 @@ public class MtAloneByOrderInfoParams extends QueryParams {
public void setEndTime(String endTime) {
this.endTime = endTime;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public MtAloneByOrderInfo getMtAloneByOrderInfo() {
return mtAloneByOrderInfo;
}
public void setMtAloneByOrderInfo(MtAloneByOrderInfo mtAloneByOrderInfo) {
this.mtAloneByOrderInfo = mtAloneByOrderInfo;
}
public List<MtAloneByProductInfo> getMtAloneByProductInfoList() {
return mtAloneByProductInfoList;
}
public void setMtAloneByProductInfoList(List<MtAloneByProductInfo> mtAloneByProductInfoList) {
this.mtAloneByProductInfoList = mtAloneByProductInfoList;
}
}

View File

@@ -1,7 +1,6 @@
package com.deer.wms.produce.manage.service;
import com.deer.wms.produce.manage.model.MtAloneByAShelf;
import com.deer.wms.produce.manage.model.MtAloneByAShelfParams;
import com.deer.wms.project.seed.core.service.Service;
import java.util.List;
@@ -11,6 +10,6 @@ import java.util.List;
*/
public interface MtAloneByAShelfService extends Service<MtAloneByAShelf, Integer> {
List<MtAloneByAShelf> getAllByShelfStatus(MtAloneByAShelf mtAloneByAShelf);
}

View File

@@ -14,4 +14,6 @@ public interface MtAloneByOrderInfoService extends Service<MtAloneByOrderInfo, I
List<MtAloneByOrderInfo> findList(MtAloneByOrderInfoParams params);
MtAloneByOrderInfo findByIdStatus(Integer id);
}

View File

@@ -2,7 +2,6 @@ package com.deer.wms.produce.manage.service.impl;
import com.deer.wms.produce.manage.dao.MtAloneByAShelfMapper;
import com.deer.wms.produce.manage.model.MtAloneByAShelf;
import com.deer.wms.produce.manage.model.MtAloneByAShelfParams;
import com.deer.wms.produce.manage.service.MtAloneByAShelfService;
import com.deer.wms.project.seed.core.service.AbstractService;
@@ -22,5 +21,8 @@ public class MtAloneByAShelfServiceImpl extends AbstractService<MtAloneByAShelf,
private MtAloneByAShelfMapper mtAloneByAShelfMapper;
@Override
public List<MtAloneByAShelf> getAllByShelfStatus(MtAloneByAShelf mtAloneByAShelf) {
return mtAloneByAShelfMapper.getAllByShelfStatus(mtAloneByAShelf);
}
}

View File

@@ -29,7 +29,7 @@ import java.util.List;
/**
* Created by on 2020/08/18.
*/
@Api(description = "xxx接口")
@Api(description = "A字架接口")
@RestController
@RequestMapping("/mt/alone/by/a/shelfs")
public class MtAloneByAShelfController {
@@ -90,4 +90,19 @@ public class MtAloneByAShelfController {
return ResultGenerator.genSuccessResult(pageInfo);
}
/**
* 查询全部可用的a子架
*/
@PostMapping("/get/all/by/shelf/status")
public Result getAllByShelfStatus(@ApiIgnore @User CurrentUser currentUser){
if(currentUser==null){
return ResultGenerator.genFailResult(CommonCode.SERVICE_ERROR,"未登录错误",null );
}
MtAloneByAShelf mtAloneByAShelf = new MtAloneByAShelf();
mtAloneByAShelf.setCompanyId(currentUser.getCompanyId());
mtAloneByAShelf.setaShelfStatus(0);
List<MtAloneByAShelf> list = mtAloneByAShelfService.getAllByShelfStatus(mtAloneByAShelf);
return ResultGenerator.genSuccessResult(list);
}
}

View File

@@ -59,22 +59,27 @@ public class MtAloneByOrderInfoController {
@Autowired
private MtAloneByOrderInfoMapping mtAloneByOrderInfoMapping;
@OperateLog(description = "添加xxx", type = "增加")
@ApiOperation(value = "添加xxx", notes = "添加xxx")
@OperateLog(description = "添加订单", type = "增加")
@ApiOperation(value = "添加订单", notes = "添加订单")
@PostMapping("/add")
public Result add(@RequestBody MtAloneByOrderInfo mtAloneByOrderInfo, @ApiIgnore @User CurrentUser currentUser) {
public Result add(@RequestBody MtAloneByOrderInfoParams mtAloneByOrderInfoParams, @ApiIgnore @User CurrentUser currentUser) {
if(currentUser==null){
return ResultGenerator.genFailResult( CommonCode.SERVICE_ERROR,"未登录错误",null );
}
mtAloneByOrderInfo.setCreateTime(new Date());
mtAloneByOrderInfo.setCompanyId(currentUser.getCompanyId());
mtAloneByOrderInfoService.save(mtAloneByOrderInfo);
mtAloneByOrderInfoParams.getMtAloneByOrderInfo().setCreateTime(new Date());
mtAloneByOrderInfoParams.getMtAloneByOrderInfo().setCompanyId(currentUser.getCompanyId());
mtAloneByOrderInfoService.save(mtAloneByOrderInfoParams.getMtAloneByOrderInfo());
for (MtAloneByProductInfo mtAloneByProductInfo:mtAloneByOrderInfoParams.getMtAloneByProductInfoList()) {
mtAloneByProductInfo.setCreateTime(new Date());
mtAloneByProductInfo.setCompanyId(currentUser.getCompanyId());
}
mtAloneByProductInfoService.save(mtAloneByOrderInfoParams.getMtAloneByProductInfoList());
return ResultGenerator.genSuccessResult();
}
@OperateLog(description = "删除订单", type = "删除")
@ApiOperation(value = "删除订单", notes = "删除订单")
@DeleteMapping("/delete/{id}")
@PostMapping("/delete/{id}")
public Result delete(@PathVariable Integer Id) {
mtAloneByProductInfoService.deleteByOrderInfoId(Id);
mtAloneByOrderInfoService.deleteById(Id);
@@ -83,32 +88,54 @@ public class MtAloneByOrderInfoController {
/**
* 修改保存
* @param mtAloneByOrderInfo
* @param mtAloneByOrderInfoParams
* @return
*/
@OperateLog(description = "修改订单", type = "更新")
@ApiOperation(value = "修改订单", notes = "修改订单")
@PostMapping("/update")
public Result update(@RequestBody MtAloneByOrderInfo mtAloneByOrderInfo) {
mtAloneByOrderInfo.setUpdateTime(new Date());
mtAloneByOrderInfoService.update(mtAloneByOrderInfo);
public Result update(@RequestBody MtAloneByOrderInfoParams mtAloneByOrderInfoParams) {
mtAloneByOrderInfoParams.getMtAloneByOrderInfo().setUpdateTime(new Date());
mtAloneByOrderInfoService.update(mtAloneByOrderInfoParams.getMtAloneByOrderInfo());
for (MtAloneByProductInfo mtAloneByProductInfo:mtAloneByOrderInfoParams.getMtAloneByProductInfoList()) {
mtAloneByProductInfo.setUpdateTime(new Date());
mtAloneByProductInfoService.update(mtAloneByProductInfo);
}
return ResultGenerator.genSuccessResult();
}
/**
* 修改订单获取修改的数据并填充
* @param id
* 根据订单id查询出来产品信息并且分页
* @param
* @return
*/
@GetMapping("/update/for/data/{id}")
public Result updateForData(@PathVariable Integer id){
MtAloneByOrderInfo mtAloneByOrderInfo = mtAloneByOrderInfoService.findById(id);
@GetMapping("/update/for/product/info")
public Result updateForProductInfo(MtAloneByOrderInfoParams params, @ApiIgnore @User CurrentUser currentUser){
if(currentUser==null){
return ResultGenerator.genFailResult(CommonCode.SERVICE_ERROR,"未登录错误",null );
}
if (currentUser.getCompanyType() != SystemManageConstant.COMPANY_TYPE_MT){
params.setCompanyId(currentUser.getCompanyId());
}else{
params.setCompanyId(null);
}
PageHelper.startPage(params.getPageNum(), params.getPageSize());
List<MtAloneByProductInfo> mtAloneByProductInfoList = mtAloneByProductInfoService.findByOrderInfoId(params.getId());
PageInfo pageInfo = new PageInfo(mtAloneByProductInfoList);
/*MtAloneByOrderInfo mtAloneByOrderInfo = mtAloneByOrderInfoService.findById(id);
List<MtAloneByProductInfo> mtAloneByProductInfos = mtAloneByProductInfoService.findByOrderInfoId(id);
MtAloneByOrderInfoVo mtAloneByOrderInfoVo = mtAloneByOrderInfoMapping.MtAloneByOrderInfoToMtAloneByOrderInfoVo(mtAloneByOrderInfo);
mtAloneByOrderInfoVo.setMtAloneByProductInfos(mtAloneByProductInfos);
return ResultGenerator.genSuccessResult(mtAloneByOrderInfoVo);
*/
return ResultGenerator.genSuccessResult(pageInfo);
}
/**
* 根据订单id查询出来订单详情
* @param id
* @return
*/
@GetMapping("/detail/{id}")
public Result detail(@PathVariable Integer id) {
MtAloneByOrderInfo mtAloneByOrderInfo = mtAloneByOrderInfoService.findById(id);

View File

@@ -1,5 +1,9 @@
package com.deer.wms.produce.manage.web;
import com.deer.wms.base.system.model.MtAloneProductLibrary;
import com.deer.wms.base.system.model.MtAloneProductLibraryParams;
import com.deer.wms.base.system.service.MtAloneProductLibraryService;
import com.deer.wms.base.system.web.MtAloneProductLibraryController;
import com.deer.wms.produce.manage.model.MtAloneByAShelf;
import com.deer.wms.project.seed.annotation.OperateLog;
import com.deer.wms.project.seed.constant.SystemManageConstant;
@@ -30,7 +34,7 @@ import java.util.List;
/**
* Created by on 2020/08/18.
*/
@Api(description = "xxx接口")
@Api(description = "产品信息接口")
@RestController
@RequestMapping("/mt/alone/by/product/infos")
public class MtAloneByProductInfoController {
@@ -38,6 +42,9 @@ public class MtAloneByProductInfoController {
@Autowired
private MtAloneByProductInfoService mtAloneByProductInfoService;
@Autowired
private MtAloneProductLibraryService mtAloneProductLibraryService;
@OperateLog(description = "添加xxx", type = "增加")
@ApiOperation(value = "添加xxx", notes = "添加xxx")
@PostMapping("/add")
@@ -45,8 +52,8 @@ public class MtAloneByProductInfoController {
if(currentUser==null){
return ResultGenerator.genFailResult( CommonCode.SERVICE_ERROR,"未登录错误",null );
}
mtAloneByProductInfo.setCreateTime(new Date());
mtAloneByProductInfo.setCompanyId(currentUser.getCompanyId());
mtAloneByProductInfo.setCreateTime(new Date());
mtAloneByProductInfo.setCompanyId(currentUser.getCompanyId());
mtAloneByProductInfoService.save(mtAloneByProductInfo);
return ResultGenerator.genSuccessResult();
}
@@ -59,8 +66,8 @@ public class MtAloneByProductInfoController {
return ResultGenerator.genSuccessResult();
}
@OperateLog(description = "修改xxx", type = "更新")
@ApiOperation(value = "修改xxx", notes = "修改xxx")
@OperateLog(description = "修改产品信息", type = "更新")
@ApiOperation(value = "修改产品信息", notes = "修改产品信息")
@PostMapping("/update")
public Result update(@RequestBody MtAloneByProductInfo mtAloneByProductInfo) {
mtAloneByProductInfo.setUpdateTime(new Date());
@@ -92,4 +99,18 @@ public class MtAloneByProductInfoController {
return ResultGenerator.genSuccessResult(pageInfo);
}
/**
* 根据公司id获取到产品池的全部产品
*/
@PostMapping("/get/product/library")
public Result getProductLibrary(@ApiIgnore @User CurrentUser currentUser){
if(currentUser==null){
return ResultGenerator.genFailResult(CommonCode.SERVICE_ERROR,"未登录错误",null );
}
MtAloneProductLibraryParams mtAloneProductLibraryParams = new MtAloneProductLibraryParams();
mtAloneProductLibraryParams.setCompanyId(currentUser.getCompanyId());
List<MtAloneProductLibrary> list = mtAloneProductLibraryService.findList(mtAloneProductLibraryParams);
return ResultGenerator.genSuccessResult(list);
}
}