多次使用出库设置功能代码提交
							parent
							
								
									85d73a0ee4
								
							
						
					
					
						commit
						32ff539034
					
				| @ -0,0 +1,88 @@ | |||||||
|  | package com.glxp.api.controller.inout; | ||||||
|  | 
 | ||||||
|  | import cn.hutool.core.util.IdUtil; | ||||||
|  | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | ||||||
|  | import com.github.pagehelper.PageInfo; | ||||||
|  | import com.glxp.api.common.res.BaseResponse; | ||||||
|  | import com.glxp.api.common.util.ResultVOUtils; | ||||||
|  | import com.glxp.api.entity.inout.IoOrderMutiSetEntity; | ||||||
|  | import com.glxp.api.req.inout.FilterCodeRequest; | ||||||
|  | import com.glxp.api.req.inout.IoOrderMutiSetRequest; | ||||||
|  | import com.glxp.api.res.inout.IoCodeResponse; | ||||||
|  | import com.glxp.api.res.inout.IoOrderMutiSetResponse; | ||||||
|  | import com.glxp.api.service.inout.IoOrderMutiSetService; | ||||||
|  | import org.springframework.web.bind.annotation.GetMapping; | ||||||
|  | import org.springframework.web.bind.annotation.PostMapping; | ||||||
|  | import org.springframework.web.bind.annotation.RequestBody; | ||||||
|  | import org.springframework.web.bind.annotation.RestController; | ||||||
|  | 
 | ||||||
|  | import javax.annotation.Resource; | ||||||
|  | import java.util.Date; | ||||||
|  | import java.util.List; | ||||||
|  | 
 | ||||||
|  | @RestController | ||||||
|  | public class IoOrderMutiSetController { | ||||||
|  | 
 | ||||||
|  |     @Resource | ||||||
|  |     private IoOrderMutiSetService ioOrderMutiSetService; | ||||||
|  | 
 | ||||||
|  |     @GetMapping("/udiwms/inout/muti/filterList") | ||||||
|  |     public BaseResponse filterList(IoOrderMutiSetRequest ioOrderMutiSetRequest) { | ||||||
|  |         List<IoOrderMutiSetResponse> list = ioOrderMutiSetService.filterList(ioOrderMutiSetRequest); | ||||||
|  |         PageInfo<IoOrderMutiSetResponse> pageInfo = new PageInfo<>(list); | ||||||
|  |         return ResultVOUtils.page(pageInfo); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  |     @PostMapping("/udiwms/inout/muti/add") | ||||||
|  |     public BaseResponse addIoOrderMuti(@RequestBody IoOrderMutiSetEntity ioOrderMutiSetEntity) { | ||||||
|  | 
 | ||||||
|  |         QueryWrapper<IoOrderMutiSetEntity> ew=new QueryWrapper<>(); | ||||||
|  |         ew.eq("curInv",ioOrderMutiSetEntity.getCurInv()); | ||||||
|  |         long count=ioOrderMutiSetService.count(ew); | ||||||
|  |         if(count>0){ | ||||||
|  |             return ResultVOUtils.error(999,"已存在该仓库的出入库设置!"); | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |         ioOrderMutiSetEntity.setId(IdUtil.getSnowflakeNextId()); | ||||||
|  |         ioOrderMutiSetEntity.setUpdateTime(new Date()); | ||||||
|  |         Boolean falg=ioOrderMutiSetService.save(ioOrderMutiSetEntity); | ||||||
|  |         if(falg){ | ||||||
|  |             return  ResultVOUtils.success(); | ||||||
|  |         }else{ | ||||||
|  |             return ResultVOUtils.error(999,"添加失败"); | ||||||
|  |         } | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  |     @PostMapping("/udiwms/inout/muti/update") | ||||||
|  |     public BaseResponse updateIoOrderMuti(@RequestBody IoOrderMutiSetEntity ioOrderMutiSetEntity) { | ||||||
|  | 
 | ||||||
|  |         QueryWrapper<IoOrderMutiSetEntity> ew=new QueryWrapper<>(); | ||||||
|  |         ew.eq("curInv",ioOrderMutiSetEntity.getCurInv()); | ||||||
|  |         IoOrderMutiSetEntity ioOrderMutiSetServiceOne=ioOrderMutiSetService.getOne(ew); | ||||||
|  |         if(!ioOrderMutiSetServiceOne.getId().equals(ioOrderMutiSetEntity.getId())){ | ||||||
|  |             return ResultVOUtils.error(999,"已存在该仓库的出入库设置!"); | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |         ioOrderMutiSetEntity.setUpdateTime(new Date()); | ||||||
|  |         Boolean falg=ioOrderMutiSetService.updateById(ioOrderMutiSetEntity); | ||||||
|  |         if(falg){ | ||||||
|  |             return  ResultVOUtils.success(); | ||||||
|  |         }else{ | ||||||
|  |             return ResultVOUtils.error(999,"更新失败"); | ||||||
|  |         } | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     @PostMapping("/udiwms/inout/muti/detail") | ||||||
|  |     public BaseResponse detailIoOrderMuti(@RequestBody IoOrderMutiSetEntity ioOrderMutiSetEntity) { | ||||||
|  | 
 | ||||||
|  |         Boolean falg=ioOrderMutiSetService.removeById(ioOrderMutiSetEntity); | ||||||
|  |         if(falg){ | ||||||
|  |             return  ResultVOUtils.success(); | ||||||
|  |         }else{ | ||||||
|  |             return ResultVOUtils.error(999,"删除失败"); | ||||||
|  |         } | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  | } | ||||||
| @ -0,0 +1,21 @@ | |||||||
|  | package com.glxp.api.req.inout; | ||||||
|  | 
 | ||||||
|  | import com.glxp.api.util.page.ListPageRequest; | ||||||
|  | import lombok.Data; | ||||||
|  | 
 | ||||||
|  | import java.util.Date; | ||||||
|  | 
 | ||||||
|  | @Data | ||||||
|  | public class IoOrderMutiSetRequest extends ListPageRequest { | ||||||
|  | 
 | ||||||
|  |     private Long id; | ||||||
|  |     private String curInv; | ||||||
|  |     private String fromCorp; | ||||||
|  |     private String targetAction; | ||||||
|  |     private String remark; | ||||||
|  |     private Date updateTime; | ||||||
|  |     private String invName; | ||||||
|  |     private String fromCorpName; | ||||||
|  |     private String targetActionName; | ||||||
|  | 
 | ||||||
|  | } | ||||||
| @ -0,0 +1,20 @@ | |||||||
|  | package com.glxp.api.res.inout; | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | import lombok.Data; | ||||||
|  | 
 | ||||||
|  | import java.util.Date; | ||||||
|  | @Data | ||||||
|  | public class IoOrderMutiSetResponse { | ||||||
|  | 
 | ||||||
|  |     private Long id; | ||||||
|  |     private String curInv; | ||||||
|  |     private String fromCorp; | ||||||
|  |     private String targetAction; | ||||||
|  |     private String remark; | ||||||
|  |     private Date updateTime; | ||||||
|  |     private String invName; | ||||||
|  |     private String fromCorpName; | ||||||
|  |     private String targetActionName; | ||||||
|  | 
 | ||||||
|  | } | ||||||
| @ -1,11 +1,35 @@ | |||||||
| package com.glxp.api.service.inout.impl; | package com.glxp.api.service.inout.impl; | ||||||
| 
 | 
 | ||||||
|  | import com.github.pagehelper.PageHelper; | ||||||
|  | import com.glxp.api.req.inout.IoOrderMutiSetRequest; | ||||||
|  | import com.glxp.api.res.inout.IoOrderMutiSetResponse; | ||||||
| import org.springframework.stereotype.Service; | import org.springframework.stereotype.Service; | ||||||
| import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | ||||||
| import com.glxp.api.entity.inout.IoOrderMutiSetEntity; | import com.glxp.api.entity.inout.IoOrderMutiSetEntity; | ||||||
| import com.glxp.api.dao.inout.IoOrderMutiSetMapper; | import com.glxp.api.dao.inout.IoOrderMutiSetMapper; | ||||||
| import com.glxp.api.service.inout.IoOrderMutiSetService; | import com.glxp.api.service.inout.IoOrderMutiSetService; | ||||||
|  | 
 | ||||||
|  | import javax.annotation.Resource; | ||||||
|  | import java.util.Collections; | ||||||
|  | import java.util.List; | ||||||
|  | 
 | ||||||
| @Service | @Service | ||||||
| public class IoOrderMutiSetServiceImpl extends ServiceImpl<IoOrderMutiSetMapper, IoOrderMutiSetEntity> implements IoOrderMutiSetService{ | public class IoOrderMutiSetServiceImpl extends ServiceImpl<IoOrderMutiSetMapper, IoOrderMutiSetEntity> implements IoOrderMutiSetService{ | ||||||
| 
 | 
 | ||||||
|  |     @Resource | ||||||
|  |     private IoOrderMutiSetMapper ioOrderMutiSetMapper; | ||||||
|  | 
 | ||||||
|  |     @Override | ||||||
|  |     public List<IoOrderMutiSetResponse> filterList(IoOrderMutiSetRequest ioOrderMutiSetRequest) { | ||||||
|  | 
 | ||||||
|  |         if (ioOrderMutiSetRequest == null) { | ||||||
|  |             return Collections.emptyList(); | ||||||
|  |         } | ||||||
|  |         if (ioOrderMutiSetRequest.getPage() != null) { | ||||||
|  |             int offset = (ioOrderMutiSetRequest.getPage() - 1) * ioOrderMutiSetRequest.getLimit(); | ||||||
|  |             PageHelper.offsetPage(offset, ioOrderMutiSetRequest.getLimit()); | ||||||
|  |         } | ||||||
|  |         List<IoOrderMutiSetResponse> ioOrderMutiSetEntityList=ioOrderMutiSetMapper.filterList(ioOrderMutiSetRequest); | ||||||
|  |         return ioOrderMutiSetEntityList; | ||||||
|  |     } | ||||||
| } | } | ||||||
|  | |||||||
| @ -1,4 +1,18 @@ | |||||||
| <?xml version="1.0" encoding="UTF-8"?> | <?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"> | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | ||||||
| <mapper namespace="com.glxp.api.dao.inout.IoOrderMutiSetMapper"> | <mapper namespace="com.glxp.api.dao.inout.IoOrderMutiSetMapper"> | ||||||
|  |     <select id="filterList" parameterType="com.glxp.api.req.inout.IoOrderMutiSetRequest" | ||||||
|  |             resultType="com.glxp.api.res.inout.IoOrderMutiSetResponse"> | ||||||
|  |         SELECT io.*, | ||||||
|  |                (SELECT NAME FROM auth_warehouse aw WHERE aw.CODE = io.curInv)                 invName, | ||||||
|  |                a1.name                fromCorpName, | ||||||
|  |                (SELECT NAME FROM basic_bussiness_type bus WHERE bus.action = io.targetAction) targetActionName | ||||||
|  |         FROM io_order_muti_set io | ||||||
|  |         left join auth_warehouse a1 on a1.code=io.curInv | ||||||
|  |         <where> | ||||||
|  |             <if test=" curInv!= '' and curInv != null"> | ||||||
|  |                 and a1.name = #{curInv} | ||||||
|  |             </if> | ||||||
|  |         </where> | ||||||
|  |     </select> | ||||||
| </mapper> | </mapper> | ||||||
|  | |||||||
					Loading…
					
					
				
		Reference in New Issue