
131 changed files with 9286 additions and 0 deletions
@ -0,0 +1,122 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<project xmlns="http://maven.apache.org/POM/4.0.0" |
|||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
|||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
|||
<parent> |
|||
<artifactId>wh</artifactId> |
|||
<groupId>com.wh</groupId> |
|||
<version>1.0-SNAPSHOT</version> |
|||
</parent> |
|||
<modelVersion>4.0.0</modelVersion> |
|||
|
|||
<artifactId>wh-manage-xxs</artifactId> |
|||
|
|||
<!-- 依赖工具API--> |
|||
<dependencies> |
|||
<dependency> |
|||
<groupId>com.wh</groupId> |
|||
<artifactId>wh-common</artifactId> |
|||
<version>1.0-SNAPSHOT</version> |
|||
</dependency> |
|||
<dependency> |
|||
<groupId>org.jetbrains</groupId> |
|||
<artifactId>annotations</artifactId> |
|||
<version>21.0.1</version> |
|||
<scope>compile</scope> |
|||
</dependency> |
|||
<dependency> |
|||
<groupId>com.yxt</groupId> |
|||
<artifactId>yxt-common-base</artifactId> |
|||
<version>0.0.1</version> |
|||
</dependency> |
|||
<dependency> |
|||
<groupId>org.springframework.boot</groupId> |
|||
<artifactId>spring-boot-starter-cache</artifactId> |
|||
</dependency> |
|||
<dependency> |
|||
<groupId>org.springframework.cloud</groupId> |
|||
<artifactId>spring-cloud-starter-openfeign</artifactId> |
|||
</dependency> |
|||
<!-- <dependency>--> |
|||
<!-- <groupId>com.yxt.supervise.dispatchcenter</groupId>--> |
|||
<!-- <artifactId>supervise-dispatchcenter-api</artifactId>--> |
|||
<!-- <version>0.0.1</version>--> |
|||
<!-- </dependency>--> |
|||
<dependency> |
|||
<groupId>com.yxt</groupId> |
|||
<artifactId>yxt-common-base</artifactId> |
|||
<version>0.0.1</version> |
|||
</dependency> |
|||
<!-- <dependency>--> |
|||
<!-- <groupId>com.alibaba.cloud</groupId>--> |
|||
<!-- <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>--> |
|||
<!-- </dependency>--> |
|||
|
|||
<dependency> |
|||
<groupId>org.projectlombok</groupId> |
|||
<artifactId>lombok</artifactId> |
|||
<version>1.18.24</version> |
|||
<optional>true</optional> |
|||
</dependency> |
|||
|
|||
<dependency> |
|||
<groupId>mysql</groupId> |
|||
<artifactId>mysql-connector-java</artifactId> |
|||
</dependency> |
|||
<dependency> |
|||
<groupId>org.apache.poi</groupId> |
|||
<artifactId>poi-ooxml</artifactId> |
|||
</dependency> |
|||
<dependency> |
|||
<groupId>io.jsonwebtoken</groupId> |
|||
<artifactId>jjwt</artifactId> |
|||
</dependency> |
|||
<dependency> |
|||
<groupId>cn.hutool</groupId> |
|||
<artifactId>hutool-extra</artifactId> |
|||
</dependency> |
|||
<dependency> |
|||
<groupId>cn.hutool</groupId> |
|||
<artifactId>hutool-http</artifactId> |
|||
</dependency> |
|||
<dependency> |
|||
<groupId>cn.hutool</groupId> |
|||
<artifactId>hutool-crypto</artifactId> |
|||
</dependency> |
|||
<dependency> |
|||
<groupId>cn.hutool</groupId> |
|||
<artifactId>hutool-cache</artifactId> |
|||
</dependency> |
|||
|
|||
<dependency> |
|||
<groupId>com.github.xiaoymin</groupId> |
|||
<artifactId>knife4j-spring-boot-starter</artifactId> |
|||
</dependency> |
|||
|
|||
<dependency> |
|||
<groupId>org.springframework.boot</groupId> |
|||
<artifactId>spring-boot-starter-test</artifactId> |
|||
<scope>test</scope> |
|||
</dependency> |
|||
</dependencies> |
|||
<!--添加build标签--> |
|||
<build> |
|||
<!--打包成jar包时的名字--> |
|||
<finalName>wm-manager</finalName> |
|||
<plugins> |
|||
<plugin> |
|||
<groupId>org.springframework.boot</groupId> |
|||
<artifactId>spring-boot-maven-plugin</artifactId> |
|||
<version>2.5.6</version> |
|||
<executions> |
|||
<execution> |
|||
<goals> |
|||
<goal>repackage</goal> |
|||
</goals> |
|||
</execution> |
|||
</executions> |
|||
</plugin> |
|||
</plugins> |
|||
</build> |
|||
|
|||
</project> |
@ -0,0 +1,42 @@ |
|||
package com.wh; |
|||
|
|||
import org.mybatis.spring.annotation.MapperScan; |
|||
import org.springframework.boot.SpringApplication; |
|||
import org.springframework.boot.autoconfigure.SpringBootApplication; |
|||
import org.springframework.context.annotation.Bean; |
|||
import org.springframework.web.cors.CorsConfiguration; |
|||
import org.springframework.web.cors.UrlBasedCorsConfigurationSource; |
|||
import org.springframework.web.filter.CorsFilter; |
|||
|
|||
//@EnableDiscoveryClient
|
|||
//@EnableFeignClients(basePackages = {"com.wh.*"})
|
|||
@MapperScan("com.wh.mapper") |
|||
@SpringBootApplication(scanBasePackages = { |
|||
"com.yxt.common.base.config", |
|||
"com.wh.*" |
|||
}) |
|||
public class WarehouseApplicationNoNacos { |
|||
|
|||
private CorsConfiguration buildConfig() { |
|||
CorsConfiguration corsConfiguration = new CorsConfiguration(); |
|||
corsConfiguration.addAllowedOrigin("*"); |
|||
corsConfiguration.addAllowedHeader("*"); |
|||
corsConfiguration.addAllowedMethod("*"); |
|||
corsConfiguration.setAllowCredentials(true);//这两句不加不能跨域上传文件,
|
|||
corsConfiguration.setMaxAge(3600l);//加上去就可以了
|
|||
return corsConfiguration; |
|||
} |
|||
/** |
|||
* 跨域过滤器 |
|||
* @return |
|||
*/ |
|||
@Bean |
|||
public CorsFilter corsFilter() { |
|||
UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); |
|||
source.registerCorsConfiguration("/**", buildConfig()); // 4
|
|||
return new CorsFilter(source); |
|||
} |
|||
public static void main(String[] args) { |
|||
SpringApplication.run(WarehouseApplicationNoNacos.class,args); |
|||
} |
|||
} |
@ -0,0 +1,15 @@ |
|||
package com.wh.aop; |
|||
|
|||
import com.wh.vo.SysResult; |
|||
import org.springframework.web.bind.annotation.ExceptionHandler; |
|||
import org.springframework.web.bind.annotation.RestControllerAdvice; |
|||
|
|||
@RestControllerAdvice |
|||
public class AOPException { |
|||
|
|||
@ExceptionHandler({RuntimeException.class}) |
|||
public Object Exception(){ |
|||
return SysResult.fail(); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,29 @@ |
|||
package com.wh.config; |
|||
|
|||
import org.springframework.boot.web.servlet.MultipartConfigFactory; |
|||
import org.springframework.context.annotation.Bean; |
|||
import org.springframework.context.annotation.Configuration; |
|||
import org.springframework.util.unit.DataSize; |
|||
|
|||
import javax.servlet.MultipartConfigElement; |
|||
|
|||
/** |
|||
* 文件上传配置类 |
|||
* |
|||
* @Author mashanghaoyun |
|||
* @Date 2020/11/11 01:34 |
|||
* @Version 1.0 |
|||
**/ |
|||
@Configuration |
|||
public class FileUploadConfig { |
|||
@Bean |
|||
public MultipartConfigElement multipartConfigElement() { |
|||
MultipartConfigFactory factory = new MultipartConfigFactory(); |
|||
// 单个数据大小
|
|||
factory.setMaxFileSize(DataSize.parse("502400KB")); // KB,MB
|
|||
// 总上传数据大小
|
|||
factory.setMaxRequestSize(DataSize.parse("1024000KB")); |
|||
return factory.createMultipartConfig(); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,16 @@ |
|||
package com.wh.config; |
|||
import com.wh.controller.UserInterceptor; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.context.annotation.Configuration; |
|||
import org.springframework.web.servlet.config.annotation.InterceptorRegistry; |
|||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; |
|||
@Configuration |
|||
public class MyInterceptor implements WebMvcConfigurer { |
|||
// @Autowired
|
|||
// private UserInterceptor userInterceptor;
|
|||
|
|||
@Override |
|||
public void addInterceptors(InterceptorRegistry registry) { |
|||
// registry.addInterceptor(userInterceptor);
|
|||
} |
|||
} |
@ -0,0 +1,67 @@ |
|||
/********************************************************* |
|||
********************************************************* |
|||
******************** ******************* |
|||
************* ************ |
|||
******* _oo0oo_ ******* |
|||
*** o8888888o *** |
|||
* 88" . "88 * |
|||
* (| -_- |) * |
|||
* 0\ = /0 * |
|||
* ___/`---'\___ * |
|||
* .' \\| |// '. *
|
|||
* / \\||| : |||// \ *
|
|||
* / _||||| -:- |||||- \ * |
|||
* | | \\\ - /// | | *
|
|||
* | \_| ''\---/'' |_/ | * |
|||
* \ .-\__ '-' ___/-. / * |
|||
* ___'. .' /--.--\ `. .'___ * |
|||
* ."" '< `.___\_<|>_/___.' >' "". * |
|||
* | | : `- \`.;`\ _ /`;.`/ - ` : | | * |
|||
* \ \ `_. \_ __\ /__ _/ .-` / / * |
|||
* =====`-.____`.___ \_____/___.-`___.-'===== * |
|||
* `=---=' * |
|||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * |
|||
*********__佛祖保佑__永无BUG__验收通过__钞票多多__********* |
|||
*********************************************************/ |
|||
package com.wh.config; |
|||
|
|||
import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor; |
|||
import com.baomidou.mybatisplus.extension.plugins.pagination.optimize.JsqlParserCountOptimize; |
|||
import org.springframework.context.annotation.Bean; |
|||
import org.springframework.context.annotation.Configuration; |
|||
|
|||
/** |
|||
* Project: yxt-common <br/> |
|||
* File: MybatisPlusConfig.java <br/> |
|||
* Class: com.yxt.common.base.config.MybatisPlusConfig <br/> |
|||
* Description: <描述类的功能>. <br/> |
|||
* Copyright: Copyright (c) 2011 <br/> |
|||
* Company: https://gitee.com/liuzp315 <br/>
|
|||
* Makedate: 2020/8/24 下午12:42 <br/> |
|||
* |
|||
* @author popo |
|||
* @version 1.0 |
|||
* @since 1.0 |
|||
*/ |
|||
//@Configuration
|
|||
public class MybatisPlusConfig { |
|||
/* |
|||
* 分页插件,自动识别数据库类型 多租户,请参考官网【插件扩展】 |
|||
*/ |
|||
// @Bean
|
|||
// public MybatisPlusInterceptor paginationInterceptor() {
|
|||
// return new MybatisPlusInterceptor();
|
|||
// }
|
|||
|
|||
@Bean |
|||
public PaginationInterceptor paginationInterceptor() { |
|||
PaginationInterceptor paginationInterceptor = new PaginationInterceptor(); |
|||
// 设置请求的页面大于最大页后操作, true调回到首页,false 继续请求 默认false
|
|||
// paginationInterceptor.setOverflow(false);
|
|||
// 设置最大单页限制数量,默认 500 条,-1 不受限制
|
|||
// paginationInterceptor.setLimit(500);
|
|||
// 开启 count 的 join 优化,只针对部分 left join
|
|||
paginationInterceptor.setCountSqlParser(new JsqlParserCountOptimize(true)); |
|||
return paginationInterceptor; |
|||
} |
|||
} |
@ -0,0 +1,36 @@ |
|||
package com.wh.config; |
|||
|
|||
import org.springframework.beans.factory.annotation.Value; |
|||
import org.springframework.context.annotation.Configuration; |
|||
import org.springframework.web.servlet.config.annotation.CorsRegistry; |
|||
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; |
|||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; |
|||
|
|||
@Configuration |
|||
public class WebMvcConfig implements WebMvcConfigurer { |
|||
@Value("${yuan.file.root.path}") |
|||
public String fileRootPath; |
|||
|
|||
/** |
|||
* 资源映射:把请求的/archive/** 映射到该文件根路径 |
|||
*/ |
|||
@Override |
|||
public void addResourceHandlers(ResourceHandlerRegistry registry) { |
|||
registry.addResourceHandler("/archive/**").addResourceLocations("file:" + fileRootPath); |
|||
} |
|||
@Override |
|||
public void addCorsMappings(CorsRegistry registry){ |
|||
//设置允许跨域的路径
|
|||
registry.addMapping ("/**") |
|||
//设置允许跨域请求的域名
|
|||
.allowedOrigins("*") |
|||
//是否允许证书
|
|||
.allowCredentials (true) |
|||
//设置允许的方法
|
|||
.allowedMethods ("GET","POST") |
|||
//设置允许的header属性
|
|||
.allowedHeaders ("*") |
|||
//允许跨域时间
|
|||
.maxAge (3600); |
|||
} |
|||
} |
@ -0,0 +1,35 @@ |
|||
package com.wh.controller; |
|||
|
|||
import com.wh.pojo.Rights; |
|||
import com.wh.service.RightsService; |
|||
import com.wh.vo.SysResult; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.CrossOrigin; |
|||
import org.springframework.web.bind.annotation.GetMapping; |
|||
import org.springframework.web.bind.annotation.RequestMapping; |
|||
import org.springframework.web.bind.annotation.RestController; |
|||
|
|||
import java.util.List; |
|||
|
|||
@RestController("com.wh.controller.RightsController") |
|||
@CrossOrigin |
|||
@RequestMapping("/rights") |
|||
public class RightsController { |
|||
|
|||
@Autowired |
|||
private RightsService rightsService; |
|||
|
|||
/** |
|||
* URL: /rights/getRightsList |
|||
* 参数: null |
|||
* 类型: get |
|||
* 返回值: SysResult对象 List |
|||
* 业务: 只查询前 2级权限 |
|||
*/ |
|||
@GetMapping("/getRightsList") |
|||
public SysResult getRightsList(){ |
|||
List<Rights> rightsList = |
|||
rightsService.findRightsList(); |
|||
return SysResult.success(rightsList); |
|||
} |
|||
} |
@ -0,0 +1,36 @@ |
|||
package com.wh.controller; |
|||
|
|||
import com.wh.pojo.User; |
|||
import com.wh.service.UserService; |
|||
import com.wh.vo.SysResult; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.util.StringUtils; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import javax.servlet.http.HttpSession; |
|||
|
|||
@RestController |
|||
@CrossOrigin |
|||
@RequestMapping("/user/") |
|||
public class UserController { |
|||
|
|||
@Autowired |
|||
private UserService userService; |
|||
@Autowired |
|||
private HttpSession session; |
|||
@PostMapping("login") |
|||
public SysResult login(@RequestBody User user){ |
|||
String fixationToken = (String)session.getAttribute("token"); |
|||
if (StringUtils.hasLength(fixationToken)){ |
|||
return SysResult.success(fixationToken); |
|||
}else { |
|||
String token = userService.findUserByUP(user); |
|||
if (StringUtils.hasLength(token)){ |
|||
session.setAttribute("token",token); |
|||
return SysResult.success(token); |
|||
}else { |
|||
return SysResult.fail(); |
|||
} |
|||
} |
|||
} |
|||
} |
@ -0,0 +1,33 @@ |
|||
package com.wh.controller; |
|||
|
|||
import org.springframework.stereotype.Component; |
|||
import org.springframework.web.servlet.HandlerInterceptor; |
|||
import org.springframework.web.servlet.ModelAndView; |
|||
|
|||
import javax.servlet.http.HttpServletRequest; |
|||
import javax.servlet.http.HttpServletResponse; |
|||
|
|||
@Component |
|||
public class UserInterceptor implements HandlerInterceptor { |
|||
long start; |
|||
long end ; |
|||
@Override |
|||
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { |
|||
System.out.println("拦截器拦截成功"); |
|||
start = System.currentTimeMillis(); |
|||
return true; |
|||
} |
|||
|
|||
@Override |
|||
public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception { |
|||
end = System.currentTimeMillis(); |
|||
System.out.println("拦截结束"); |
|||
|
|||
} |
|||
|
|||
@Override |
|||
public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception { |
|||
System.out.println("释放资源"+(end-start)+"ms"); |
|||
|
|||
} |
|||
} |
@ -0,0 +1,76 @@ |
|||
package com.wh.controller.api.input; |
|||
|
|||
|
|||
import com.alibaba.fastjson.JSONObject; |
|||
import com.wh.pojo.api.*; |
|||
import com.wh.pojo.purchasenew.PurchasenewQuery; |
|||
import com.wh.pojo.purchasenew.PurchasenewVo; |
|||
import com.wh.service.api.instorehouse.InStorehouseMainService; |
|||
import com.wh.service.purchasenew.PurchasenewService; |
|||
import com.wh.service.purchasenewproduct.PurchasenewProductService; |
|||
import com.wh.vo.SysResult; |
|||
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.ApiOperation; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import javax.annotation.Resource; |
|||
import java.util.Map; |
|||
@Slf4j |
|||
@RestController |
|||
@CrossOrigin |
|||
@RequestMapping("/input/") |
|||
public class InStoreHouseMainController { |
|||
|
|||
@Autowired |
|||
private InStorehouseMainService inStorehouseMainService; |
|||
@Autowired |
|||
private PurchasenewService purchasenewService; |
|||
@Autowired |
|||
private PurchasenewProductService purchasenewProductService; |
|||
// @ApiOperation("根据条件分页查询数据的列表")
|
|||
// @PostMapping("/listPage")
|
|||
// public ResultBean<PagerVo<PurchasenewVo>> listPage(@RequestBody PagerQuery<PurchasenewQuery> pq){
|
|||
// pq.getParams().setState("2");
|
|||
// ResultBean rb = ResultBean.fireFail();
|
|||
// PagerVo<PurchasenewVo> pv = purchasenewService.listPageVo(pq);
|
|||
// return rb.success().setData(pv);
|
|||
// }
|
|||
@PostMapping("addInStorehouse") |
|||
public ResultBean addInStorehouse(@RequestBody InStoreHouseMainDto inStoreHouseMainDto){ |
|||
log.info("/input/addInStorehouse:{}", JSONObject.toJSONString(inStoreHouseMainDto)); |
|||
ResultBean resultBean = inStorehouseMainService.addInStorehouse(inStoreHouseMainDto); |
|||
return resultBean; |
|||
} |
|||
@PostMapping("addInStorehouseByPurchase") |
|||
public ResultBean addInStorehouseByPurchase(@RequestBody PurchaseInStoreHouseParams purchaseInStoreHouseParams){ |
|||
log.info("/input/addInStorehouseByPurchase:{}", JSONObject.toJSONString(purchaseInStoreHouseParams)); |
|||
return inStorehouseMainService.addInStorehouseByPurchase(purchaseInStoreHouseParams); |
|||
} |
|||
@PostMapping("listPage") |
|||
public ResultBean listPage(@RequestBody PagerQuery<InStorehouseMainQuery> pq){ |
|||
PagerVo<InStoreHouseMainVo> pv = inStorehouseMainService.listPage(pq); |
|||
ResultBean<PagerVo<InStoreHouseMainVo>> r = ResultBean.fireSuccess(); |
|||
return r.setData(pv); |
|||
} |
|||
@GetMapping("getInStorehouse/{sid}") |
|||
public ResultBean getInStorehouse(@PathVariable(value = "sid") String sid){ |
|||
return inStorehouseMainService.getInStorehouse(sid); |
|||
} |
|||
|
|||
/** |
|||
* 获取所有未入库的采购订单编号和仓库信息 |
|||
* @return |
|||
*/ |
|||
@GetMapping("getQuery") |
|||
public SysResult getQuery(@RequestBody InStorehouseMainQuery query){ |
|||
Map<String,Object> map = inStorehouseMainService.getQuery(query); |
|||
return SysResult.success(map); |
|||
} |
|||
|
|||
|
|||
|
|||
} |
@ -0,0 +1,79 @@ |
|||
package com.wh.controller.api.output; |
|||
|
|||
import com.alibaba.fastjson.JSONObject; |
|||
import com.wh.pojo.api.*; |
|||
import com.wh.pojo.purchasenew.Purchasenew; |
|||
import com.wh.service.api.outstorehouse.OutStorehouseListingService; |
|||
import com.wh.service.api.outstorehouse.OutStorehouseMainService; |
|||
import com.wh.vo.SysResult; |
|||
import com.yxt.common.base.utils.StringUtils; |
|||
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.ApiOperation; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.beans.BeanUtils; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import java.util.List; |
|||
|
|||
@Slf4j |
|||
@RestController |
|||
@CrossOrigin |
|||
@RequestMapping("/output/") |
|||
public class OutStorehouseMainController { |
|||
|
|||
@Autowired |
|||
private OutStorehouseMainService outStorehouseMainService; |
|||
|
|||
@Autowired |
|||
private OutStorehouseListingService outStorehouseListingService; |
|||
|
|||
@PostMapping("importOutStorehouse") |
|||
public ResultBean importOutStorehouse(@RequestBody OutStorehouseMainDto outStorehouseMainDto){ |
|||
log.info("/output/importOutStorehouse:{}", JSONObject.toJSONString(outStorehouseMainDto)); |
|||
ResultBean resultBean = outStorehouseMainService.importOutStorehouse(outStorehouseMainDto); |
|||
return resultBean; |
|||
} |
|||
|
|||
@PostMapping("addOutStorehouse") |
|||
public ResultBean addOutStorehouse(@RequestBody OutStorehouseMainDto outStorehouseMainDto){ |
|||
log.info("/output/addOutStorehouse:{}", JSONObject.toJSONString(outStorehouseMainDto)); |
|||
ResultBean resultBean = outStorehouseMainService.addOutStorehouse(outStorehouseMainDto); |
|||
return resultBean; |
|||
} |
|||
@PostMapping("listPage") |
|||
public ResultBean listPage(@RequestBody PagerQuery<OutStorehouseMainQuery> pq){ |
|||
PagerVo<OutStorehouseVo> pv = outStorehouseMainService.listPage(pq); |
|||
ResultBean<PagerVo<OutStorehouseVo>> r = ResultBean.fireSuccess(); |
|||
return r.setData(pv); |
|||
} |
|||
@PostMapping("listAllForPicking") |
|||
public ResultBean listAllForPicking(@RequestBody OutStorehouseMainQuery pq){ |
|||
ResultBean r=ResultBean.fireFail(); |
|||
if(StringUtils.isBlank(pq.getCusterSid())){ |
|||
return r.setMsg("CusterSid不能为空"); |
|||
} |
|||
List<OutStorehouseMain> list= outStorehouseMainService.listAllForPicking(pq); |
|||
return r.success().setData(list); |
|||
} |
|||
@GetMapping("getOutStorehouse/{sid}") |
|||
public ResultBean getOutStorehouse(@PathVariable(value = "sid") String sid){ |
|||
return outStorehouseMainService.getOutStorehouse(sid); |
|||
} |
|||
@ApiOperation("根据sid批量删除") |
|||
@PostMapping("/delBySids") |
|||
public ResultBean delBySids(@RequestBody String[] sids){ |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
for (String sid : sids) { |
|||
OutStorehouseMain entity=outStorehouseMainService.fetchBySid(sid); |
|||
int state = entity.getState(); |
|||
if(2==state){ |
|||
continue; |
|||
} |
|||
int i = outStorehouseMainService.deleteOutStorehouseMainBySid(sid); |
|||
} |
|||
return rb.success(); |
|||
} |
|||
} |
@ -0,0 +1,46 @@ |
|||
package com.wh.controller.api.prodstock; |
|||
|
|||
import com.alibaba.fastjson.JSONObject; |
|||
import com.wh.pojo.api.*; |
|||
import com.wh.service.api.outstorehouse.OutStorehouseMainService; |
|||
import com.wh.service.api.prodstock.ProdStockService; |
|||
import com.yxt.common.core.query.PagerQuery; |
|||
import com.yxt.common.core.result.ResultBean; |
|||
import com.yxt.common.core.vo.PagerVo; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import java.util.List; |
|||
@Slf4j |
|||
@RestController |
|||
@CrossOrigin |
|||
@RequestMapping("/stock/") |
|||
public class ProdStockController { |
|||
@Autowired |
|||
private ProdStockService prodStockService; |
|||
|
|||
@PostMapping("listPage") |
|||
public ResultBean listPage(@RequestBody PagerQuery<ProdStockQuery> pq){ |
|||
PagerVo<ProdStockVo> pv = prodStockService.listPage(pq); |
|||
ResultBean<PagerVo<ProdStockVo>> r = ResultBean.fireSuccess(); |
|||
return r.setData(pv); |
|||
} |
|||
@PostMapping("importStock") |
|||
public ResultBean importStock(@RequestBody ProdStocks datas){ |
|||
log.info("/stock/importStock:{}", JSONObject.toJSONString(datas)); |
|||
ResultBean rb=ResultBean.fireFail(); |
|||
List<ProdStock> list = datas.getList(); |
|||
if(list.size()>0){ |
|||
List<ProdStock> prodStocks = prodStockService.importStock(list); |
|||
if(prodStocks.size()>0){ |
|||
return rb.fail().setData(prodStocks).setMsg("部分数据导入失败,商品、仓库、货位信息不能为空," + |
|||
"storeHouseSid(仓库),proSid(商品id),proName(商品名称))," + |
|||
"locationId(货位编码),locationNumber(货位名称)"); |
|||
} |
|||
}else{ |
|||
return rb.setMsg("导入失败"); |
|||
} |
|||
return rb.success(); |
|||
} |
|||
} |
@ -0,0 +1,95 @@ |
|||
/********************************************************* |
|||
********************************************************* |
|||
******************** ******************* |
|||
************* ************ |
|||
******* _oo0oo_ ******* |
|||
*** o8888888o *** |
|||
* 88" . "88 * |
|||
* (| -_- |) * |
|||
* 0\ = /0 * |
|||
* ___/`---'\___ * |
|||
* .' \\| |// '. *
|
|||
* / \\||| : |||// \ *
|
|||
* / _||||| -:- |||||- \ * |
|||
* | | \\\ - /// | | *
|
|||
* | \_| ''\---/'' |_/ | * |
|||
* \ .-\__ '-' ___/-. / * |
|||
* ___'. .' /--.--\ `. .'___ * |
|||
* ."" '< `.___\_<|>_/___.' >' "". * |
|||
* | | : `- \`.;`\ _ /`;.`/ - ` : | | * |
|||
* \ \ `_. \_ __\ /__ _/ .-` / / * |
|||
* =====`-.____`.___ \_____/___.-`___.-'===== * |
|||
* `=---=' * |
|||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * |
|||
*********__佛祖保佑__永无BUG__验收通过__钞票多多__********* |
|||
*********************************************************/ |
|||
package com.wh.controller.brandinfo; |
|||
|
|||
import com.wh.pojo.brandinfo.BrandInfoDetailsVo; |
|||
import com.wh.pojo.brandinfo.BrandInfoDto; |
|||
import com.wh.pojo.brandinfo.BrandInfoQuery; |
|||
import com.wh.pojo.brandinfo.BrandInfoVo; |
|||
import com.wh.service.brandinfo.BrandInfoService; |
|||
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.*; |
|||
|
|||
|
|||
/** |
|||
* Project: yxt_supervise(宇信通监管) <br/> |
|||
* File: BrandInfoFeignFallback.java <br/> |
|||
* Class: com.supervise.biz.brandinfo.BrandInfoRest <br/> |
|||
* Description: 品牌信息. <br/> |
|||
* Copyright: Copyright (c) 2011 <br/> |
|||
* Company: https://gitee.com/liuzp315 <br/>
|
|||
* Makedate: 2022-11-11 11:40:28 <br/> |
|||
* |
|||
* @author dongjianzhao |
|||
* @version 1.0 |
|||
* @since 1.0 |
|||
*/ |
|||
@CrossOrigin |
|||
@Api(tags = "品牌信息") |
|||
@RestController("com.supervise.biz.brandinfo.BrandInfoRest") |
|||
@RequestMapping("v1/brandinfo") |
|||
public class BrandInfoRest { |
|||
|
|||
@Autowired |
|||
private BrandInfoService brandInfoService; |
|||
|
|||
@ApiOperation("根据条件分页查询数据的列表") |
|||
@PostMapping("/listPage") |
|||
public ResultBean<PagerVo<BrandInfoVo>> listPage(@RequestBody PagerQuery<BrandInfoQuery> pq){ |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
PagerVo<BrandInfoVo> pv = brandInfoService.listPageVo(pq); |
|||
return rb.success().setData(pv); |
|||
} |
|||
|
|||
@ApiOperation("新增或修改") |
|||
@PostMapping("/save") |
|||
public ResultBean save(@RequestBody BrandInfoDto dto){ |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
brandInfoService.saveOrUpdateDto(dto); |
|||
return rb.success(); |
|||
} |
|||
|
|||
@ApiOperation("根据sid批量删除") |
|||
@PostMapping("/delBySids") |
|||
public ResultBean delBySids(@RequestBody String[] sids){ |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
brandInfoService.delBySids(sids); |
|||
return rb.success(); |
|||
} |
|||
|
|||
@ApiOperation("根据SID获取一条记录") |
|||
@GetMapping("/fetchDetailsBySid/{sid}") |
|||
public ResultBean<BrandInfoDetailsVo> fetchDetailsBySid(@PathVariable("sid") String sid){ |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
BrandInfoDetailsVo vo = brandInfoService.fetchDetailsVoBySid(sid); |
|||
return rb.success().setData(vo); |
|||
} |
|||
} |
@ -0,0 +1,92 @@ |
|||
/********************************************************* |
|||
********************************************************* |
|||
******************** ******************* |
|||
************* ************ |
|||
******* _oo0oo_ ******* |
|||
*** o8888888o *** |
|||
* 88" . "88 * |
|||
* (| -_- |) * |
|||
* 0\ = /0 * |
|||
* ___/`---'\___ * |
|||
* .' \\| |// '. *
|
|||
* / \\||| : |||// \ *
|
|||
* / _||||| -:- |||||- \ * |
|||
* | | \\\ - /// | | *
|
|||
* | \_| ''\---/'' |_/ | * |
|||
* \ .-\__ '-' ___/-. / * |
|||
* ___'. .' /--.--\ `. .'___ * |
|||
* ."" '< `.___\_<|>_/___.' >' "". * |
|||
* | | : `- \`.;`\ _ /`;.`/ - ` : | | * |
|||
* \ \ `_. \_ __\ /__ _/ .-` / / * |
|||
* =====`-.____`.___ \_____/___.-`___.-'===== * |
|||
* `=---=' * |
|||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * |
|||
*********__佛祖保佑__永无BUG__验收通过__钞票多多__********* |
|||
*********************************************************/ |
|||
package com.wh.controller.dictcommon; |
|||
|
|||
|
|||
import com.wh.pojo.dictcommon.*; |
|||
import com.wh.service.dictcommon.DictCommonService; |
|||
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.*; |
|||
|
|||
/** |
|||
* Project: yxt_supervise(宇信通监管) <br/> |
|||
* File: DictCommonFeignFallback.java <br/> |
|||
* Class: com.supervise.biz.dictcommon.DictCommonRest <br/> |
|||
* Description: 数据字典——数据项. <br/> |
|||
* Copyright: Copyright (c) 2011 <br/> |
|||
* Company: https://gitee.com/liuzp315 <br/>
|
|||
* Makedate: 2022-11-11 11:40:29 <br/> |
|||
* |
|||
* @author dongjianzhao |
|||
* @version 1.0 |
|||
* @since 1.0 |
|||
*/ |
|||
@CrossOrigin |
|||
@Api(tags = "数据字典——数据项") |
|||
@RestController("com.wh.controller.dictcommon.DictCommonRest") |
|||
@RequestMapping("v1/dictcommon") |
|||
public class DictCommonRest { |
|||
|
|||
@Autowired |
|||
private DictCommonService dictCommonService; |
|||
|
|||
@ApiOperation("根据条件分页查询数据的列表") |
|||
@PostMapping("/listPage") |
|||
public ResultBean<PagerVo<DictCommonVo>> listPage(@RequestBody PagerQuery<DictCommonQuery> pq){ |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
PagerVo<DictCommonVo> pv = dictCommonService.listPageVo(pq); |
|||
return rb.success().setData(pv); |
|||
} |
|||
|
|||
@ApiOperation("新增或修改") |
|||
@PostMapping("/save") |
|||
public ResultBean save(@RequestBody DictCommonDto dto){ |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
dictCommonService.saveOrUpdateDto(dto); |
|||
return rb.success(); |
|||
} |
|||
|
|||
@ApiOperation("根据sid批量删除") |
|||
@PostMapping("/delBySids") |
|||
public ResultBean delBySids(@RequestBody String[] sids){ |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
dictCommonService.delBySids(sids); |
|||
return rb.success(); |
|||
} |
|||
|
|||
@ApiOperation("根据SID获取一条记录") |
|||
@GetMapping("/fetchDetailsBySid/{sid}") |
|||
public ResultBean<DictCommonDetailsVo> fetchDetailsBySid(@PathVariable("sid") String sid){ |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
DictCommonDetailsVo vo = dictCommonService.fetchDetailsVoBySid(sid); |
|||
return rb.success().setData(vo); |
|||
} |
|||
} |
@ -0,0 +1,94 @@ |
|||
/********************************************************* |
|||
********************************************************* |
|||
******************** ******************* |
|||
************* ************ |
|||
******* _oo0oo_ ******* |
|||
*** o8888888o *** |
|||
* 88" . "88 * |
|||
* (| -_- |) * |
|||
* 0\ = /0 * |
|||
* ___/`---'\___ * |
|||
* .' \\| |// '. *
|
|||
* / \\||| : |||// \ *
|
|||
* / _||||| -:- |||||- \ * |
|||
* | | \\\ - /// | | *
|
|||
* | \_| ''\---/'' |_/ | * |
|||
* \ .-\__ '-' ___/-. / * |
|||
* ___'. .' /--.--\ `. .'___ * |
|||
* ."" '< `.___\_<|>_/___.' >' "". * |
|||
* | | : `- \`.;`\ _ /`;.`/ - ` : | | * |
|||
* \ \ `_. \_ __\ /__ _/ .-` / / * |
|||
* =====`-.____`.___ \_____/___.-`___.-'===== * |
|||
* `=---=' * |
|||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * |
|||
*********__佛祖保佑__永无BUG__验收通过__钞票多多__********* |
|||
*********************************************************/ |
|||
package com.wh.controller.dicttype; |
|||
|
|||
import com.wh.pojo.dicttype.DictTypeDetailsVo; |
|||
import com.wh.pojo.dicttype.DictTypeDto; |
|||
import com.wh.pojo.dicttype.DictTypeQuery; |
|||
import com.wh.pojo.dicttype.DictTypeVo; |
|||
import com.wh.service.dicttype.DictTypeService; |
|||
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.*; |
|||
|
|||
/** |
|||
* Project: yxt_supervise(宇信通监管) <br/> |
|||
* File: DictTypeFeignFallback.java <br/> |
|||
* Class: com.supervise.biz.dicttype.DictTypeRest <br/> |
|||
* Description: 数据字典——数据类型. <br/> |
|||
* Copyright: Copyright (c) 2011 <br/> |
|||
* Company: https://gitee.com/liuzp315 <br/>
|
|||
* Makedate: 2022-11-11 11:40:29 <br/> |
|||
* |
|||
* @author dongjianzhao |
|||
* @version 1.0 |
|||
* @since 1.0 |
|||
*/ |
|||
@CrossOrigin |
|||
@Api(tags = "数据字典——数据类型") |
|||
@RestController("com.wh.controller.dicttype.DictTypeRest") |
|||
@RequestMapping("v1/dicttype") |
|||
public class DictTypeRest { |
|||
|
|||
@Autowired |
|||
private DictTypeService dictTypeService; |
|||
|
|||
@ApiOperation("根据条件分页查询数据的列表") |
|||
@PostMapping("/listPage") |
|||
public ResultBean<PagerVo<DictTypeVo>> listPage(@RequestBody PagerQuery<DictTypeQuery> pq){ |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
PagerVo<DictTypeVo> pv = dictTypeService.listPageVo(pq); |
|||
return rb.success().setData(pv); |
|||
} |
|||
|
|||
@ApiOperation("新增或修改") |
|||
@PostMapping("/save") |
|||
public ResultBean save(@RequestBody DictTypeDto dto){ |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
dictTypeService.saveOrUpdateDto(dto); |
|||
return rb.success(); |
|||
} |
|||
|
|||
@ApiOperation("根据sid批量删除") |
|||
@PostMapping("/delBySids") |
|||
public ResultBean delBySids(@RequestBody String[] sids){ |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
dictTypeService.delBySids(sids); |
|||
return rb.success(); |
|||
} |
|||
|
|||
@ApiOperation("根据SID获取一条记录") |
|||
@GetMapping("/fetchDetailsBySid/{sid}") |
|||
public ResultBean<DictTypeDetailsVo> fetchDetailsBySid(@PathVariable("sid") String sid){ |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
DictTypeDetailsVo vo = dictTypeService.fetchDetailsVoBySid(sid); |
|||
return rb.success().setData(vo); |
|||
} |
|||
} |
@ -0,0 +1,103 @@ |
|||
/********************************************************* |
|||
********************************************************* |
|||
******************** ******************* |
|||
************* ************ |
|||
******* _oo0oo_ ******* |
|||
*** o8888888o *** |
|||
* 88" . "88 * |
|||
* (| -_- |) * |
|||
* 0\ = /0 * |
|||
* ___/`---'\___ * |
|||
* .' \\| |// '. *
|
|||
* / \\||| : |||// \ *
|
|||
* / _||||| -:- |||||- \ * |
|||
* | | \\\ - /// | | *
|
|||
* | \_| ''\---/'' |_/ | * |
|||
* \ .-\__ '-' ___/-. / * |
|||
* ___'. .' /--.--\ `. .'___ * |
|||
* ."" '< `.___\_<|>_/___.' >' "". * |
|||
* | | : `- \`.;`\ _ /`;.`/ - ` : | | * |
|||
* \ \ `_. \_ __\ /__ _/ .-` / / * |
|||
* =====`-.____`.___ \_____/___.-`___.-'===== * |
|||
* `=---=' * |
|||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * |
|||
*********__佛祖保佑__永无BUG__验收通过__钞票多多__********* |
|||
*********************************************************/ |
|||
package com.wh.controller.entinfo; |
|||
|
|||
import com.wh.pojo.entinfo.EntInfoDetailsVo; |
|||
import com.wh.pojo.entinfo.EntInfoDto; |
|||
import com.wh.pojo.entinfo.EntInfoQuery; |
|||
import com.wh.pojo.entinfo.EntInfoVo; |
|||
import com.wh.service.entinfo.EntInfoService; |
|||
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: warehouse(仓储) <br/> |
|||
* File: EntInfoFeignFallback.java <br/> |
|||
* Class: com.wh.biz.entinfo.EntInfoRest <br/> |
|||
* Description: 客户信息. <br/> |
|||
* Copyright: Copyright (c) 2011 <br/> |
|||
* Company: https://gitee.com/liuzp315 <br/>
|
|||
* Makedate: 2023-06-13 22:19:45 <br/> |
|||
* |
|||
* @author liupopo |
|||
* @version 1.0 |
|||
* @since 1.0 |
|||
*/ |
|||
@CrossOrigin |
|||
@Api(tags = "客户信息") |
|||
@RestController("com.wh.biz.entinfo.EntInfoRest") |
|||
@RequestMapping("v1/entinfo") |
|||
public class EntInfoRest { |
|||
|
|||
@Autowired |
|||
private EntInfoService entInfoService; |
|||
|
|||
@ApiOperation("根据条件分页查询数据的列表") |
|||
@PostMapping("/listPage") |
|||
public ResultBean<PagerVo<EntInfoVo>> listPage(@RequestBody PagerQuery<EntInfoQuery> pq){ |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
PagerVo<EntInfoVo> pv = entInfoService.listPageVo(pq); |
|||
return rb.success().setData(pv); |
|||
} |
|||
// @ApiOperation("查询所有的企业信息")
|
|||
// @GetMapping("/listAll")
|
|||
// public ResultBean<List<WhEnterpriseInformationVo>> listAll(){
|
|||
// ResultBean rb = ResultBean.fireFail();
|
|||
// List<WhEnterpriseInformationVo> pv = entInfoService.listAll();
|
|||
// return rb.success().setData(pv);
|
|||
// }
|
|||
|
|||
@ApiOperation("新增或修改") |
|||
@PostMapping("/save") |
|||
public ResultBean save(@RequestBody EntInfoDto dto){ |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
entInfoService.saveOrUpdateDto(dto); |
|||
return rb.success(); |
|||
} |
|||
|
|||
@ApiOperation("根据sid批量删除") |
|||
@PostMapping("/delBySids") |
|||
public ResultBean delBySids(@RequestBody String[] sids){ |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
entInfoService.delBySids(sids); |
|||
return rb.success(); |
|||
} |
|||
|
|||
@ApiOperation("根据SID获取一条记录") |
|||
@GetMapping("/fetchDetailsBySid/{sid}") |
|||
public ResultBean<EntInfoDetailsVo> fetchDetailsBySid(@PathVariable("sid") String sid){ |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
EntInfoDetailsVo vo = entInfoService.fetchDetailsVoBySid(sid); |
|||
return rb.success().setData(vo); |
|||
} |
|||
} |
@ -0,0 +1,93 @@ |
|||
package com.wh.controller.initial; |
|||
|
|||
import com.wh.pojo.*; |
|||
import com.wh.pojo.shstorehouse.ShStorehouse; |
|||
import com.wh.service.initial.LocationService; |
|||
import com.wh.service.shstorehouse.ShStorehouseService; |
|||
import com.wh.vo.PageResult; |
|||
import com.wh.vo.SysResult; |
|||
import com.yxt.common.core.query.PagerQuery; |
|||
import com.yxt.common.core.result.ResultBean; |
|||
import com.yxt.common.core.vo.PagerVo; |
|||
import org.apache.commons.lang3.StringUtils; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import java.util.List; |
|||
|
|||
@RestController |
|||
@CrossOrigin |
|||
@RequestMapping("/location/") |
|||
public class LocationController { |
|||
|
|||
@Autowired |
|||
private LocationService locationService; |
|||
@Autowired |
|||
private ShStorehouseService shStorehouseService; |
|||
|
|||
@PostMapping("list") |
|||
public ResultBean getLocationList(@RequestBody PagerQuery<LocationQuery> pq){ |
|||
// pageResult = locationService.getLocationList(pageResult);
|
|||
// return SysResult.success(pageResult);
|
|||
ResultBean rb = ResultBean.fireFail(); |
|||
PagerVo<Location> pv = locationService.getSupplierList(pq); |
|||
return rb.success().setData(pv); |
|||
} |
|||
@GetMapping("listAll") |
|||
public SysResult listAll(PageResult pageResult){ |
|||
List<Location> locations = locationService.getLocations(); |
|||
return SysResult.success(locations); |
|||
} |
|||
|
|||
@PostMapping("addLocation") |
|||
public SysResult addLocation(@RequestBody Location location){ |
|||
if(StringUtils.isBlank(location.getStorehouseid())){ |
|||
return SysResult.fail(); |
|||
} |
|||
ShStorehouse shStorehouse = shStorehouseService.fetchBySid(location.getStorehouseid()); |
|||
if(shStorehouse==null){ |
|||
return SysResult.fail(); |
|||
} |
|||
location.setStorehouse(shStorehouse.getName()); |
|||
locationService.addLocation(location); |
|||
return SysResult.success(); |
|||
} |
|||
|
|||
@PutMapping("updataLocation") |
|||
public SysResult updataLocation(@RequestBody Location location){ |
|||
locationService.updataLocation(location); |
|||
return SysResult.success(); |
|||
} |
|||
|
|||
@DeleteMapping("delete/{name}") |
|||
public SysResult deleteLocation(@PathVariable String name){ |
|||
locationService.deleteLocation(name); |
|||
return SysResult.success(); |
|||
} |
|||
@DeleteMapping("deleteById/{id}") |
|||
public ResultBean deleteById(@PathVariable String id){ |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
int i = locationService.deleteById(id); |
|||
if(i==0){ |
|||
return rb; |
|||
} |
|||
return rb.success(); |
|||
} |
|||
|
|||
@GetMapping("getStorehouse") |
|||
public SysResult getStorehouse(){ |
|||
List<Storehouse> storehouseList = locationService.getStorehouse(); |
|||
return SysResult.success(storehouseList); |
|||
} |
|||
@GetMapping("getLocationsByStoreId/{id}") |
|||
public SysResult getLocationsByStoreId(String id){ |
|||
List<LocationVo> locations = locationService.getLocationsByStoreId(id); |
|||
return SysResult.success(locations); |
|||
} |
|||
|
|||
@GetMapping("getType") |
|||
public SysResult getType(){ |
|||
List<LocationType> locationTypeList = locationService.getType(); |
|||
return SysResult.success(locationTypeList); |
|||
} |
|||
} |
@ -0,0 +1,57 @@ |
|||
package com.wh.controller.initial; |
|||
|
|||
import com.wh.pojo.Product; |
|||
import com.wh.pojo.ProductQuery; |
|||
import com.wh.pojo.Storehouse; |
|||
import com.wh.pojo.shstorehouse.ShStorehouseQuery; |
|||
import com.wh.pojo.shstorehouse.ShStorehouseVo; |
|||
import com.wh.service.initial.ProductService; |
|||
import com.wh.vo.PageResult; |
|||
import com.wh.vo.SysResult; |
|||
import com.yxt.common.core.query.PagerQuery; |
|||
import com.yxt.common.core.result.ResultBean; |
|||
import com.yxt.common.core.vo.PagerVo; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import java.util.List; |
|||
|
|||
@RestController |
|||
@CrossOrigin |
|||
@RequestMapping("/product/") |
|||
public class ProductController { |
|||
@Autowired |
|||
private ProductService productService; |
|||
|
|||
@PostMapping("list") |
|||
public ResultBean getProductList(@RequestBody PagerQuery<ProductQuery> pq){ |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
PagerVo<Product> pv = productService.getProductList(pq); |
|||
return rb.success().setData(pv); |
|||
} |
|||
|
|||
@PostMapping("addProduct") |
|||
public SysResult addProduct(@RequestBody Product product){ |
|||
productService.addProduct(product); |
|||
return SysResult.success(); |
|||
} |
|||
|
|||
@PutMapping("updataProduct") |
|||
public SysResult updataProduct(@RequestBody Product product){ |
|||
productService.updataProduct(product); |
|||
return SysResult.success(); |
|||
} |
|||
|
|||
@DeleteMapping("delete/{barCode}") |
|||
public SysResult deleteProduct(@PathVariable String barCode){ |
|||
productService.deleteProduct(barCode); |
|||
return SysResult.success(); |
|||
} |
|||
|
|||
@GetMapping("getStorehouse") |
|||
public SysResult getStorehouse(){ |
|||
List<Storehouse> storehouses = productService.getStorehouse(); |
|||
return SysResult.success(storehouses); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,41 @@ |
|||
package com.wh.controller.initial; |
|||
|
|||
import com.wh.pojo.Storehouse; |
|||
import com.wh.service.initial.StorehouseService; |
|||
import com.wh.vo.PageResult; |
|||
import com.wh.vo.SysResult; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
@RestController |
|||
@CrossOrigin |
|||
@RequestMapping("/storehouse/") |
|||
public class StorehouseController { |
|||
|
|||
@Autowired |
|||
private StorehouseService storehouseService; |
|||
|
|||
@GetMapping("list") |
|||
public SysResult getStorehouseList(PageResult pageResult){ |
|||
pageResult = storehouseService.getStorehouseList(pageResult); |
|||
return SysResult.success(pageResult); |
|||
} |
|||
|
|||
@PostMapping("addStorehouse") |
|||
public SysResult addStorehouse(@RequestBody Storehouse storehouse){ |
|||
storehouseService.addStorehouse(storehouse); |
|||
return SysResult.success(); |
|||
} |
|||
|
|||
@PutMapping("updataStorehouse") |
|||
public SysResult updataStorehouse(@RequestBody Storehouse storehouse){ |
|||
storehouseService.updataStorehouse(storehouse); |
|||
return SysResult.success(); |
|||
} |
|||
|
|||
@DeleteMapping("delete/{name}") |
|||
public SysResult deleteStorehouse(@PathVariable String name) throws Exception { |
|||
storehouseService.deleteStorehouse(name); |
|||
return SysResult.success(); |
|||
} |
|||
} |
@ -0,0 +1,60 @@ |
|||
package com.wh.controller.initial; |
|||
|
|||
import com.wh.pojo.Product; |
|||
import com.wh.pojo.ProductQuery; |
|||
import com.wh.pojo.Supplier; |
|||
import com.wh.pojo.SupplierQuery; |
|||
import com.wh.service.initial.SupplierService; |
|||
import com.wh.vo.PageResult; |
|||
import com.wh.vo.SysResult; |
|||
import com.yxt.common.core.query.PagerQuery; |
|||
import com.yxt.common.core.result.ResultBean; |
|||
import com.yxt.common.core.vo.PagerVo; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import java.util.List; |
|||
|
|||
@RestController |
|||
@CrossOrigin |
|||
@RequestMapping("/supplier/") |
|||
public class SupplierController { |
|||
|
|||
@Autowired |
|||
private SupplierService supplierService; |
|||
|
|||
@PostMapping("list") |
|||
public ResultBean getSupplierList(@RequestBody PagerQuery<SupplierQuery> pq){ |
|||
// pageResult = supplierService.getSupplierList(pageResult);
|
|||
// return SysResult.success(pageResult);
|
|||
ResultBean rb = ResultBean.fireFail(); |
|||
PagerVo<Supplier> pv = supplierService.getSupplierList(pq); |
|||
return rb.success().setData(pv); |
|||
} |
|||
@PostMapping("listAll") |
|||
public ResultBean listAll(@RequestBody PagerQuery<SupplierQuery> pq){ |
|||
// pageResult = supplierService.getSupplierList(pageResult);
|
|||
// return SysResult.success(pageResult);
|
|||
ResultBean rb = ResultBean.fireFail(); |
|||
List<Supplier> list=supplierService.listAll(); |
|||
return rb.success().setData(list); |
|||
} |
|||
|
|||
@PostMapping("addSupplier") |
|||
public SysResult addSupplier(@RequestBody Supplier supplier){ |
|||
supplierService.addSupplier(supplier); |
|||
return SysResult.success(); |
|||
} |
|||
|
|||
@PutMapping("updataSupplier") |
|||
public SysResult updataSupplier(@RequestBody Supplier supplier){ |
|||
supplierService.updataSupplier(supplier); |
|||
return SysResult.success(); |
|||
} |
|||
|
|||
@DeleteMapping("delete/{name}") |
|||
public SysResult deleteSupplier(@PathVariable String name){ |
|||
supplierService.deleteSupplier(name); |
|||
return SysResult.success(); |
|||
} |
|||
} |
@ -0,0 +1,70 @@ |
|||
package com.wh.controller.instorehouse; |
|||
|
|||
|
|||
import com.wh.controller.initial.StorehouseController; |
|||
import com.wh.pojo.Product; |
|||
import com.wh.pojo.Purchase; |
|||
import com.wh.pojo.Storehouse; |
|||
import com.wh.pojo.Supplier; |
|||
import com.wh.service.instorehouse.PurchaseService; |
|||
import com.wh.vo.PageResult; |
|||
import com.wh.vo.SysResult; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
@RestController |
|||
@CrossOrigin |
|||
@RequestMapping("/purchase/") |
|||
public class PurchaseController { |
|||
|
|||
@Autowired |
|||
private PurchaseService purchaseService; |
|||
|
|||
@GetMapping("list") |
|||
public SysResult getPurchaseList(PageResult pageResult){ |
|||
pageResult = purchaseService.getPurchaseList(pageResult); |
|||
return SysResult.success(pageResult); |
|||
} |
|||
|
|||
@PostMapping("addPurchase") |
|||
public SysResult addPurchase(@RequestBody Purchase purchase){ |
|||
purchaseService.addPurchase(purchase); |
|||
return SysResult.success(); |
|||
} |
|||
|
|||
@GetMapping("getProductList") |
|||
public SysResult getProductList(Product product){ |
|||
// String name = (String) map.get("name");
|
|||
// System.out.println(product.getName());
|
|||
// System.out.println(map.toString());
|
|||
List<Product> productList = purchaseService.getProductList(product.getName()); |
|||
return SysResult.success(productList); |
|||
} |
|||
|
|||
@GetMapping("getSupplier") |
|||
public SysResult getSupplier(){ |
|||
List<Supplier> supplierList = purchaseService.getSupplier(); |
|||
return SysResult.success(supplierList); |
|||
} |
|||
|
|||
@GetMapping("getStorehouse") |
|||
public SysResult getStorehouse(){ |
|||
List<Storehouse> storehouseList = purchaseService.getStorehouse(); |
|||
return SysResult.success(storehouseList); |
|||
} |
|||
|
|||
@DeleteMapping("delete/{purchaseId}") |
|||
public SysResult deletePurchase(@PathVariable String purchaseId){ |
|||
purchaseService.deletePurchase(purchaseId); |
|||
return SysResult.success(); |
|||
} |
|||
|
|||
@PutMapping("updata") |
|||
public SysResult updataPurchase(@RequestBody Purchase purchase){ |
|||
purchaseService.updataPurchase(purchase); |
|||
return SysResult.success(); |
|||
} |
|||
} |
@ -0,0 +1,52 @@ |
|||
package com.wh.controller.instorehouse; |
|||
|
|||
import com.wh.pojo.Receiving; |
|||
import com.wh.service.instorehouse.ReceivingService; |
|||
import com.wh.vo.Options; |
|||
import com.wh.vo.PageResult; |
|||
import com.wh.vo.SysResult; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
@RestController |
|||
@CrossOrigin |
|||
@RequestMapping("/receiving/") |
|||
public class ReceivingController { |
|||
|
|||
@Autowired |
|||
private ReceivingService receivingService; |
|||
|
|||
@GetMapping("getOptions") |
|||
public SysResult getOptions(){ |
|||
List<Options> optionsList = receivingService.getOptions(); |
|||
return SysResult.success(optionsList); |
|||
} |
|||
|
|||
@PostMapping("addReceiving") |
|||
public SysResult addReceiving(@RequestBody Map<String,String> map){ |
|||
System.out.println(map); |
|||
receivingService.addReceiving(map.get("id"),map.get("user")); |
|||
return SysResult.success(); |
|||
} |
|||
|
|||
@GetMapping("getReceiving") |
|||
public SysResult getReceiving(PageResult pageResult){ |
|||
pageResult = receivingService.getReceiving(pageResult); |
|||
return SysResult.success(pageResult); |
|||
} |
|||
|
|||
@PutMapping("updataReceiving") |
|||
public SysResult updataReceiving(@RequestBody Receiving receiving){ |
|||
receivingService.updataReceiving(receiving); |
|||
return SysResult.success(); |
|||
} |
|||
|
|||
@DeleteMapping("deleteReceiving/{receivingId}/{purchaseId}") |
|||
public SysResult deleteReceiving(@PathVariable String receivingId,@PathVariable String purchaseId){ |
|||
receivingService.deleteReceiving(receivingId,purchaseId); |
|||
return SysResult.success(); |
|||
} |
|||
} |
@ -0,0 +1,60 @@ |
|||
package com.wh.controller.outstorehouse; |
|||
|
|||
import com.alibaba.fastjson.JSONObject; |
|||
import com.wh.pojo.OutStorehouse; |
|||
import com.wh.service.outstorehouse.OutStorehouseService; |
|||
import com.wh.vo.PageResult; |
|||
import com.wh.vo.SysResult; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import java.util.Map; |
|||
@Slf4j |
|||
@RestController |
|||
@CrossOrigin |
|||
@RequestMapping("/outStorehouse/") |
|||
public class OutStorehouseController { |
|||
|
|||
@Autowired |
|||
private OutStorehouseService outStorehouseService; |
|||
|
|||
|
|||
|
|||
@GetMapping("getQuery") |
|||
public SysResult getQuery(OutStorehouse outStorehouse){ |
|||
Map<String,Object> map = outStorehouseService.getQuery(outStorehouse); |
|||
return SysResult.success(map); |
|||
} |
|||
|
|||
@GetMapping("list") |
|||
public SysResult getOutStorehouseList(PageResult pageResult){ |
|||
pageResult = outStorehouseService.getOutStorehouseList(pageResult); |
|||
return SysResult.success(pageResult); |
|||
} |
|||
|
|||
@PostMapping("addOutStorehouse") |
|||
public SysResult addOutStorehouse(@RequestBody OutStorehouse outStorehouse){ |
|||
log.info("/outStorehouse/addOutStorehouse:{}", JSONObject.toJSONString(outStorehouse)); |
|||
outStorehouseService.addOutStorehouse(outStorehouse); |
|||
return SysResult.success(); |
|||
} |
|||
|
|||
@PutMapping("updataOutStorehouse") |
|||
public SysResult updataOutStorehouse(@RequestBody OutStorehouse outStorehouse){ |
|||
outStorehouseService.updataOutStorehouse(outStorehouse); |
|||
return SysResult.success(); |
|||
} |
|||
|
|||
@DeleteMapping("delete/{outStorehouseId}") |
|||
public SysResult deleteOutStorehouse(@PathVariable String outStorehouseId){ |
|||
// outStorehouseService.deleteOutStorehouse(outStorehouseId);
|
|||
return SysResult.success("连接成功"); |
|||
} |
|||
|
|||
@PutMapping("out") |
|||
public SysResult out(@RequestBody OutStorehouse outStorehouse){ |
|||
outStorehouseService.out(outStorehouse); |
|||
return SysResult.success(); |
|||
} |
|||
} |
@ -0,0 +1,68 @@ |
|||
package com.wh.controller.outstorehouse; |
|||
|
|||
import com.alibaba.fastjson.JSONObject; |
|||
import com.wh.pojo.Picking; |
|||
import com.wh.pojo.api.OutStorehouseListing; |
|||
import com.wh.pojo.api.OutStorehouseMain; |
|||
import com.wh.pojo.api.OutStorehouseMainQuery; |
|||
import com.wh.pojo.api.OutStorehouseVo; |
|||
import com.wh.service.api.outstorehouse.OutStorehouseListingService; |
|||
import com.wh.service.api.outstorehouse.OutStorehouseMainService; |
|||
import com.wh.service.outstorehouse.PickingService; |
|||
import com.wh.vo.PageResult; |
|||
import com.wh.vo.PickingUser; |
|||
import com.wh.vo.SysResult; |
|||
import com.yxt.common.core.query.PagerQuery; |
|||
import com.yxt.common.core.result.ResultBean; |
|||
import com.yxt.common.core.vo.PagerVo; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import javax.annotation.Resource; |
|||
import javax.xml.transform.Result; |
|||
import java.util.List; |
|||
@Slf4j |
|||
@RestController |
|||
@CrossOrigin |
|||
@RequestMapping("/picking/") |
|||
public class PickingController { |
|||
|
|||
@Autowired |
|||
private PickingService pickingService; |
|||
@Autowired |
|||
private OutStorehouseMainService outStorehouseMainService; |
|||
@PostMapping("listPage") |
|||
public ResultBean listPage(@RequestBody PagerQuery<OutStorehouseMainQuery> pq){ |
|||
pq.getParams().setState("2"); |
|||
PagerVo<OutStorehouseVo> pv = outStorehouseMainService.listPage(pq); |
|||
ResultBean<PagerVo<OutStorehouseVo>> r = ResultBean.fireSuccess(); |
|||
return r.setData(pv); |
|||
} |
|||
@GetMapping("getOptions") |
|||
public SysResult getOptions(){ |
|||
List<String> outStorehouseIdList = pickingService.getOptions(); |
|||
return SysResult.success(outStorehouseIdList); |
|||
} |
|||
|
|||
@PutMapping("picking") |
|||
public ResultBean picking(@RequestBody PickingUser pickingUser){ |
|||
log.info("/picking/picking:{}", JSONObject.toJSONString(pickingUser)); |
|||
return pickingService.picking(pickingUser); |
|||
// ss pickingService.picking(pickingUser.getOutStorehouseId(),pickingUser.getUser());
|
|||
} |
|||
|
|||
@GetMapping("list") |
|||
public SysResult getPickingList(PageResult pageResult){ |
|||
pageResult = pickingService.getPickingList(pageResult); |
|||
return SysResult.success(pageResult); |
|||
} |
|||
|
|||
@PutMapping("finish") |
|||
public SysResult finish(@RequestBody Picking picking){ |
|||
pickingService.finish(picking); |
|||
return SysResult.success(); |
|||
} |
|||
|
|||
|
|||
} |
@ -0,0 +1,84 @@ |
|||
package com.wh.controller.purchasenew; |
|||
|
|||
import com.alibaba.fastjson.JSONObject; |
|||
import com.wh.pojo.purchasenew.*; |
|||
import com.wh.service.purchasenew.PurchasenewService; |
|||
import com.yxt.common.base.utils.StringUtils; |
|||
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.ApiOperation; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import java.util.List; |
|||
@Slf4j |
|||
@RestController |
|||
@CrossOrigin |
|||
@RequestMapping("/purchasenew") |
|||
public class PurchasenewController { |
|||
@Autowired |
|||
private PurchasenewService purchasenewService; |
|||
|
|||
|
|||
@ApiOperation("根据条件分页查询数据的列表") |
|||
@PostMapping("/listPage") |
|||
public ResultBean<PagerVo<PurchasenewVo>> listPage(@RequestBody PagerQuery<PurchasenewQuery> pq){ |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
PagerVo<PurchasenewVo> pv = purchasenewService.listPageVo(pq); |
|||
return rb.success().setData(pv); |
|||
} |
|||
@ApiOperation("获取所有的采购订单") |
|||
@PostMapping("/listAll") |
|||
public ResultBean<List<Purchasenew>> listAll(@RequestBody PurchasenewQuery pq){ |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
// String custId = pq.getCustId();
|
|||
// if(StringUtils.isBlank(custId)){
|
|||
// return rb.setMsg("企业id不能为空");
|
|||
// }
|
|||
List<Purchasenew> list = purchasenewService.listForInput(pq); |
|||
return rb.success().setData(list); |
|||
} |
|||
|
|||
@ApiOperation("导入采购订单 入库") |
|||
@PostMapping("/importPurchase") |
|||
public ResultBean importPurchase(@RequestBody PurchasenewForImportDto dto){ |
|||
log.info("/stock/importStock:{}", JSONObject.toJSONString(dto)); |
|||
return purchasenewService.importPurchase(dto); |
|||
} |
|||
@ApiOperation("新增或修改") |
|||
@PostMapping("/save") |
|||
public ResultBean save(@RequestBody PurchasenewDto dto){ |
|||
log.info("/stock/importStock:{}", JSONObject.toJSONString(dto)); |
|||
return purchasenewService.saveOrUpdateDto(dto); |
|||
} |
|||
|
|||
@ApiOperation("根据sid批量删除") |
|||
@PostMapping("/delBySids") |
|||
public ResultBean delBySids(@RequestBody String[] sids){ |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
int i = purchasenewService.delByPurchasenewSids(sids); |
|||
if (i==0) |
|||
return rb; |
|||
return rb.success(); |
|||
} |
|||
|
|||
@ApiOperation("根据SID获取一条记录") |
|||
@GetMapping("/fetchDetailsBySid/{sid}") |
|||
public ResultBean<PurchasenewDetailsVo> fetchDetailsBySid(@PathVariable("sid") String sid){ |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
PurchasenewDetailsVo vo = purchasenewService.fetchDetailsVoBySid(sid); |
|||
if(vo==null){ |
|||
return rb; |
|||
} |
|||
return rb.success().setData(vo); |
|||
} |
|||
// @ApiOperation("获取所有的企业信息")
|
|||
// @GetMapping("/fetchEntList")
|
|||
// public ResultBean<List<WhEnterpriseInformationVo>> fetchDetailsBySid(){
|
|||
// ResultBean<List<WhEnterpriseInformationVo>> enterpriseBySid = whEnterpriseInformationFeign.EnterpriseList();
|
|||
// return enterpriseBySid;
|
|||
// }
|
|||
|
|||
} |
@ -0,0 +1,54 @@ |
|||
package com.wh.controller.purchasenewproduct; |
|||
|
|||
import com.wh.pojo.purchasenewproduct.PurchasenewProductDetailsVo; |
|||
import com.wh.pojo.purchasenewproduct.PurchasenewProductDto; |
|||
import com.wh.pojo.purchasenewproduct.PurchasenewProductQuery; |
|||
import com.wh.pojo.purchasenewproduct.PurchasenewProductVo; |
|||
import com.wh.service.purchasenewproduct.PurchasenewProductService; |
|||
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.ApiOperation; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
@RestController |
|||
@CrossOrigin |
|||
@RequestMapping("/purchasenewproduct/") |
|||
public class PurchasenewProductController { |
|||
|
|||
@Autowired |
|||
private PurchasenewProductService purchasenewProductService; |
|||
|
|||
@ApiOperation("根据条件分页查询数据的列表") |
|||
@PostMapping("/listPage") |
|||
public ResultBean<PagerVo<PurchasenewProductVo>> listPage(@RequestBody PagerQuery<PurchasenewProductQuery> pq){ |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
PagerVo<PurchasenewProductVo> pv = purchasenewProductService.listPageVo(pq); |
|||
return rb.success().setData(pv); |
|||
} |
|||
|
|||
@ApiOperation("新增或修改") |
|||
@PostMapping("/save") |
|||
public ResultBean save(@RequestBody PurchasenewProductDto dto){ |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
purchasenewProductService.saveOrUpdateDto(dto); |
|||
return rb.success(); |
|||
} |
|||
|
|||
@ApiOperation("根据sid批量删除") |
|||
@PostMapping("/delBySids") |
|||
public ResultBean delBySids(@RequestBody String[] sids){ |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
purchasenewProductService.delBySids(sids); |
|||
return rb.success(); |
|||
} |
|||
|
|||
@ApiOperation("根据SID获取一条记录") |
|||
@GetMapping("/fetchDetailsBySid/{sid}") |
|||
public ResultBean<PurchasenewProductDetailsVo> fetchDetailsBySid(@PathVariable("sid") String sid){ |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
PurchasenewProductDetailsVo vo = purchasenewProductService.fetchDetailsVoBySid(sid); |
|||
return rb.success().setData(vo); |
|||
} |
|||
} |
@ -0,0 +1,246 @@ |
|||
/********************************************************* |
|||
********************************************************* |
|||
******************** ******************* |
|||
************* ************ |
|||
******* _oo0oo_ ******* |
|||
*** o8888888o *** |
|||
* 88" . "88 * |
|||
* (| -_- |) * |
|||
* 0\ = /0 * |
|||
* ___/`---'\___ * |
|||
* .' \\| |// '. *
|
|||
* / \\||| : |||// \ *
|
|||
* / _||||| -:- |||||- \ * |
|||
* | | \\\ - /// | | *
|
|||
* | \_| ''\---/'' |_/ | * |
|||
* \ .-\__ '-' ___/-. / * |
|||
* ___'. .' /--.--\ `. .'___ * |
|||
* ."" '< `.___\_<|>_/___.' >' "". * |
|||
* | | : `- \`.;`\ _ /`;.`/ - ` : | | * |
|||
* \ \ `_. \_ __\ /__ _/ .-` / / * |
|||
* =====`-.____`.___ \_____/___.-`___.-'===== * |
|||
* `=---=' * |
|||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * |
|||
*********__佛祖保佑__永无BUG__验收通过__钞票多多__********* |
|||
*********************************************************/ |
|||
package com.wh.controller.shstorehouse; |
|||
|
|||
import cn.hutool.core.lang.Assert; |
|||
//import com.wh.feign.crm.ProjectInformationFeign;
|
|||
//import com.wh.feign.enterpriseinformation.WhEnterpriseInformationFeign;
|
|||
//import com.wh.feign.enterpriseinformation.WhEnterpriseInformationVo;
|
|||
import com.wh.pojo.Supplier; |
|||
import com.wh.pojo.shstorehouse.*; |
|||
import com.wh.pojo.shstorehouseattachment.ShStorehouseAttachmentDto; |
|||
import com.wh.service.initial.SupplierService; |
|||
import com.wh.service.shstorehouse.ShStorehouseService; |
|||
import com.wh.service.shstorehouseattachment.ShStorehouseAttachmentService; |
|||
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.ApiModelProperty; |
|||
import io.swagger.annotations.ApiOperation; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.beans.factory.annotation.Value; |
|||
import org.springframework.web.bind.annotation.*; |
|||
import org.springframework.web.multipart.MultipartFile; |
|||
|
|||
import javax.servlet.http.HttpServletRequest; |
|||
import java.io.File; |
|||
import java.util.List; |
|||
import java.util.UUID; |
|||
|
|||
/** |
|||
* Project: yxt_supervise(宇信通监管) <br/> |
|||
* File: ShStorehouseFeignFallback.java <br/> |
|||
* Class: com.wh.biz.shstorehouse.ShStorehouseRest <br/> |
|||
* Description: 库房信息表. <br/> |
|||
* Copyright: Copyright (c) 2011 <br/> |
|||
* Company: https://gitee.com/liuzp315 <br/>
|
|||
* Makedate: 2023-06-14 23:18:54 <br/> |
|||
* |
|||
* @author liupopo |
|||
* @version 1.0 |
|||
* @since 1.0 |
|||
*/ |
|||
@CrossOrigin |
|||
@Api(tags = "库房信息表") |
|||
@RestController("com.wh.biz.shstorehouse.ShStorehouseRest") |
|||
@RequestMapping("v1/shstorehouse") |
|||
public class ShStorehouseRest { |
|||
|
|||
@Autowired |
|||
private ShStorehouseService shStorehouseService; |
|||
@Autowired |
|||
private ShStorehouseAttachmentService shStorehouseAttachmentService; |
|||
// @Autowired
|
|||
// private WhEnterpriseInformationFeign whEnterpriseInformationFeign;
|
|||
// @Autowired
|
|||
// private ProjectInformationFeign projectInformationFeign;
|
|||
@Autowired |
|||
private SupplierService supplierService; |
|||
@ApiOperation("根据条件分页查询数据的列表") |
|||
@PostMapping("/listPage") |
|||
public ResultBean<PagerVo<ShStorehouseVo>> listPage(@RequestBody PagerQuery<ShStorehouseQuery> pq){ |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
PagerVo<ShStorehouseVo> pv = shStorehouseService.listPageVo(pq); |
|||
return rb.success().setData(pv); |
|||
} |
|||
// @ApiOperation("查询项目所有")
|
|||
// @GetMapping("/selectAllProject")
|
|||
// public ResultBean selectAllProject(){
|
|||
// ResultBean rb = ResultBean.fireFail();
|
|||
// ResultBean resultBean = projectInformationFeign.listAll();
|
|||
// return resultBean;
|
|||
// }
|
|||
@ApiOperation("查询所有可用仓库") |
|||
@PostMapping("/selectStoreHouse") |
|||
public ResultBean selectStoreHouse(@RequestBody List<String> List){ |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
List<ShStorehouseVo> list= shStorehouseService.selectStoreHouse(List); |
|||
return rb.success().setData(list); |
|||
} |
|||
|
|||
/** |
|||
* 根据仓库sid查询仓库信息 |
|||
* @return |
|||
*/ |
|||
@ApiOperation("根据仓库sid查询仓库信息") |
|||
@GetMapping("/selectStoreBySid") |
|||
public ResultBean<ShStorehouseVo> selectStoreBySid(@RequestParam("shSid")String shSid){ |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
ShStorehouseVo shStorehouseVo= shStorehouseService.selectStoreBySid(shSid); |
|||
return rb.success().setData(shStorehouseVo); |
|||
} |
|||
@ApiOperation("根据项目sid查询仓库") |
|||
@GetMapping("/getStorehouseBySid") |
|||
public ResultBean<List<ShStorehouseVo>> getStorehouseBySid(String sid){ |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
List<ShStorehouseVo> pv = shStorehouseService.getStorehouseBySid(sid); |
|||
return rb.success().setData(pv); |
|||
} |
|||
@ApiOperation("根据客户sid获取所有的仓库") |
|||
@GetMapping("/listAllBycusterSid") |
|||
public ResultBean<List<ShStorehouseVo>> listAllBycusterSid(@RequestParam("custerSid") String custerSid){ |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
List<ShStorehouseVo> pv = shStorehouseService.listAllBycusterSid(custerSid); |
|||
return rb.success().setData(pv); |
|||
} |
|||
@ApiOperation("获取所有的仓库") |
|||
@GetMapping("/listAll") |
|||
public ResultBean<List<ShStorehouse>> listAll(){ |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
return rb.success().setData(shStorehouseService.list()); |
|||
} |
|||
@ApiOperation("新增或修改") |
|||
@PostMapping("/save") |
|||
public ResultBean save(@RequestBody ShStorehouseDto dto){ |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
shStorehouseService.saveOrUpdateDto(dto); |
|||
return rb.success(); |
|||
} |
|||
|
|||
@ApiOperation("根据sid批量删除") |
|||
@PostMapping("/delBySids") |
|||
public ResultBean delBySids(@RequestBody String[] sids){ |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
int i = shStorehouseService.delBySids(sids); |
|||
if(i==0){ |
|||
return rb; |
|||
} |
|||
return rb.success(); |
|||
} |
|||
|
|||
@ApiOperation("根据SID获取一条记录") |
|||
@GetMapping("/fetchDetailsBySid/{sid}") |
|||
public ResultBean<ShStorehouseDetailsVo> fetchDetailsBySid(@PathVariable("sid") String sid){ |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
ShStorehouseDetailsVo vo = shStorehouseService.fetchDetailsVoBySid(sid); |
|||
if(vo==null) |
|||
return rb.setMsg("没有查询到数据"); |
|||
return rb.success().setData(vo); |
|||
} |
|||
// @ApiOperation(value = "上传附件")
|
|||
// @ResponseBody
|
|||
// @PostMapping("/uploadFile")
|
|||
// public ResultBean updateHeadImage(@RequestParam("file")MultipartFile multipartFile) {
|
|||
// if (multipartFile.isEmpty()) {
|
|||
// return new ResultBean().fail().setMsg("上传附件不能为空");
|
|||
// }
|
|||
//
|
|||
// return shStorehouseService.updateFile(multipartFile);
|
|||
//
|
|||
// }
|
|||
@Value("${yuan.file.root.path}") |
|||
public String fileRootPath; |
|||
@ApiOperation("文件上传") |
|||
@PostMapping("/upload") |
|||
public ResultBean upload(@RequestParam("file") MultipartFile file, HttpServletRequest request) { |
|||
String filePath = ""; // 文件保存的位置
|
|||
String urlPath = "";// 文件web浏览路径
|
|||
Assert.isTrue(!file.isEmpty(), "文件为空"); |
|||
// 原始名 以 a.jpg为例
|
|||
String originalFilename = file.getOriginalFilename(); |
|||
// 获取后缀并拼接'/'用于分类,也可以用日期 例: suffix = "jpg/"
|
|||
String suffix = originalFilename.substring(originalFilename.lastIndexOf(".") + 1) + "/"; |
|||
// 加上时间戳生成新的文件名,防止重复 newFileName = "1595511980146a.jpg"
|
|||
String newFileName = System.currentTimeMillis() + originalFilename; |
|||
filePath = fileRootPath+ suffix + newFileName; |
|||
System.out.println(filePath); |
|||
try { |
|||
File file1 = new File(filePath); |
|||
if (!file1.exists()) file1.mkdirs(); // 要是目录不存在,创建一个
|
|||
file.transferTo(file1); // 保存起来
|
|||
//urlPath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + "/archive/" + suffix + newFileName;
|
|||
|
|||
urlPath = "http://jianguan.yyundong.com/warehouseapi/archive/" + suffix + newFileName; |
|||
} catch (Exception e) { |
|||
e.printStackTrace(); |
|||
} |
|||
return ResultBean.fireSuccess().setData(urlPath); |
|||
} |
|||
@ApiOperation("图片上传") |
|||
@PostMapping("/uploadPics") |
|||
public ResultBean uploadPics(@RequestParam("file") MultipartFile file, HttpServletRequest request) { |
|||
String filePath = ""; // 文件保存的位置
|
|||
String urlPath = "";// 文件web浏览路径
|
|||
Assert.isTrue(!file.isEmpty(), "文件为空"); |
|||
// 原始名 以 a.jpg为例
|
|||
String originalFilename = file.getOriginalFilename(); |
|||
// 获取后缀并拼接'/'用于分类,也可以用日期 例: suffix = "jpg/"
|
|||
String suffix = originalFilename.substring(originalFilename.lastIndexOf(".") + 1) + "/"; |
|||
// 加上时间戳生成新的文件名,防止重复 newFileName = "1595511980146a.jpg"
|
|||
String newFileName = System.currentTimeMillis() + originalFilename; |
|||
filePath = fileRootPath+ suffix + newFileName; |
|||
System.out.println(filePath); |
|||
ShStorehouseAttachmentDto dto=new ShStorehouseAttachmentDto(); |
|||
String s = UUID.randomUUID().toString(); |
|||
try { |
|||
File file1 = new File(filePath); |
|||
if (!file1.exists()) file1.mkdirs(); // 要是目录不存在,创建一个
|
|||
file.transferTo(file1); // 保存起来
|
|||
//urlPath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + "/archive/" + suffix + newFileName;
|
|||
urlPath = "http://jianguan.yyundong.com/warehouseapi/archive/" + suffix + newFileName; |
|||
|
|||
// dto.setStorehouseSid(); // 库房sid
|
|||
// dto.setStorehouseName(); // 库房名称
|
|||
dto.setFileName(newFileName); // 文件名称
|
|||
dto.setFileDesc(""); // 文件描述
|
|||
dto.setFileType(suffix); // 文件类型,Word,Excel,PDF或图片
|
|||
dto.setFileSuffix(suffix); // 文件后缀,如:png,jpg,xls,xlsx
|
|||
dto.setFilePath(filePath); // 文件在服务器的存放路径
|
|||
dto.setFileUrl(urlPath); // 文件获取的url地址
|
|||
dto.setSid(s); |
|||
shStorehouseAttachmentService.insertByDto(dto); |
|||
} catch (Exception e) { |
|||
e.printStackTrace(); |
|||
} |
|||
return ResultBean.fireSuccess().setData(dto); |
|||
} |
|||
@ApiOperation("获取所有的企业信息") |
|||
@GetMapping("/fetchEntList") |
|||
public ResultBean fetchDetailsBySid(){ |
|||
return ResultBean.fireSuccess().setData(supplierService.listAll()); |
|||
} |
|||
} |
@ -0,0 +1,96 @@ |
|||
/********************************************************* |
|||
********************************************************* |
|||
******************** ******************* |
|||
************* ************ |
|||
******* _oo0oo_ ******* |
|||
*** o8888888o *** |
|||
* 88" . "88 * |
|||
* (| -_- |) * |
|||
* 0\ = /0 * |
|||
* ___/`---'\___ * |
|||
* .' \\| |// '. *
|
|||
* / \\||| : |||// \ *
|
|||
* / _||||| -:- |||||- \ * |
|||
* | | \\\ - /// | | *
|
|||
* | \_| ''\---/'' |_/ | * |
|||
* \ .-\__ '-' ___/-. / * |
|||
* ___'. .' /--.--\ `. .'___ * |
|||
* ."" '< `.___\_<|>_/___.' >' "". * |
|||
* | | : `- \`.;`\ _ /`;.`/ - ` : | | * |
|||
* \ \ `_. \_ __\ /__ _/ .-` / / * |
|||
* =====`-.____`.___ \_____/___.-`___.-'===== * |
|||
* `=---=' * |
|||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * |
|||
*********__佛祖保佑__永无BUG__验收通过__钞票多多__********* |
|||
*********************************************************/ |
|||
package com.wh.controller.shstorehouseattachment; |
|||
|
|||
import com.wh.pojo.shstorehouseattachment.ShStorehouseAttachmentDetailsVo; |
|||
import com.wh.pojo.shstorehouseattachment.ShStorehouseAttachmentDto; |
|||
import com.wh.pojo.shstorehouseattachment.ShStorehouseAttachmentQuery; |
|||
import com.wh.pojo.shstorehouseattachment.ShStorehouseAttachmentVo; |
|||
import com.wh.service.shstorehouseattachment.ShStorehouseAttachmentService; |
|||
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: yxt_supervise(宇信通监管) <br/> |
|||
* File: ShStorehouseAttachmentFeignFallback.java <br/> |
|||
* Class: com.wh.biz.shstorehouseattachment.ShStorehouseAttachmentRest <br/> |
|||
* Description: 库房附件,如合同,图片等. <br/> |
|||
* Copyright: Copyright (c) 2011 <br/> |
|||
* Company: https://gitee.com/liuzp315 <br/>
|
|||
* Makedate: 2023-06-14 23:18:54 <br/> |
|||
* |
|||
* @author liupopo |
|||
* @version 1.0 |
|||
* @since 1.0 |
|||
*/ |
|||
@CrossOrigin |
|||
@Api(tags = "库房附件,如合同,图片等") |
|||
@RestController("com.wh.biz.shstorehouseattachment.ShStorehouseAttachmentRest") |
|||
@RequestMapping("v1/shstorehouseattachment") |
|||
public class ShStorehouseAttachmentRest { |
|||
|
|||
@Autowired |
|||
private ShStorehouseAttachmentService shStorehouseAttachmentService; |
|||
|
|||
@ApiOperation("根据条件分页查询数据的列表") |
|||
@PostMapping("/listPage") |
|||
public ResultBean<PagerVo<ShStorehouseAttachmentVo>> listPage(@RequestBody PagerQuery<ShStorehouseAttachmentQuery> pq){ |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
PagerVo<ShStorehouseAttachmentVo> pv = shStorehouseAttachmentService.listPageVo(pq); |
|||
return rb.success().setData(pv); |
|||
} |
|||
|
|||
@ApiOperation("新增或修改") |
|||
@PostMapping("/save") |
|||
public ResultBean save(@RequestBody ShStorehouseAttachmentDto dto){ |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
shStorehouseAttachmentService.saveOrUpdateDto(dto); |
|||
return rb.success(); |
|||
} |
|||
|
|||
@ApiOperation("根据sid批量删除") |
|||
@PostMapping("/delBySids") |
|||
public ResultBean delBySids(@RequestBody String[] sids){ |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
shStorehouseAttachmentService.delBySids(sids); |
|||
return rb.success(); |
|||
} |
|||
|
|||
@ApiOperation("根据SID获取一条记录") |
|||
@GetMapping("/fetchDetailsBySid/{sid}") |
|||
public ResultBean<ShStorehouseAttachmentDetailsVo> fetchDetailsBySid(@PathVariable("sid") String sid){ |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
ShStorehouseAttachmentDetailsVo vo = shStorehouseAttachmentService.fetchDetailsVoBySid(sid); |
|||
return rb.success().setData(vo); |
|||
} |
|||
} |
@ -0,0 +1,96 @@ |
|||
/********************************************************* |
|||
********************************************************* |
|||
******************** ******************* |
|||
************* ************ |
|||
******* _oo0oo_ ******* |
|||
*** o8888888o *** |
|||
* 88" . "88 * |
|||
* (| -_- |) * |
|||
* 0\ = /0 * |
|||
* ___/`---'\___ * |
|||
* .' \\| |// '. *
|
|||
* / \\||| : |||// \ *
|
|||
* / _||||| -:- |||||- \ * |
|||
* | | \\\ - /// | | *
|
|||
* | \_| ''\---/'' |_/ | * |
|||
* \ .-\__ '-' ___/-. / * |
|||
* ___'. .' /--.--\ `. .'___ * |
|||
* ."" '< `.___\_<|>_/___.' >' "". * |
|||
* | | : `- \`.;`\ _ /`;.`/ - ` : | | * |
|||
* \ \ `_. \_ __\ /__ _/ .-` / / * |
|||
* =====`-.____`.___ \_____/___.-`___.-'===== * |
|||
* `=---=' * |
|||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * |
|||
*********__佛祖保佑__永无BUG__验收通过__钞票多多__********* |
|||
*********************************************************/ |
|||
package com.wh.controller.shstorehouseattribute; |
|||
|
|||
import com.wh.pojo.shstorehouseattribute.ShStorehouseAttributeDetailsVo; |
|||
import com.wh.pojo.shstorehouseattribute.ShStorehouseAttributeDto; |
|||
import com.wh.pojo.shstorehouseattribute.ShStorehouseAttributeQuery; |
|||
import com.wh.pojo.shstorehouseattribute.ShStorehouseAttributeVo; |
|||
import com.wh.service.shstorehouseattribute.ShStorehouseAttributeService; |
|||
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: yxt_supervise(宇信通监管) <br/> |
|||
* File: ShStorehouseAttributeFeignFallback.java <br/> |
|||
* Class: com.wh.biz.shstorehouseattribute.ShStorehouseAttributeRest <br/> |
|||
* Description: 库房性质. <br/> |
|||
* Copyright: Copyright (c) 2011 <br/> |
|||
* Company: https://gitee.com/liuzp315 <br/>
|
|||
* Makedate: 2023-06-14 23:18:54 <br/> |
|||
* |
|||
* @author liupopo |
|||
* @version 1.0 |
|||
* @since 1.0 |
|||
*/ |
|||
@CrossOrigin |
|||
@Api(tags = "库房性质") |
|||
@RestController("com.wh.biz.shstorehouseattribute.ShStorehouseAttributeRest") |
|||
@RequestMapping("v1/shstorehouseattribute") |
|||
public class ShStorehouseAttributeRest { |
|||
|
|||
@Autowired |
|||
private ShStorehouseAttributeService shStorehouseAttributeService; |
|||
|
|||
@ApiOperation("根据条件分页查询数据的列表") |
|||
@PostMapping("/listPage") |
|||
public ResultBean<PagerVo<ShStorehouseAttributeVo>> listPage(@RequestBody PagerQuery<ShStorehouseAttributeQuery> pq){ |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
PagerVo<ShStorehouseAttributeVo> pv = shStorehouseAttributeService.listPageVo(pq); |
|||
return rb.success().setData(pv); |
|||
} |
|||
|
|||
@ApiOperation("新增或修改") |
|||
@PostMapping("/save") |
|||
public ResultBean save(@RequestBody ShStorehouseAttributeDto dto){ |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
shStorehouseAttributeService.saveOrUpdateDto(dto); |
|||
return rb.success(); |
|||
} |
|||
|
|||
@ApiOperation("根据sid批量删除") |
|||
@PostMapping("/delBySids") |
|||
public ResultBean delBySids(@RequestBody String[] sids){ |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
shStorehouseAttributeService.delBySids(sids); |
|||
return rb.success(); |
|||
} |
|||
|
|||
@ApiOperation("根据SID获取一条记录") |
|||
@GetMapping("/fetchDetailsBySid/{sid}") |
|||
public ResultBean<ShStorehouseAttributeDetailsVo> fetchDetailsBySid(@PathVariable("sid") String sid){ |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
ShStorehouseAttributeDetailsVo vo = shStorehouseAttributeService.fetchDetailsVoBySid(sid); |
|||
return rb.success().setData(vo); |
|||
} |
|||
} |
@ -0,0 +1,26 @@ |
|||
package com.wh.controller.stock; |
|||
|
|||
|
|||
import com.wh.service.stock.StockService; |
|||
import com.wh.vo.PageResult; |
|||
import com.wh.vo.SysResult; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.CrossOrigin; |
|||
import org.springframework.web.bind.annotation.GetMapping; |
|||
import org.springframework.web.bind.annotation.RequestMapping; |
|||
import org.springframework.web.bind.annotation.RestController; |
|||
|
|||
@RestController |
|||
@CrossOrigin |
|||
@RequestMapping("/stock/") |
|||
public class StockController { |
|||
|
|||
@Autowired |
|||
private StockService stockService; |
|||
|
|||
@GetMapping("list") |
|||
public SysResult getStockList(PageResult pageResult){ |
|||
pageResult = stockService.getStockList(pageResult); |
|||
return SysResult.success(pageResult); |
|||
} |
|||
} |
@ -0,0 +1,54 @@ |
|||
package com.wh.controller.storehousemanage; |
|||
|
|||
|
|||
import com.wh.pojo.InStorehouse; |
|||
import com.wh.service.instorehouse.PutInService; |
|||
import com.wh.vo.PageResult; |
|||
import com.wh.vo.SysResult; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import java.util.Map; |
|||
|
|||
@RestController |
|||
@CrossOrigin |
|||
@RequestMapping("/putIn/") |
|||
public class PutInController { |
|||
|
|||
@Autowired |
|||
private PutInService putInService; |
|||
|
|||
@GetMapping("getQuery") |
|||
public SysResult getQuery(InStorehouse inStorehouse){ |
|||
Map<String,Object> map = putInService.getQuery(inStorehouse); |
|||
return SysResult.success(map); |
|||
} |
|||
|
|||
@PostMapping("addInStorehouse") |
|||
public SysResult addInStorehouse(@RequestBody InStorehouse inStorehouse){ |
|||
String data = putInService.addInStorehouse(inStorehouse); |
|||
return SysResult.success(data); |
|||
} |
|||
|
|||
@GetMapping("list") |
|||
public SysResult getInStorehouseList(PageResult pageResult){ |
|||
pageResult = putInService.getInStorehouseList(pageResult); |
|||
return SysResult.success(pageResult); |
|||
} |
|||
|
|||
@PutMapping("updataInStorehouse") |
|||
public SysResult updataInStorehouse(@RequestBody InStorehouse inStorehouse){ |
|||
// System.out.println(inStorehouse);
|
|||
putInService.updataInStorehouse(inStorehouse); |
|||
return SysResult.success(); |
|||
} |
|||
|
|||
@DeleteMapping("deleteInStorehouse/{inStorehouseId}/{receivingId}") |
|||
public SysResult deleteInStorehouse(@PathVariable String inStorehouseId,@PathVariable String receivingId){ |
|||
String data = putInService.deleteInStorehouse(inStorehouseId,receivingId); |
|||
return SysResult.success(data); |
|||
} |
|||
|
|||
|
|||
|
|||
} |
@ -0,0 +1,44 @@ |
|||
package com.wh.controller.storehousemanage; |
|||
|
|||
import com.wh.pojo.Remove; |
|||
import com.wh.service.storehousemanage.RemoveService; |
|||
import com.wh.vo.PageResult; |
|||
import com.wh.vo.SysResult; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.data.domain.Page; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import java.util.Map; |
|||
|
|||
@RestController |
|||
@CrossOrigin |
|||
@RequestMapping("/remove/") |
|||
public class RemoveController { |
|||
|
|||
@Autowired |
|||
private RemoveService removeService; |
|||
|
|||
@GetMapping("getQuery") |
|||
public SysResult getQuery(Remove remove){ |
|||
Map<String,Object> map = removeService.getQuery(remove); |
|||
return SysResult.success(map); |
|||
} |
|||
|
|||
@PostMapping("addRemove") |
|||
public SysResult addRemove(@RequestBody Remove remove){ |
|||
removeService.addRemove(remove); |
|||
return SysResult.success(); |
|||
} |
|||
|
|||
@GetMapping("list") |
|||
public SysResult getRemoveList(PageResult pageResult){ |
|||
pageResult = removeService.getRemoveList(pageResult); |
|||
return SysResult.success(pageResult); |
|||
} |
|||
|
|||
@PutMapping("updata") |
|||
public SysResult updataRemove(@RequestBody Remove remove){ |
|||
removeService.updataRemove(remove); |
|||
return SysResult.success(); |
|||
} |
|||
} |
@ -0,0 +1,57 @@ |
|||
package com.wh.controller.storehousemanage; |
|||
|
|||
import com.wh.pojo.OnShelves; |
|||
import com.wh.service.storehousemanage.ShelvesService; |
|||
import com.wh.vo.PageResult; |
|||
import com.wh.vo.QueryInfo; |
|||
import com.wh.vo.SysResult; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import java.util.Map; |
|||
|
|||
@RestController |
|||
@CrossOrigin |
|||
@RequestMapping("/shelves/") |
|||
public class ShelvesController { |
|||
|
|||
@Autowired |
|||
private ShelvesService shelvesService; |
|||
|
|||
@GetMapping("getQuery") |
|||
public SysResult getQuery(QueryInfo queryInfo){ |
|||
Map<String,Object> map = shelvesService.getQuery(queryInfo); |
|||
if (map.size()==0){ |
|||
return SysResult.notEnough(); |
|||
}else { |
|||
return SysResult.success(map); |
|||
} |
|||
} |
|||
|
|||
@PostMapping("add") |
|||
public SysResult addShelves(@RequestBody OnShelves onShelves){ |
|||
// System.out.println(onShelves);
|
|||
shelvesService.addShelves(onShelves); |
|||
return SysResult.success(); |
|||
} |
|||
|
|||
@GetMapping("getShelves") |
|||
public SysResult getShelves(PageResult pageResult){ |
|||
pageResult = shelvesService.getShelves(pageResult); |
|||
return SysResult.success(pageResult); |
|||
} |
|||
|
|||
@DeleteMapping("deleteShelves/{id}") |
|||
public SysResult deleteShelves(@PathVariable String id){ |
|||
shelvesService.deleteShelves(id); |
|||
return SysResult.success(); |
|||
} |
|||
|
|||
@PutMapping("updataShelves") |
|||
public SysResult updataShelves(@RequestBody OnShelves onShelves) throws Exception { |
|||
System.out.println(onShelves); |
|||
shelvesService.updataShelves(onShelves); |
|||
return SysResult.success(); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,35 @@ |
|||
package com.wh.controller.storehouseproject; |
|||
|
|||
import com.wh.pojo.shstorehouse.ShStorehouseDto; |
|||
import com.wh.pojo.storehouseproject.StoreHouseProjectDto; |
|||
import com.wh.service.storehouseproject.StoreHouseProjectService; |
|||
import com.yxt.common.core.result.ResultBean; |
|||
import io.swagger.annotations.Api; |
|||
import io.swagger.annotations.ApiOperation; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
/** |
|||
* @author wangpengfei |
|||
* @date 2023/7/19 15:31 |
|||
*/ |
|||
@CrossOrigin |
|||
@Api(tags = "库房信息表") |
|||
@RestController("com.wh.biz.storehouseproject.StoreHouseProjectRest") |
|||
@RequestMapping("v1/storehouseproject") |
|||
public class StoreHouseProjectRest { |
|||
|
|||
@Autowired |
|||
StoreHouseProjectService storeHouseProjectService; |
|||
|
|||
|
|||
|
|||
//
|
|||
@ApiOperation("新增或修改") |
|||
@PostMapping("/saveOrUpdateDto") |
|||
public ResultBean saveOrUpdateDto(@RequestBody StoreHouseProjectDto dto){ |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
storeHouseProjectService.saveOrUpdateDto(dto); |
|||
return rb.success(); |
|||
} |
|||
} |
@ -0,0 +1,198 @@ |
|||
package com.wh.controller.sysuser; |
|||
|
|||
import cn.hutool.core.bean.BeanUtil; |
|||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
|||
import com.wh.pojo.sysuser.*; |
|||
import com.wh.service.sysuser.SysUserService; |
|||
import com.yxt.common.base.config.RedisUtil; |
|||
import com.yxt.common.base.config.component.FileUploadComponent; |
|||
import com.yxt.common.base.utils.Encodes; |
|||
import com.yxt.common.core.query.PagerQuery; |
|||
import com.yxt.common.core.result.FileUploadResult; |
|||
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.apache.commons.lang3.StringUtils; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.*; |
|||
import org.springframework.web.multipart.MultipartFile; |
|||
|
|||
import javax.servlet.http.HttpServletRequest; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
import java.util.UUID; |
|||
|
|||
/** |
|||
* Project: anrui_portal(门户建设) <br/> |
|||
* File: SysUserFeignFallback.java <br/> |
|||
* Class: SysUserRest <br/> |
|||
* Description: 用户表. <br/> |
|||
* Copyright: Copyright (c) 2011 <br/> |
|||
* Company: https://gitee.com/liuzp315 <br/>
|
|||
* Makedate: 2021-08-03 00:24:30 <br/> |
|||
* |
|||
* @author liupopo |
|||
* @version 1.0 |
|||
* @since 1.0 |
|||
*/ |
|||
@Api(tags = "用户表") |
|||
@RestController |
|||
@RequestMapping("v1/sysuser") |
|||
public class SysUserRest { |
|||
@Autowired |
|||
private RedisUtil redisUtil; |
|||
@Autowired |
|||
private SysUserService sysUserService; |
|||
@Autowired |
|||
private FileUploadComponent fileUploadComponent; |
|||
// 定义点选文字图片验证码允许的误差值
|
|||
private static final int ERROR_AMOUNT = 50;// 定义允许的误差值,单位是px
|
|||
@ApiOperation("根据条件分页查询数据的列表 ") |
|||
@PostMapping("/listPage") |
|||
public ResultBean<PagerVo<SysUserVo>> listPage(@RequestBody PagerQuery<SysUserQuery> pq) { |
|||
ResultBean rb = ResultBean.fireFail();//roleSid
|
|||
PagerVo<SysUserVo> pv = sysUserService.listPageVo(pq); |
|||
return rb.success().setData(pv); |
|||
} |
|||
@ApiOperation("根据条件查询所有数据列表") |
|||
@PostMapping("/listAll") |
|||
public ResultBean<List<SysUserVo>> listAll(@RequestBody SysUserQuery query) { |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
List<SysUserVo> list = sysUserService.listAllVo(query); |
|||
return rb.success().setData(list); |
|||
} |
|||
@ApiOperation("所有数据列表") |
|||
@GetMapping("/list") |
|||
public ResultBean<List<SysUserVo>> list() { |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
List<SysUserVo> list = sysUserService.listVo(); |
|||
return rb.success().setData(list); |
|||
} |
|||
|
|||
@PostMapping("/saveOpenId") |
|||
public ResultBean saveOpenId(@RequestBody SysUserDto dto){ |
|||
ResultBean rb=new ResultBean(); |
|||
SysUser sysUser=sysUserService.getOne(new QueryWrapper<SysUser>().eq("sid",dto.getSid())); |
|||
sysUser.setOpenId(dto.getOpenid()); |
|||
sysUserService.update(sysUser,new QueryWrapper<SysUser>().eq("sid",dto.getSid())); |
|||
return rb.success().setMsg("保存成功"); |
|||
} |
|||
@PostMapping("/saveBank") |
|||
public ResultBean saveBank(@RequestBody SysUserDto dto) { |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
//手机号
|
|||
String mobile = dto.getMobile(); |
|||
//姓名
|
|||
String name = dto.getName(); |
|||
//用户类型
|
|||
int userType = dto.getUserType(); |
|||
//部门sid
|
|||
if (StringUtils.isBlank(mobile)) { |
|||
return new ResultBean<SysUserVo>().fail().setMsg("手机号不能为空"); |
|||
} else { |
|||
SysUser one = sysUserService.fetchByUserName(mobile); |
|||
if (null != one) { |
|||
return new ResultBean<SysUserVo>().fail().setMsg("手机号重复!`"); |
|||
} |
|||
} |
|||
if (StringUtils.isBlank(name)) { |
|||
return new ResultBean<SysUserVo>().fail().setMsg("姓名不能为空"); |
|||
} |
|||
if (userType == 0) { |
|||
return new ResultBean<SysUserVo>().fail().setMsg("用户类型不能为空"); |
|||
} |
|||
String password = mobile.substring(5, 11); |
|||
String md5 = Encodes.md5(password); |
|||
SysUser su = new SysUser(); |
|||
dto.fillEntity(su); |
|||
su.setSid(UUID.randomUUID().toString()); |
|||
su.setStaffSid(dto.getBankMessageSid()); |
|||
su.setUserName(mobile); |
|||
su.setPassword(md5); |
|||
sysUserService.save(su); |
|||
return rb.success(); |
|||
} |
|||
|
|||
@GetMapping("/getUserBySid") |
|||
public ResultBean<SysUser> getUserBySid(@RequestParam("sid")String sid) { |
|||
SysUser sysUser = sysUserService.getUserBySid(sid); |
|||
return new ResultBean().success().setData(sysUser); |
|||
} |
|||
|
|||
@PostMapping("/login") |
|||
@ResponseBody |
|||
@ApiOperation(value = "3、登录") |
|||
@ApiOperationSupport(order = 30) |
|||
public ResultBean<SysUserVo> login(@RequestBody SysUserQuery userQuery) { |
|||
String userName = userQuery.getUserName(); |
|||
String password = userQuery.getPassword(); |
|||
// 遍历其中的map,取出每个属性值
|
|||
if (StringUtils.isBlank(userName)) { |
|||
return new ResultBean<SysUserVo>().fail().setMsg("用户名不能为空"); |
|||
} |
|||
if (StringUtils.isBlank(password)) { |
|||
return new ResultBean<SysUserVo>().fail().setMsg("密码不能为空"); |
|||
} |
|||
SysUser user = null; |
|||
// 验证通过之后删除redis上的验证过的该条uuid
|
|||
String md5 = Encodes.md5(password); |
|||
user = sysUserService.selectByUserNameAndPassword(userName,md5); |
|||
if (user == null) { |
|||
return new ResultBean<SysUserVo>().fail().setMsg("用户名或密码错误"); |
|||
} |
|||
// 根据用户信息查询用户的角色信息
|
|||
SysUserVo userInfoOneVo = new SysUserVo();//sysUserService.setUserRedisSessionToken(user);
|
|||
BeanUtil.copyProperties(user,userInfoOneVo); |
|||
return new ResultBean<SysUserVo>().success().setData(userInfoOneVo); |
|||
} |
|||
|
|||
/** |
|||
* 退出登录 |
|||
* |
|||
* @return |
|||
*/ |
|||
@PostMapping("/signOut") |
|||
@ResponseBody |
|||
@ApiOperation(value = "退出登录") |
|||
@ApiOperationSupport(order = 30) |
|||
public ResultBean signOut(HttpServletRequest httpServletRequest) { |
|||
String token = httpServletRequest.getHeader("token"); |
|||
String redisToken = redisUtil.get(token); |
|||
if (StringUtils.isBlank(redisToken)) { |
|||
return ResultBean.fireSuccess().setMsg("您已退出,请刷新"); |
|||
} |
|||
redisUtil.remove(token); |
|||
return ResultBean.fireSuccess().setMsg("退出成功"); |
|||
} |
|||
|
|||
|
|||
@GetMapping("getUserByType") |
|||
public ResultBean getUserByType(@RequestParam("userType") String userType){ |
|||
return sysUserService.getUserByType(userType); |
|||
} |
|||
@GetMapping("getUserOrgBySid") |
|||
public ResultBean getUserOrgBySid(@RequestParam("sid") String sid){ |
|||
return sysUserService.getUserOrgBySid(sid); |
|||
} |
|||
|
|||
@PostMapping("/uploadfile") |
|||
public ResultBean<FileUploadResult> uploadImage(@RequestParam(value = "file") MultipartFile file) { |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
if (file == null || file.isEmpty()) { |
|||
return rb.setMsg("文件为空"); |
|||
} |
|||
rb = fileUploadComponent.uploadFile(file, null); |
|||
return rb; |
|||
} |
|||
|
|||
@PostMapping("/uploadImage") |
|||
public ResultBean updateSysUserImage(@RequestBody Map<String, String> map){ |
|||
return sysUserService.updateSysUserImage(map); |
|||
} |
|||
@PostMapping("/getUsersBySid") |
|||
public ResultBean<List<SysUser>> getUsersBySid(@RequestBody List<String> list){ |
|||
return sysUserService.getUsersBySid(list); |
|||
} |
|||
} |
@ -0,0 +1,7 @@ |
|||
package com.wh.mapper; |
|||
|
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
import com.wh.pojo.Rights; |
|||
|
|||
public interface RightsMapper extends BaseMapper<Rights> { |
|||
} |
@ -0,0 +1,7 @@ |
|||
package com.wh.mapper; |
|||
|
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
import com.wh.pojo.User; |
|||
|
|||
public interface UserMapper extends BaseMapper<User> { |
|||
} |
@ -0,0 +1,9 @@ |
|||
package com.wh.mapper.api.instorehouse; |
|||
|
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
import com.wh.pojo.api.InStorehouseListing; |
|||
import com.wh.pojo.api.InStorehouseMain; |
|||
|
|||
|
|||
public interface InStorehouseListingMapper extends BaseMapper<InStorehouseListing> { |
|||
} |
@ -0,0 +1,19 @@ |
|||
package com.wh.mapper.api.instorehouse; |
|||
|
|||
import com.baomidou.mybatisplus.core.conditions.Wrapper; |
|||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|||
import com.baomidou.mybatisplus.core.toolkit.Constants; |
|||
import com.wh.pojo.InStorehouse; |
|||
import com.wh.pojo.api.InStoreHouseMainVo; |
|||
import com.wh.pojo.api.InStorehouseMain; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
import org.apache.ibatis.annotations.Param; |
|||
|
|||
@Mapper |
|||
public interface InStorehouseMainMapper extends BaseMapper<InStorehouseMain> { |
|||
IPage<InStoreHouseMainVo> selectPageVo(IPage<InStoreHouseMainVo> page, |
|||
@Param(Constants.WRAPPER) Wrapper<InStoreHouseMainVo> qw); |
|||
|
|||
} |
@ -0,0 +1,13 @@ |
|||
package com.wh.mapper.api.outstorehouse; |
|||
|
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
import com.wh.pojo.api.InStorehouseListing; |
|||
import com.wh.pojo.api.OutStorehouseListing; |
|||
import org.apache.ibatis.annotations.Delete; |
|||
import org.apache.ibatis.annotations.Param; |
|||
|
|||
|
|||
public interface OutStorehouseListingMapper extends BaseMapper<OutStorehouseListing> { |
|||
@Delete("delete from out_storehouse_listing where main_sid=#{mainSid}") |
|||
int deleteByMainSid(@Param("mainSid") String sid); |
|||
} |
@ -0,0 +1,23 @@ |
|||
package com.wh.mapper.api.outstorehouse; |
|||
|
|||
import com.baomidou.mybatisplus.core.conditions.Wrapper; |
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|||
import com.baomidou.mybatisplus.core.toolkit.Constants; |
|||
import com.wh.pojo.api.InStoreHouseMainVo; |
|||
import com.wh.pojo.api.InStorehouseMain; |
|||
import com.wh.pojo.api.OutStorehouseMain; |
|||
import com.wh.pojo.api.OutStorehouseVo; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
import org.apache.ibatis.annotations.Param; |
|||
import org.apache.ibatis.annotations.Select; |
|||
|
|||
import java.util.List; |
|||
|
|||
@Mapper |
|||
public interface OutStorehouseMainMapper extends BaseMapper<OutStorehouseMain> { |
|||
IPage<OutStorehouseVo> selectPageVo(IPage<OutStorehouseVo> page, |
|||
@Param(Constants.WRAPPER) Wrapper<OutStorehouseVo> qw); |
|||
@Select("select * from out_storehouse_main where state=1 and custer_sid=#{custerSid};") |
|||
List<OutStorehouseMain> listAllForPicking(@Param("custerSid")String custerSid); |
|||
} |
@ -0,0 +1,22 @@ |
|||
package com.wh.mapper.api.prodstock; |
|||
|
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
import com.wh.pojo.api.InStorehouseMain; |
|||
import com.wh.pojo.api.ProdStock; |
|||
import org.apache.ibatis.annotations.Param; |
|||
import org.apache.ibatis.annotations.Update; |
|||
|
|||
|
|||
public interface ProdStockMapper extends BaseMapper<ProdStock> { |
|||
@Update("update prod_stock set num=num-#{num} , calculated_value=(num*confirmed_price) where pro_sid=#{proSid} and custer_sid=#{custerSid}") |
|||
void reduceNumByProdSidAndCustSid(@Param("proSid") String proSid, @Param("custerSid")String custerSid, |
|||
@Param("num")String num); |
|||
@Update("update prod_stock set num=num+#{num}, calculated_value=(num*confirmed_price) " + |
|||
" where pro_sid=#{proSid} and custer_sid=#{custerSid} and store_house_sid=#{storehousesid}" + |
|||
" and location_number=#{locationnum}") |
|||
void addNumByProdSidAndCustSid(@Param("proSid")String proSid, @Param("custerSid")String custerSid, |
|||
@Param("num")String num, @Param("storehousesid")String storehousesid, |
|||
@Param("locationnum")String locationnum); |
|||
@Update("update prod_stock set num=#{num} , calculated_value=#{value} where id=#{id} ") |
|||
void updateByProdStockId(@Param("num")String num, @Param("value")String value, @Param("id")int id); |
|||
} |
@ -0,0 +1,69 @@ |
|||
/********************************************************* |
|||
********************************************************* |
|||
******************** ******************* |
|||
************* ************ |
|||
******* _oo0oo_ ******* |
|||
*** o8888888o *** |
|||
* 88" . "88 * |
|||
* (| -_- |) * |
|||
* 0\ = /0 * |
|||
* ___/`---'\___ * |
|||
* .' \\| |// '. *
|
|||
* / \\||| : |||// \ *
|
|||
* / _||||| -:- |||||- \ * |
|||
* | | \\\ - /// | | *
|
|||
* | \_| ''\---/'' |_/ | * |
|||
* \ .-\__ '-' ___/-. / * |
|||
* ___'. .' /--.--\ `. .'___ * |
|||
* ."" '< `.___\_<|>_/___.' >' "". * |
|||
* | | : `- \`.;`\ _ /`;.`/ - ` : | | * |
|||
* \ \ `_. \_ __\ /__ _/ .-` / / * |
|||
* =====`-.____`.___ \_____/___.-`___.-'===== * |
|||
* `=---=' * |
|||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * |
|||
*********__佛祖保佑__永无BUG__验收通过__钞票多多__********* |
|||
*********************************************************/ |
|||
package com.wh.mapper.brandinfo; |
|||
|
|||
import com.baomidou.mybatisplus.core.conditions.Wrapper; |
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|||
import com.baomidou.mybatisplus.core.toolkit.Constants; |
|||
import com.wh.pojo.brandinfo.BrandInfo; |
|||
import com.wh.pojo.brandinfo.BrandInfoVo; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
import org.apache.ibatis.annotations.Param; |
|||
import org.apache.ibatis.annotations.Select; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* Project: yxt_supervise(宇信通监管) <br/> |
|||
* File: BrandInfoMapper.java <br/> |
|||
* Class: com.supervise.biz.brandinfo.BrandInfoMapper <br/> |
|||
* Description: 品牌信息. <br/> |
|||
* Copyright: Copyright (c) 2011 <br/> |
|||
* Company: https://gitee.com/liuzp315 <br/>
|
|||
* Makedate: 2022-11-11 11:40:28 <br/> |
|||
* |
|||
* @author dongjianzhao |
|||
* @version 1.0 |
|||
* @since 1.0 |
|||
*/ |
|||
@Mapper |
|||
public interface BrandInfoMapper extends BaseMapper<BrandInfo> { |
|||
|
|||
//@Update("update brand_info set name=#{msg} where id=#{id}")
|
|||
//IPage<BrandInfoVo> voPage(IPage<BrandInfo> page, @Param(Constants.WRAPPER) QueryWrapper<BrandInfo> qw);
|
|||
|
|||
IPage<BrandInfoVo> selectPageVo(IPage<BrandInfo> page, @Param(Constants.WRAPPER) Wrapper<BrandInfo> qw); |
|||
|
|||
List<BrandInfoVo> selectListAllVo(@Param(Constants.WRAPPER) Wrapper<BrandInfo> qw); |
|||
|
|||
@Select("select * from brand_info") |
|||
List<BrandInfoVo> selectListVo(); |
|||
@Select("select * from brand_info where code=#{code}") |
|||
BrandInfoVo selectByCode(String code); |
|||
@Select("select name,code from restricted_brand where code=#{code} group by name") |
|||
BrandInfo fetchByCodeForLimit(String brandSid); |
|||
} |
@ -0,0 +1,73 @@ |
|||
/********************************************************* |
|||
********************************************************* |
|||
******************** ******************* |
|||
************* ************ |
|||
******* _oo0oo_ ******* |
|||
*** o8888888o *** |
|||
* 88" . "88 * |
|||
* (| -_- |) * |
|||
* 0\ = /0 * |
|||
* ___/`---'\___ * |
|||
* .' \\| |// '. *
|
|||
* / \\||| : |||// \ *
|
|||
* / _||||| -:- |||||- \ * |
|||
* | | \\\ - /// | | *
|
|||
* | \_| ''\---/'' |_/ | * |
|||
* \ .-\__ '-' ___/-. / * |
|||
* ___'. .' /--.--\ `. .'___ * |
|||
* ."" '< `.___\_<|>_/___.' >' "". * |
|||
* | | : `- \`.;`\ _ /`;.`/ - ` : | | * |
|||
* \ \ `_. \_ __\ /__ _/ .-` / / * |
|||
* =====`-.____`.___ \_____/___.-`___.-'===== * |
|||
* `=---=' * |
|||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * |
|||
*********__佛祖保佑__永无BUG__验收通过__钞票多多__********* |
|||
*********************************************************/ |
|||
package com.wh.mapper.dictcommon; |
|||
|
|||
import com.baomidou.mybatisplus.core.conditions.Wrapper; |
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|||
import com.baomidou.mybatisplus.core.toolkit.Constants; |
|||
import com.wh.pojo.dictcommon.DictCommon; |
|||
import com.wh.pojo.dictcommon.DictCommonDetailsVo; |
|||
import com.wh.pojo.dictcommon.DictCommonVo; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
import org.apache.ibatis.annotations.Param; |
|||
import org.apache.ibatis.annotations.Select; |
|||
|
|||
import java.util.List; |
|||
|
|||
|
|||
/** |
|||
* Project: yxt_supervise(宇信通监管) <br/> |
|||
* File: DictCommonMapper.java <br/> |
|||
* Class: com.supervise.biz.dictcommon.DictCommonMapper <br/> |
|||
* Description: 数据字典——数据项. <br/> |
|||
* Copyright: Copyright (c) 2011 <br/> |
|||
* Company: https://gitee.com/liuzp315 <br/>
|
|||
* Makedate: 2022-11-11 11:40:29 <br/> |
|||
* |
|||
* @author dongjianzhao |
|||
* @version 1.0 |
|||
* @since 1.0 |
|||
*/ |
|||
@Mapper |
|||
public interface DictCommonMapper extends BaseMapper<DictCommon> { |
|||
|
|||
//@Update("update dict_common set name=#{msg} where id=#{id}")
|
|||
//IPage<DictCommonVo> voPage(IPage<DictCommon> page, @Param(Constants.WRAPPER) QueryWrapper<DictCommon> qw);
|
|||
|
|||
IPage<DictCommonVo> selectPageVo(IPage<DictCommon> page, @Param(Constants.WRAPPER) Wrapper<DictCommon> qw); |
|||
|
|||
List<DictCommonVo> selectListAllVo(@Param(Constants.WRAPPER) Wrapper<DictCommon> qw); |
|||
|
|||
@Select("select * from dict_common") |
|||
List<DictCommonVo> selectListVo(); |
|||
@Select("select * from dict_common where dictkey=#{key}") |
|||
DictCommonDetailsVo fetchByKey(@Param("key")String key); |
|||
@Select("select * from dict_common where dictkey=#{key} and dictType=#{type}") |
|||
DictCommonDetailsVo fetchByKeyAndType(@Param("key")String key, @Param("type")String type); |
|||
@Select("select * from restricted_category where dictkey=#{key} and dictType=#{type}") |
|||
DictCommonDetailsVo fetchByKeyAndTypeForLimit(@Param("type")String category, @Param("key")String categoryKey); |
|||
} |
@ -0,0 +1,65 @@ |
|||
/********************************************************* |
|||
********************************************************* |
|||
******************** ******************* |
|||
************* ************ |
|||
******* _oo0oo_ ******* |
|||
*** o8888888o *** |
|||
* 88" . "88 * |
|||
* (| -_- |) * |
|||
* 0\ = /0 * |
|||
* ___/`---'\___ * |
|||
* .' \\| |// '. *
|
|||
* / \\||| : |||// \ *
|
|||
* / _||||| -:- |||||- \ * |
|||
* | | \\\ - /// | | *
|
|||
* | \_| ''\---/'' |_/ | * |
|||
* \ .-\__ '-' ___/-. / * |
|||
* ___'. .' /--.--\ `. .'___ * |
|||
* ."" '< `.___\_<|>_/___.' >' "". * |
|||
* | | : `- \`.;`\ _ /`;.`/ - ` : | | * |
|||
* \ \ `_. \_ __\ /__ _/ .-` / / * |
|||
* =====`-.____`.___ \_____/___.-`___.-'===== * |
|||
* `=---=' * |
|||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * |
|||
*********__佛祖保佑__永无BUG__验收通过__钞票多多__********* |
|||
*********************************************************/ |
|||
package com.wh.mapper.dicttype; |
|||
|
|||
import com.baomidou.mybatisplus.core.conditions.Wrapper; |
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|||
import com.baomidou.mybatisplus.core.toolkit.Constants; |
|||
import com.wh.pojo.dicttype.DictType; |
|||
import com.wh.pojo.dicttype.DictTypeVo; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
import org.apache.ibatis.annotations.Param; |
|||
import org.apache.ibatis.annotations.Select; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* Project: yxt_supervise(宇信通监管) <br/> |
|||
* File: DictTypeMapper.java <br/> |
|||
* Class: com.supervise.biz.dicttype.DictTypeMapper <br/> |
|||
* Description: 数据字典——数据类型. <br/> |
|||
* Copyright: Copyright (c) 2011 <br/> |
|||
* Company: https://gitee.com/liuzp315 <br/>
|
|||
* Makedate: 2022-11-11 11:40:29 <br/> |
|||
* |
|||
* @author dongjianzhao |
|||
* @version 1.0 |
|||
* @since 1.0 |
|||
*/ |
|||
@Mapper |
|||
public interface DictTypeMapper extends BaseMapper<DictType> { |
|||
|
|||
//@Update("update dict_type set name=#{msg} where id=#{id}")
|
|||
//IPage<DictTypeVo> voPage(IPage<DictType> page, @Param(Constants.WRAPPER) QueryWrapper<DictType> qw);
|
|||
|
|||
IPage<DictTypeVo> selectPageVo(IPage<DictType> page, @Param(Constants.WRAPPER) Wrapper<DictType> qw); |
|||
|
|||
List<DictTypeVo> selectListAllVo(@Param(Constants.WRAPPER) Wrapper<DictType> qw); |
|||
|
|||
@Select("select * from dict_type") |
|||
List<DictTypeVo> selectListVo(); |
|||
} |
@ -0,0 +1,65 @@ |
|||
/********************************************************* |
|||
********************************************************* |
|||
******************** ******************* |
|||
************* ************ |
|||
******* _oo0oo_ ******* |
|||
*** o8888888o *** |
|||
* 88" . "88 * |
|||
* (| -_- |) * |
|||
* 0\ = /0 * |
|||
* ___/`---'\___ * |
|||
* .' \\| |// '. *
|
|||
* / \\||| : |||// \ *
|
|||
* / _||||| -:- |||||- \ * |
|||
* | | \\\ - /// | | *
|
|||
* | \_| ''\---/'' |_/ | * |
|||
* \ .-\__ '-' ___/-. / * |
|||
* ___'. .' /--.--\ `. .'___ * |
|||
* ."" '< `.___\_<|>_/___.' >' "". * |
|||
* | | : `- \`.;`\ _ /`;.`/ - ` : | | * |
|||
* \ \ `_. \_ __\ /__ _/ .-` / / * |
|||
* =====`-.____`.___ \_____/___.-`___.-'===== * |
|||
* `=---=' * |
|||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * |
|||
*********__佛祖保佑__永无BUG__验收通过__钞票多多__********* |
|||
*********************************************************/ |
|||
package com.wh.mapper.entinfo; |
|||
|
|||
import com.baomidou.mybatisplus.core.conditions.Wrapper; |
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|||
import com.baomidou.mybatisplus.core.toolkit.Constants; |
|||
import com.wh.pojo.entinfo.EntInfo; |
|||
import com.wh.pojo.entinfo.EntInfoVo; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
import org.apache.ibatis.annotations.Param; |
|||
import org.apache.ibatis.annotations.Select; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* Project: warehouse(仓储) <br/> |
|||
* File: EntInfoMapper.java <br/> |
|||
* Class: com.wh.biz.entinfo.EntInfoMapper <br/> |
|||
* Description: 客户信息. <br/> |
|||
* Copyright: Copyright (c) 2011 <br/> |
|||
* Company: https://gitee.com/liuzp315 <br/>
|
|||
* Makedate: 2023-06-13 22:19:45 <br/> |
|||
* |
|||
* @author liupopo |
|||
* @version 1.0 |
|||
* @since 1.0 |
|||
*/ |
|||
@Mapper |
|||
public interface EntInfoMapper extends BaseMapper<EntInfo> { |
|||
|
|||
//@Update("update ent_info set name=#{msg} where id=#{id}")
|
|||
//IPage<EntInfoVo> voPage(IPage<EntInfo> page, @Param(Constants.WRAPPER) QueryWrapper<EntInfo> qw);
|
|||
|
|||
IPage<EntInfoVo> selectPageVo(IPage<EntInfo> page, @Param(Constants.WRAPPER) Wrapper<EntInfo> qw); |
|||
|
|||
List<EntInfoVo> selectListAllVo(@Param(Constants.WRAPPER) Wrapper<EntInfo> qw); |
|||
|
|||
@Select("select * from ent_info") |
|||
List<EntInfoVo> selectListVo(); |
|||
} |
@ -0,0 +1,15 @@ |
|||
package com.wh.mapper.initial; |
|||
|
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
import com.wh.pojo.Location; |
|||
import com.wh.pojo.LocationVo; |
|||
import org.apache.ibatis.annotations.Select; |
|||
|
|||
import java.util.List; |
|||
|
|||
public interface LocationMapper extends BaseMapper<Location> { |
|||
@Select("select * from location ") |
|||
List<Location> listAll(); |
|||
@Select("select * from location where storehouseid=#{id};") |
|||
List<LocationVo> getLocationsByStoreId(String id); |
|||
} |
@ -0,0 +1,7 @@ |
|||
package com.wh.mapper.initial; |
|||
|
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
import com.wh.pojo.LocationType; |
|||
|
|||
public interface LocationTypeMapper extends BaseMapper<LocationType> { |
|||
} |
@ -0,0 +1,7 @@ |
|||
package com.wh.mapper.initial; |
|||
|
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
import com.wh.pojo.Product; |
|||
|
|||
public interface ProductMapper extends BaseMapper<Product> { |
|||
} |
@ -0,0 +1,7 @@ |
|||
package com.wh.mapper.initial; |
|||
|
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
import com.wh.pojo.Storehouse; |
|||
|
|||
public interface StorehouseMapper extends BaseMapper<Storehouse> { |
|||
} |
@ -0,0 +1,12 @@ |
|||
package com.wh.mapper.initial; |
|||
|
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
import com.wh.pojo.Supplier; |
|||
import org.apache.ibatis.annotations.Select; |
|||
|
|||
import java.util.List; |
|||
|
|||
public interface SupplierMapper extends BaseMapper<Supplier> { |
|||
@Select("select * from supplier") |
|||
List<Supplier> listAll(); |
|||
} |
@ -0,0 +1,7 @@ |
|||
package com.wh.mapper.instorehouse; |
|||
|
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
import com.wh.pojo.Purchase; |
|||
|
|||
public interface PurchaseMapper extends BaseMapper<Purchase> { |
|||
} |
@ -0,0 +1,8 @@ |
|||
package com.wh.mapper.instorehouse; |
|||
|
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
import com.wh.pojo.InStorehouse; |
|||
|
|||
|
|||
public interface PutInMapper extends BaseMapper<InStorehouse> { |
|||
} |
@ -0,0 +1,7 @@ |
|||
package com.wh.mapper.instorehouse; |
|||
|
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
import com.wh.pojo.Receiving; |
|||
|
|||
public interface ReceivingMapper extends BaseMapper<Receiving> { |
|||
} |
@ -0,0 +1,7 @@ |
|||
package com.wh.mapper.outstorehouse; |
|||
|
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
import com.wh.pojo.OutStorehouse; |
|||
|
|||
public interface OutStorehouseMapper extends BaseMapper<OutStorehouse> { |
|||
} |
@ -0,0 +1,7 @@ |
|||
package com.wh.mapper.outstorehouse; |
|||
|
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
import com.wh.pojo.Picking; |
|||
|
|||
public interface PickingMapper extends BaseMapper<Picking> { |
|||
} |
@ -0,0 +1,76 @@ |
|||
/********************************************************* |
|||
********************************************************* |
|||
******************** ******************* |
|||
************* ************ |
|||
******* _oo0oo_ ******* |
|||
*** o8888888o *** |
|||
* 88" . "88 * |
|||
* (| -_- |) * |
|||
* 0\ = /0 * |
|||
* ___/`---'\___ * |
|||
* .' \\| |// '. *
|
|||
* / \\||| : |||// \ *
|
|||
* / _||||| -:- |||||- \ * |
|||
* | | \\\ - /// | | *
|
|||
* | \_| ''\---/'' |_/ | * |
|||
* \ .-\__ '-' ___/-. / * |
|||
* ___'. .' /--.--\ `. .'___ * |
|||
* ."" '< `.___\_<|>_/___.' >' "". * |
|||
* | | : `- \`.;`\ _ /`;.`/ - ` : | | * |
|||
* \ \ `_. \_ __\ /__ _/ .-` / / * |
|||
* =====`-.____`.___ \_____/___.-`___.-'===== * |
|||
* `=---=' * |
|||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * |
|||
*********__佛祖保佑__永无BUG__验收通过__钞票多多__********* |
|||
*********************************************************/ |
|||
package com.wh.mapper.purchasenew; |
|||
|
|||
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 com.wh.pojo.purchasenew.Purchasenew; |
|||
import com.wh.pojo.purchasenew.PurchasenewVo; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
import org.apache.ibatis.annotations.Param; |
|||
import org.apache.ibatis.annotations.Select; |
|||
import org.apache.ibatis.annotations.Update; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* Project: warehouse(仓储) <br/> |
|||
* File: PurchasenewMapper.java <br/> |
|||
* Class: com.wh..biz.purchasenew.PurchasenewMapper <br/> |
|||
* Description: 采购订单. <br/> |
|||
* Copyright: Copyright (c) 2011 <br/> |
|||
* Company: https://gitee.com/liuzp315 <br/>
|
|||
* Makedate: 2023-06-10 18:09:57 <br/> |
|||
* |
|||
* @author liupopo |
|||
* @version 1.0 |
|||
* @since 1.0 |
|||
*/ |
|||
@Mapper |
|||
public interface PurchasenewMapper extends BaseMapper<Purchasenew> { |
|||
|
|||
//@Update("update purchasenew set name=#{msg} where id=#{id}")
|
|||
//IPage<PurchasenewVo> voPage(IPage<Purchasenew> page, @Param(Constants.WRAPPER) QueryWrapper<Purchasenew> qw);
|
|||
|
|||
IPage<PurchasenewVo> selectPageVo(IPage<Purchasenew> page, @Param(Constants.WRAPPER) Wrapper<Purchasenew> qw); |
|||
|
|||
List<PurchasenewVo> selectListAllVo(@Param(Constants.WRAPPER) Wrapper<Purchasenew> qw); |
|||
|
|||
@Select("select * from purchasenew") |
|||
List<PurchasenewVo> selectListVo(); |
|||
|
|||
/** |
|||
* 将采购订单的状态修改为已入库 |
|||
* @param sid |
|||
* @return |
|||
*/ |
|||
@Update("update purchasenew set status='2' where sid=#{sid}") |
|||
int updatePutInStatus(@Param("sid") String sid); |
|||
@Select("select * from purchasenew where state=1 ")//and cust_id=#{custId}
|
|||
List<Purchasenew> listForInput( String custId);//@Param("custId")
|
|||
} |
@ -0,0 +1,73 @@ |
|||
/********************************************************* |
|||
********************************************************* |
|||
******************** ******************* |
|||
************* ************ |
|||
******* _oo0oo_ ******* |
|||
*** o8888888o *** |
|||
* 88" . "88 * |
|||
* (| -_- |) * |
|||
* 0\ = /0 * |
|||
* ___/`---'\___ * |
|||
* .' \\| |// '. *
|
|||
* / \\||| : |||// \ *
|
|||
* / _||||| -:- |||||- \ * |
|||
* | | \\\ - /// | | *
|
|||
* | \_| ''\---/'' |_/ | * |
|||
* \ .-\__ '-' ___/-. / * |
|||
* ___'. .' /--.--\ `. .'___ * |
|||
* ."" '< `.___\_<|>_/___.' >' "". * |
|||
* | | : `- \`.;`\ _ /`;.`/ - ` : | | * |
|||
* \ \ `_. \_ __\ /__ _/ .-` / / * |
|||
* =====`-.____`.___ \_____/___.-`___.-'===== * |
|||
* `=---=' * |
|||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * |
|||
*********__佛祖保佑__永无BUG__验收通过__钞票多多__********* |
|||
*********************************************************/ |
|||
package com.wh.mapper.purchasenewproduct; |
|||
|
|||
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 com.wh.pojo.purchasenewproduct.PurchasenewProduct; |
|||
import com.wh.pojo.purchasenewproduct.PurchasenewProductVo; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
import org.apache.ibatis.annotations.Param; |
|||
import org.apache.ibatis.annotations.Select; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* Project: warehouse(仓储) <br/> |
|||
* File: PurchasenewProductMapper.java <br/> |
|||
* Class: com.wh..biz.purchasenewproduct.PurchasenewProductMapper <br/> |
|||
* Description: purchasenew_product. <br/> |
|||
* Copyright: Copyright (c) 2011 <br/> |
|||
* Company: https://gitee.com/liuzp315 <br/>
|
|||
* Makedate: 2023-06-10 18:09:57 <br/> |
|||
* |
|||
* @author liupopo |
|||
* @version 1.0 |
|||
* @since 1.0 |
|||
*/ |
|||
@Mapper |
|||
public interface PurchasenewProductMapper extends BaseMapper<PurchasenewProduct> { |
|||
|
|||
//@Update("update purchasenew_product set name=#{msg} where id=#{id}")
|
|||
//IPage<PurchasenewProductVo> voPage(IPage<PurchasenewProduct> page, @Param(Constants.WRAPPER) QueryWrapper<PurchasenewProduct> qw);
|
|||
|
|||
IPage<PurchasenewProductVo> selectPageVo(IPage<PurchasenewProduct> page, @Param(Constants.WRAPPER) Wrapper<PurchasenewProduct> qw); |
|||
|
|||
List<PurchasenewProductVo> selectListAllVo(@Param(Constants.WRAPPER) Wrapper<PurchasenewProduct> qw); |
|||
|
|||
@Select("select * from purchasenew_product") |
|||
List<PurchasenewProductVo> selectListVo(); |
|||
|
|||
/** |
|||
* 根据采购订单的sid查询 对应的商品列表 |
|||
* @param sid |
|||
* @return |
|||
*/ |
|||
@Select("select * from purchasenew_product where main_sid=#{sid}") |
|||
List<PurchasenewProductVo> fetchDetailsVoByPurchaseSid(String sid); |
|||
} |
@ -0,0 +1,75 @@ |
|||
/********************************************************* |
|||
********************************************************* |
|||
******************** ******************* |
|||
************* ************ |
|||
******* _oo0oo_ ******* |
|||
*** o8888888o *** |
|||
* 88" . "88 * |
|||
* (| -_- |) * |
|||
* 0\ = /0 * |
|||
* ___/`---'\___ * |
|||
* .' \\| |// '. *
|
|||
* / \\||| : |||// \ *
|
|||
* / _||||| -:- |||||- \ * |
|||
* | | \\\ - /// | | *
|
|||
* | \_| ''\---/'' |_/ | * |
|||
* \ .-\__ '-' ___/-. / * |
|||
* ___'. .' /--.--\ `. .'___ * |
|||
* ."" '< `.___\_<|>_/___.' >' "". * |
|||
* | | : `- \`.;`\ _ /`;.`/ - ` : | | * |
|||
* \ \ `_. \_ __\ /__ _/ .-` / / * |
|||
* =====`-.____`.___ \_____/___.-`___.-'===== * |
|||
* `=---=' * |
|||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * |
|||
*********__佛祖保佑__永无BUG__验收通过__钞票多多__********* |
|||
*********************************************************/ |
|||
package com.wh.mapper.shstorehouse; |
|||
|
|||
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 com.wh.pojo.shstorehouse.ShStorehouse; |
|||
import com.wh.pojo.shstorehouse.ShStorehouseVo; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
import org.apache.ibatis.annotations.Param; |
|||
import org.apache.ibatis.annotations.Select; |
|||
import org.apache.ibatis.annotations.Update; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* Project: yxt_supervise(宇信通监管) <br/> |
|||
* File: ShStorehouseMapper.java <br/> |
|||
* Class: com.wh.biz.shstorehouse.ShStorehouseMapper <br/> |
|||
* Description: 库房信息表. <br/> |
|||
* Copyright: Copyright (c) 2011 <br/> |
|||
* Company: https://gitee.com/liuzp315 <br/>
|
|||
* Makedate: 2023-06-14 23:18:54 <br/> |
|||
* |
|||
* @author liupopo |
|||
* @version 1.0 |
|||
* @since 1.0 |
|||
*/ |
|||
@Mapper |
|||
public interface ShStorehouseMapper extends BaseMapper<ShStorehouse> { |
|||
|
|||
//@Update("update sh_storehouse set name=#{msg} where id=#{id}")
|
|||
//IPage<ShStorehouseVo> voPage(IPage<ShStorehouse> page, @Param(Constants.WRAPPER) QueryWrapper<ShStorehouse> qw);
|
|||
|
|||
IPage<ShStorehouseVo> selectPageVo(IPage<ShStorehouse> page, @Param(Constants.WRAPPER) Wrapper<ShStorehouse> qw); |
|||
|
|||
List<ShStorehouseVo> selectSh(List<String> list); |
|||
@Select("select * from sh_storehouse where sid=#{shSid}") |
|||
ShStorehouseVo selectStoreBySid(@Param("shSid")String shSid); |
|||
@Select("select * from storehouse_project p left join sh_storehouse s on s.sid=p.sh_sid where p.project_sid=#{sid}") |
|||
List<ShStorehouseVo> getStorehouseBySid(@Param("sid") String sid); |
|||
|
|||
List<ShStorehouseVo> selectListAllVo(@Param(Constants.WRAPPER) Wrapper<ShStorehouse> qw); |
|||
|
|||
@Select("select * from sh_storehouse") |
|||
List<ShStorehouseVo> selectListVo(); |
|||
|
|||
@Update("update sh_storehouse set picurl=#{url} where sid=#{sid} ") |
|||
int updatePicUrl(@Param("sid")String sid,@Param("url") String url); |
|||
} |
@ -0,0 +1,68 @@ |
|||
/********************************************************* |
|||
********************************************************* |
|||
******************** ******************* |
|||
************* ************ |
|||
******* _oo0oo_ ******* |
|||
*** o8888888o *** |
|||
* 88" . "88 * |
|||
* (| -_- |) * |
|||
* 0\ = /0 * |
|||
* ___/`---'\___ * |
|||
* .' \\| |// '. *
|
|||
* / \\||| : |||// \ *
|
|||
* / _||||| -:- |||||- \ * |
|||
* | | \\\ - /// | | *
|
|||
* | \_| ''\---/'' |_/ | * |
|||
* \ .-\__ '-' ___/-. / * |
|||
* ___'. .' /--.--\ `. .'___ * |
|||
* ."" '< `.___\_<|>_/___.' >' "". * |
|||
* | | : `- \`.;`\ _ /`;.`/ - ` : | | * |
|||
* \ \ `_. \_ __\ /__ _/ .-` / / * |
|||
* =====`-.____`.___ \_____/___.-`___.-'===== * |
|||
* `=---=' * |
|||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * |
|||
*********__佛祖保佑__永无BUG__验收通过__钞票多多__********* |
|||
*********************************************************/ |
|||
package com.wh.mapper.shstorehouseattachment; |
|||
|
|||
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 com.wh.pojo.shstorehouseattachment.ShStorehouseAttachment; |
|||
import com.wh.pojo.shstorehouseattachment.ShStorehouseAttachmentVo; |
|||
import org.apache.ibatis.annotations.Delete; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
import org.apache.ibatis.annotations.Param; |
|||
import org.apache.ibatis.annotations.Select; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* Project: yxt_supervise(宇信通监管) <br/> |
|||
* File: ShStorehouseAttachmentMapper.java <br/> |
|||
* Class: com.wh.biz.shstorehouseattachment.ShStorehouseAttachmentMapper <br/> |
|||
* Description: 库房附件,如合同,图片等. <br/> |
|||
* Copyright: Copyright (c) 2011 <br/> |
|||
* Company: https://gitee.com/liuzp315 <br/>
|
|||
* Makedate: 2023-06-14 23:18:54 <br/> |
|||
* |
|||
* @author liupopo |
|||
* @version 1.0 |
|||
* @since 1.0 |
|||
*/ |
|||
@Mapper |
|||
public interface ShStorehouseAttachmentMapper extends BaseMapper<ShStorehouseAttachment> { |
|||
|
|||
//@Update("update sh_storehouse_attachment set name=#{msg} where id=#{id}")
|
|||
//IPage<ShStorehouseAttachmentVo> voPage(IPage<ShStorehouseAttachment> page, @Param(Constants.WRAPPER) QueryWrapper<ShStorehouseAttachment> qw);
|
|||
|
|||
IPage<ShStorehouseAttachmentVo> selectPageVo(IPage<ShStorehouseAttachment> page, @Param(Constants.WRAPPER) Wrapper<ShStorehouseAttachment> qw); |
|||
|
|||
List<ShStorehouseAttachmentVo> selectListAllVo(@Param(Constants.WRAPPER) Wrapper<ShStorehouseAttachment> qw); |
|||
|
|||
@Select("select * from sh_storehouse_attachment") |
|||
List<ShStorehouseAttachmentVo> selectListVo(); |
|||
@Delete("delete from sh_storehouse_attachment where storehouse_sid=#{shsid}") |
|||
void deleteByHouseSid(@Param("shsid") String dtoSid); |
|||
} |
@ -0,0 +1,65 @@ |
|||
/********************************************************* |
|||
********************************************************* |
|||
******************** ******************* |
|||
************* ************ |
|||
******* _oo0oo_ ******* |
|||
*** o8888888o *** |
|||
* 88" . "88 * |
|||
* (| -_- |) * |
|||
* 0\ = /0 * |
|||
* ___/`---'\___ * |
|||
* .' \\| |// '. *
|
|||
* / \\||| : |||// \ *
|
|||
* / _||||| -:- |||||- \ * |
|||
* | | \\\ - /// | | *
|
|||
* | \_| ''\---/'' |_/ | * |
|||
* \ .-\__ '-' ___/-. / * |
|||
* ___'. .' /--.--\ `. .'___ * |
|||
* ."" '< `.___\_<|>_/___.' >' "". * |
|||
* | | : `- \`.;`\ _ /`;.`/ - ` : | | * |
|||
* \ \ `_. \_ __\ /__ _/ .-` / / * |
|||
* =====`-.____`.___ \_____/___.-`___.-'===== * |
|||
* `=---=' * |
|||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * |
|||
*********__佛祖保佑__永无BUG__验收通过__钞票多多__********* |
|||
*********************************************************/ |
|||
package com.wh.mapper.shstorehouseattribute; |
|||
|
|||
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 com.wh.pojo.shstorehouseattribute.ShStorehouseAttribute; |
|||
import com.wh.pojo.shstorehouseattribute.ShStorehouseAttributeVo; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
import org.apache.ibatis.annotations.Param; |
|||
import org.apache.ibatis.annotations.Select; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* Project: yxt_supervise(宇信通监管) <br/> |
|||
* File: ShStorehouseAttributeMapper.java <br/> |
|||
* Class: com.wh.biz.shstorehouseattribute.ShStorehouseAttributeMapper <br/> |
|||
* Description: 库房性质. <br/> |
|||
* Copyright: Copyright (c) 2011 <br/> |
|||
* Company: https://gitee.com/liuzp315 <br/>
|
|||
* Makedate: 2023-06-14 23:18:54 <br/> |
|||
* |
|||
* @author liupopo |
|||
* @version 1.0 |
|||
* @since 1.0 |
|||
*/ |
|||
@Mapper |
|||
public interface ShStorehouseAttributeMapper extends BaseMapper<ShStorehouseAttribute> { |
|||
|
|||
//@Update("update sh_storehouse_attribute set name=#{msg} where id=#{id}")
|
|||
//IPage<ShStorehouseAttributeVo> voPage(IPage<ShStorehouseAttribute> page, @Param(Constants.WRAPPER) QueryWrapper<ShStorehouseAttribute> qw);
|
|||
|
|||
IPage<ShStorehouseAttributeVo> selectPageVo(IPage<ShStorehouseAttribute> page, @Param(Constants.WRAPPER) Wrapper<ShStorehouseAttribute> qw); |
|||
|
|||
List<ShStorehouseAttributeVo> selectListAllVo(@Param(Constants.WRAPPER) Wrapper<ShStorehouseAttribute> qw); |
|||
|
|||
@Select("select * from sh_storehouse_attribute") |
|||
List<ShStorehouseAttributeVo> selectListVo(); |
|||
} |
@ -0,0 +1,7 @@ |
|||
package com.wh.mapper.stock; |
|||
|
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
import com.wh.pojo.Stock; |
|||
|
|||
public interface StockMapper extends BaseMapper<Stock> { |
|||
} |
@ -0,0 +1,7 @@ |
|||
package com.wh.mapper.storehousemanage; |
|||
|
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
import com.wh.pojo.Remove; |
|||
|
|||
public interface RemoveMapper extends BaseMapper<Remove> { |
|||
} |
@ -0,0 +1,7 @@ |
|||
package com.wh.mapper.storehousemanage; |
|||
|
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
import com.wh.pojo.OnShelves; |
|||
|
|||
public interface ShelvesMapper extends BaseMapper<OnShelves> { |
|||
} |
@ -0,0 +1,13 @@ |
|||
package com.wh.mapper.storehouseproject; |
|||
|
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
import com.wh.pojo.storehouseproject.StoreHouseProject; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
|
|||
/** |
|||
* @author wangpengfei |
|||
* @date 2023/7/19 15:43 |
|||
*/ |
|||
@Mapper |
|||
public interface StoreHouseProjectMapper extends BaseMapper<StoreHouseProject> { |
|||
} |
@ -0,0 +1,157 @@ |
|||
package com.wh.mapper.sysuser; |
|||
|
|||
import com.baomidou.mybatisplus.core.conditions.Wrapper; |
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|||
import com.baomidou.mybatisplus.core.toolkit.Constants; |
|||
import com.wh.pojo.sysuser.SysUser; |
|||
import com.wh.pojo.sysuser.SysUserInfoVo; |
|||
import com.wh.pojo.sysuser.SysUserVo; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
import org.apache.ibatis.annotations.Param; |
|||
import org.apache.ibatis.annotations.Select; |
|||
import org.apache.ibatis.annotations.Update; |
|||
|
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* Project: anrui_portal(门户建设) <br/> |
|||
* File: SysUserMapper.java <br/> |
|||
* Class: SysUserMapper <br/> |
|||
* Description: 用户表. <br/> |
|||
* Copyright: Copyright (c) 2011 <br/> |
|||
* Company: https://gitee.com/liuzp315 <br/>
|
|||
* Makedate: 2021-08-03 00:24:30 <br/> |
|||
* |
|||
* @author liupopo |
|||
* @version 1.0 |
|||
* @since 1.0 |
|||
*/ |
|||
@Mapper |
|||
public interface SysUserMapper extends BaseMapper<SysUser> { |
|||
|
|||
//@Update("update sys_user set name=#{msg} where id=#{id}")
|
|||
//IPage<SysUserVo> voPage(IPage<SysUser> page, @Param(Constants.WRAPPER) QueryWrapper<SysUser> qw);
|
|||
|
|||
IPage<SysUserVo> selectPageVo(IPage<SysUser> page, @Param(Constants.WRAPPER) Wrapper<SysUser> ew, @Param("orgName") String orgName, @Param("userName") String userName); |
|||
|
|||
List<SysUserVo> selectListAllVo(@Param(Constants.WRAPPER) Wrapper<SysUser> qw); |
|||
|
|||
@Select("SELECT user.*,staff.name FROM sys_user user left join sys_staffinfo staff on user.staffSid=staff.sid where user.isDelete=0") |
|||
List<SysUserVo> selectListVo(); |
|||
|
|||
public int updatePassword(String sid, String password); |
|||
public int deleteBySid(String sid); |
|||
|
|||
public int updatePasswordApp(String sid, String password); |
|||
|
|||
SysUser selectByUserName(String userName); |
|||
|
|||
SysUser selectByUserNameApp(String userName); |
|||
|
|||
SysUser selectByAppId(String appId); |
|||
|
|||
@Update("UPDATE sys_user SET appId=#{appId} WHERE sid=#{sid} and userType=1") |
|||
int updateAppId(@Param("sid") String sid, @Param("appId") String appId); |
|||
|
|||
@Update("UPDATE sys_user SET token=#{token} WHERE sid=#{sid}") |
|||
int updateToken(@Param("sid") String sid, @Param("token") String token); |
|||
|
|||
SysUser fetchByUserName(String userName); |
|||
|
|||
void delBySid(String sid); |
|||
|
|||
@Update("UPDATE sys_user SET headImage=#{headImage} WHERE sid=#{sid}") |
|||
int updateHeadImage(@Param("sid") String sid, @Param("headImage") String headImage); |
|||
|
|||
/** |
|||
* @param mobile 手机号 |
|||
* @param userType 用户类型 |
|||
* @description: 根据手机号和用户类型查询客户是否存在 |
|||
* @return: |
|||
* @Author: dimengzhe |
|||
* @Date: 2021/10/6 11:35 |
|||
*/ |
|||
SysUser selectByMobileAndType(@Param("mobile") String mobile, @Param("userType") int userType); |
|||
|
|||
|
|||
// @Select("SELECT * FROM sys_user WHERE staffSid=#{staffSid} and isDelete=0")
|
|||
SysUserVo selectByStaffsid(@Param("staffSid") String staffSid); |
|||
|
|||
@Update("update sys_user set isDelete=1 where isDelete=0 and userType=2 and userName=#{mobile}") |
|||
int delSysUserByMobile(@Param("mobile") String mobile); |
|||
|
|||
@Select("select sid from sys_user") |
|||
List<String> selectAllUserSid(); |
|||
|
|||
|
|||
/** |
|||
* 根据用户sid查询用户的组织信息 |
|||
* |
|||
* @param userSid 用户的sid |
|||
* @return |
|||
*/ |
|||
SysUserInfoVo selectUserInfoByUserSid(String userSid); |
|||
SysUserInfoVo selectUserInfoByUserSidOne(@Param("userSid") String userSid,@Param("orgSid") String orgSid); |
|||
|
|||
/** |
|||
* 根据员工sid更新用户的工号以及手机号 |
|||
* |
|||
* @param mobile 手机号 |
|||
* @param sid 员工sid |
|||
* @return |
|||
*/ |
|||
int updateByStaffSid( @Param("mobile") String mobile, @Param("sid") String sid); |
|||
|
|||
/** |
|||
* 根据员工sid更新用户中的员工工号 |
|||
* |
|||
* @param jobNumber 员工工号 |
|||
* @param sid 员工sid |
|||
* @return |
|||
*/ |
|||
int updateByStaSid(@Param("jobNumber") String jobNumber, @Param("sid") String sid); |
|||
|
|||
/** |
|||
* 根据手机号查询用户是否存在 |
|||
* |
|||
* @param mobile 手机号 |
|||
* @return |
|||
*/ |
|||
SysUser selectByMobile(String mobile); |
|||
|
|||
int updateIsEnable(@Param("sid") String sid, @Param("isEnable") String isEnable); |
|||
|
|||
List<SysUserVo> getUsersByRoleSid(@Param("roleSid") String roleSid); |
|||
|
|||
List<SysUserVo> getUserByRole(@Param("roleSid") String roleSid, @Param("levelOrgSid") String levelOrgSid); |
|||
List<SysUserVo> getUserByRoleNoOrgPath(@Param("roleSid") String roleSid ); |
|||
List<Map<String,String>> getUserByOrgSid(@Param("orgSid") String orgSid,@Param("userSid") String userSid); |
|||
|
|||
List<SysUserVo> fetchBySids(@Param("sids")List<String> sids); |
|||
|
|||
List<SysUserVo> getUserByRoleSid(String roleSid); |
|||
|
|||
/** |
|||
* 根据手机号解绑用户绑定的设备 |
|||
* @param mobile |
|||
* @return |
|||
*/ |
|||
int updateAppIdByMobile(String mobile); |
|||
|
|||
/** |
|||
* 解绑所有用户绑定的设备 |
|||
* @return |
|||
*/ |
|||
int updateAppIdAll(); |
|||
|
|||
String selectIdBySid(@Param("list") List<String> stringList); |
|||
|
|||
List<SysUserVo> getUserMessageByRole(@Param("roleSid") String roleSid,@Param("levelOrgSid") String levelOrgSid, @Param("list") List<String> stringList); |
|||
String fetchByUserNameAndUserPhone(@Param("userName") String userName, @Param("userPhone") String userPhone); |
|||
List<SysUserVo> getUserByType(@Param("userType")String userType); |
|||
List<SysUserVo> getUserOrgBySid(@Param("sid")String sid); |
|||
@Select("select * from sys_user where userName=#{userName} and password=#{md5}") |
|||
SysUser selectByUserNameAndPassword(@Param("userName")String userName, @Param("md5")String md5); |
|||
} |
@ -0,0 +1,9 @@ |
|||
package com.wh.service; |
|||
|
|||
import com.wh.pojo.Rights; |
|||
|
|||
import java.util.List; |
|||
|
|||
public interface RightsService { |
|||
List<Rights> findRightsList(); |
|||
} |
@ -0,0 +1,42 @@ |
|||
package com.wh.service; |
|||
|
|||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|||
import com.wh.mapper.RightsMapper; |
|||
import com.wh.pojo.Rights; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
import java.util.List; |
|||
|
|||
@Service |
|||
public class RightsServiceImpl implements RightsService{ |
|||
|
|||
@Autowired |
|||
private RightsMapper rightsMapper; |
|||
|
|||
/** |
|||
* 查询一级/二级菜单 |
|||
* 查询条件: 一级菜单 parent_id = 0 |
|||
* 二级菜单 parent_id = 一级的Id |
|||
* 作业: 利用左连接的方式 实现数据的封装 restMap |
|||
* @return |
|||
*/ |
|||
@Override |
|||
public List<Rights> findRightsList() { |
|||
//1.查询一级菜单数据
|
|||
QueryWrapper<Rights> queryWrapper = new QueryWrapper<>(); |
|||
queryWrapper.eq("parent_id",0); |
|||
List<Rights> oneList = |
|||
rightsMapper.selectList(queryWrapper); |
|||
//2.如何查询二级菜单 父子关系的封装!!!
|
|||
for (Rights oneRights : oneList){ |
|||
//查询该元素的二级菜单
|
|||
//QueryWrapper<Rights> queryWrapper2 = new QueryWrapper<>();
|
|||
queryWrapper.clear(); |
|||
queryWrapper.eq("parent_id",oneRights.getId()); |
|||
List<Rights> twoList = rightsMapper.selectList(queryWrapper); |
|||
oneRights.setChildren(twoList); |
|||
} |
|||
return oneList; |
|||
} |
|||
} |
@ -0,0 +1,7 @@ |
|||
package com.wh.service; |
|||
|
|||
import com.wh.pojo.User; |
|||
|
|||
public interface UserService { |
|||
String findUserByUP(User user); |
|||
} |
@ -0,0 +1,28 @@ |
|||
package com.wh.service; |
|||
|
|||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|||
import com.wh.mapper.UserMapper; |
|||
import com.wh.pojo.User; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
import org.springframework.util.DigestUtils; |
|||
|
|||
import java.util.UUID; |
|||
|
|||
@Service |
|||
public class UserServiceImpl implements UserService{ |
|||
|
|||
@Autowired |
|||
private UserMapper userMapper; |
|||
|
|||
@Override |
|||
public String findUserByUP(User user) { |
|||
String md5Pass = DigestUtils.md5DigestAsHex(user.getPassword().getBytes()); |
|||
user.setPassword(md5Pass); |
|||
QueryWrapper queryWrapper = new QueryWrapper(user); |
|||
User userDB = userMapper.selectOne(queryWrapper); |
|||
|
|||
String token = UUID.randomUUID().toString().replace("-", "")+user.getUsername(); |
|||
return userDB==null?null:token; |
|||
} |
|||
} |
@ -0,0 +1,48 @@ |
|||
package com.wh.service.api.instorehouse; |
|||
|
|||
|
|||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|||
import com.wh.mapper.api.instorehouse.InStorehouseListingMapper; |
|||
import com.wh.pojo.*; |
|||
import com.wh.pojo.api.*; |
|||
import com.yxt.common.base.service.MybatisBaseService; |
|||
import org.springframework.beans.BeanUtils; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
import java.util.HashMap; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
@Service |
|||
public class InStorehouseListingService extends MybatisBaseService<InStorehouseListingMapper, InStorehouseListing> { |
|||
|
|||
public Map<String, Object> getQuery(InStorehouse inStorehouse) { |
|||
|
|||
Map<String,Object> map = new HashMap<>(); |
|||
|
|||
return map; |
|||
} |
|||
|
|||
public List<InStorehouseListing> selectInStorehouseListingsByMainSid(String sid) { |
|||
List<InStorehouseListing> list=baseMapper.selectList( |
|||
new QueryWrapper<InStorehouseListing>().eq("main_sid",sid)); |
|||
return list; |
|||
} |
|||
|
|||
private QueryWrapper<OutStorehouseVo> createQueryWrapper(OutStorehouseMainQuery query) { |
|||
// todo: 这里根据具体业务调整查询条件
|
|||
QueryWrapper<OutStorehouseVo> qw = new QueryWrapper<>(); |
|||
|
|||
if (org.apache.commons.lang3.StringUtils.isNotBlank(query.getApplicationDateStart())) { |
|||
qw.eq("main_sid", query.getMainSid()); |
|||
} |
|||
|
|||
return qw; |
|||
} |
|||
|
|||
public void deleteByMainSid(String sid) { |
|||
Map<String,Object> params=new HashMap<>(); |
|||
params.put("main_sid",sid); |
|||
baseMapper.deleteByMap(params); |
|||
} |
|||
} |
@ -0,0 +1,499 @@ |
|||
package com.wh.service.api.instorehouse; |
|||
|
|||
|
|||
import cn.hutool.core.bean.BeanUtil; |
|||
import cn.hutool.core.util.StrUtil; |
|||
import com.alibaba.fastjson.JSONObject; |
|||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|||
import com.baomidou.mybatisplus.core.toolkit.StringUtils; |
|||
import com.wh.api.Api; |
|||
import com.wh.mapper.api.instorehouse.InStorehouseMainMapper; |
|||
import com.wh.mapper.initial.LocationMapper; |
|||
import com.wh.pojo.*; |
|||
import com.wh.pojo.api.*; |
|||
import com.wh.pojo.purchasenew.Purchasenew; |
|||
import com.wh.pojo.purchasenew.PurchasenewDto; |
|||
import com.wh.pojo.purchasenewproduct.PurchasenewProduct; |
|||
import com.wh.pojo.purchasenewproduct.PurchasenewProductDto; |
|||
import com.wh.pojo.purchasenewproduct.PurchasenewProductVo; |
|||
import com.wh.service.api.prodstock.ProdStockService; |
|||
import com.wh.service.initial.LocationService; |
|||
import com.wh.service.initial.ProductService; |
|||
import com.wh.service.purchasenew.PurchasenewService; |
|||
import com.wh.service.purchasenewproduct.PurchasenewProductService; |
|||
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 lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.beans.BeanUtils; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
import org.springframework.transaction.annotation.Transactional; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import javax.validation.constraints.Positive; |
|||
import java.math.BigDecimal; |
|||
import java.util.*; |
|||
|
|||
@Slf4j |
|||
@Service |
|||
public class InStorehouseMainService extends MybatisBaseService<InStorehouseMainMapper, InStorehouseMain> { |
|||
|
|||
@Autowired |
|||
private InStorehouseListingService inStorehouseListingService; |
|||
@Autowired |
|||
private ProdStockService prodStockService; |
|||
@Autowired |
|||
private LocationService locationService; |
|||
@Autowired |
|||
private LocationMapper locationMapper; |
|||
@Autowired |
|||
private PurchasenewService purchasenewService; |
|||
@Autowired |
|||
private PurchasenewProductService purchasenewProductService; |
|||
@Autowired |
|||
private InStorehouseMainService inStorehouseMainService; |
|||
@Autowired |
|||
private ProductService productService; |
|||
public ResultBean addInStorehouse(InStoreHouseMainDto inStoreHouseMainDto) { |
|||
log.info("/InStorehouseMainService/addInStorehouse:{}", JSONObject.toJSONString(inStoreHouseMainDto)); |
|||
ResultBean<Object> r = ResultBean.fireFail(); |
|||
if(inStoreHouseMainDto==null){ |
|||
return r.setMsg("数据不能为空"); |
|||
} |
|||
if(StringUtils.isBlank(inStoreHouseMainDto.getNo())){ |
|||
return r.setMsg("申请单编号不能为空"); |
|||
} |
|||
if(StringUtils.isBlank(inStoreHouseMainDto.getLocationId())){ |
|||
return r.setMsg("货位不能为空"); |
|||
} |
|||
List<Location> locationByLocationId = locationService.getLocationByLocationId(inStoreHouseMainDto.getLocationId()); |
|||
if(locationByLocationId==null||locationByLocationId.size()==0){ |
|||
return r.setMsg("货位信息不存在"); |
|||
} |
|||
if(locationByLocationId.size()>1){ |
|||
return r.setMsg("货位编号重复"); |
|||
} |
|||
Location location =locationByLocationId.get(0) ; |
|||
|
|||
QueryWrapper<Purchasenew> purchasenewWrapper = new QueryWrapper<>(); |
|||
purchasenewWrapper.eq("purchase_no",inStoreHouseMainDto.getNo()); |
|||
List<Purchasenew> list1 = purchasenewService.list(purchasenewWrapper); |
|||
if(list1==null||list1.size()==0){ |
|||
return r.setMsg("申请单不存在"); |
|||
} |
|||
Purchasenew purchasenew = list1.get(0); |
|||
PurchasenewDto dto =new PurchasenewDto(); |
|||
BeanUtil.copyProperties(purchasenew,dto); |
|||
String purchaseSid=purchasenew.getSid(); |
|||
QueryWrapper<InStorehouseMain> queryWrapper = new QueryWrapper<>(); |
|||
queryWrapper.eq("purchase_sid",purchasenew.getSid()); |
|||
List<InStorehouseMain> inStorehouseMains = baseMapper.selectList(queryWrapper); |
|||
if(inStorehouseMains!=null&&inStorehouseMains.size()>0){ |
|||
return r.setMsg("申请单编号已经入库"); |
|||
} |
|||
List<PurchasenewProductVo> purchasenewProductVos = |
|||
purchasenewProductService.fetchDetailsVoByPurchaseSid(purchaseSid); |
|||
List<PurchasenewProductDto> products=new ArrayList<>(); |
|||
for (PurchasenewProductVo purchasenewProductVo : purchasenewProductVos) { |
|||
PurchasenewProductDto d=new PurchasenewProductDto(); |
|||
BeanUtil.copyProperties(purchasenewProductVo,d); |
|||
d.setStoreHouseName(location.getStorehouse()); |
|||
d.setStoreHouseSid(location.getStorehouseid()); |
|||
d.setLocationNumber(location.getName()); |
|||
d.setLocationId(location.getLocationId()); |
|||
products.add(d); |
|||
} |
|||
dto.setProducts(products); |
|||
saveOrUpdateByPurchaseSid(dto,purchaseSid); |
|||
// InStorehouseMain in=new InStorehouseMain();
|
|||
// BeanUtils.copyProperties(inStoreHouseMainDto,in);
|
|||
// List<InStorehouseListing> list = inStoreHouseMainDto.getList();
|
|||
// if(list==null||list.size()==0){
|
|||
// return r.setMsg("商品不能为空");
|
|||
// }
|
|||
// //申请单主表信息
|
|||
// baseMapper.insert(in);
|
|||
// addListing(in, list);
|
|||
return ResultBean.fireSuccess().setMsg("添加成功"); |
|||
} |
|||
@Transactional |
|||
public ResultBean addInStorehouses(InStoreHouseMainDto inStoreHouseMainDto) { |
|||
ResultBean<Object> r = ResultBean.fireFail(); |
|||
|
|||
InStorehouseMain in=new InStorehouseMain(); |
|||
BeanUtils.copyProperties(inStoreHouseMainDto,in); |
|||
List<InStorehouseListing> list = inStoreHouseMainDto.getList(); |
|||
|
|||
//申请单主表信息
|
|||
baseMapper.insert(in); |
|||
addListing(in, list); |
|||
String purchaseSid = in.getPurchaseSid(); |
|||
QueryWrapper<Purchasenew> qw = new QueryWrapper<>(); |
|||
qw.eq("sid",purchaseSid); |
|||
Purchasenew one = purchasenewService.getOne(qw); |
|||
one.setState(2); |
|||
one.setModifyTime(new Date()); |
|||
purchasenewService.updateById(one); |
|||
//purchasenewService.updateStateToInputBySid(in.getPurchaseSid());
|
|||
return ResultBean.fireSuccess().setMsg("添加成功"); |
|||
|
|||
} |
|||
public PagerVo<InStoreHouseMainVo> listPage(PagerQuery<InStorehouseMainQuery> pq) { |
|||
InStorehouseMainQuery query = pq.getParams(); |
|||
QueryWrapper<InStoreHouseMainVo> qw = createQueryWrapper(query); |
|||
IPage<InStoreHouseMainVo> page = PagerUtil.queryToPage(pq); |
|||
IPage<InStoreHouseMainVo> pagging = baseMapper.selectPageVo(page, qw); |
|||
PagerVo<InStoreHouseMainVo> p = PagerUtil.pageToVo(pagging, null); |
|||
return p; |
|||
} |
|||
private QueryWrapper<InStoreHouseMainVo> createQueryWrapper(InStorehouseMainQuery query) { |
|||
// todo: 这里根据具体业务调整查询条件
|
|||
// 多字段Like示例:qw.and(wraInStorehouseMainpper -> wrapper.like("name", query.getName()).or().like("remark", query.getName()));
|
|||
QueryWrapper<InStoreHouseMainVo> qw = new QueryWrapper<>(); |
|||
|
|||
if (org.apache.commons.lang3.StringUtils.isNotBlank(query.getNo())) { |
|||
qw.like("no", query.getNo()); |
|||
} |
|||
if (org.apache.commons.lang3.StringUtils.isNotBlank(query.getApplicationDateStart())) { |
|||
qw.ge("application_date", query.getApplicationDateStart()); |
|||
} |
|||
if (StrUtil.isNotBlank(query.getApplicationDateEnd())) { |
|||
qw.lt("application_date", query.getApplicationDateEnd()); |
|||
} |
|||
if (StrUtil.isNotBlank(query.getCreatorName())) { |
|||
qw.like("creator_name", query.getCreatorName()); |
|||
} |
|||
if (StrUtil.isNotBlank(query.getCusterName())) { |
|||
qw.like("custer_name", query.getCusterName()); |
|||
} |
|||
if (StrUtil.isNotBlank(query.getCusterSid())) { |
|||
qw.eq("custer_sid", query.getCusterSid()); |
|||
} |
|||
if (org.apache.commons.lang3.StringUtils.isNotBlank(query.getStoreHouseName())) { |
|||
qw.like("store_house_name", query.getStoreHouseName()); |
|||
} |
|||
return qw; |
|||
} |
|||
/** |
|||
* 新增商品信息 |
|||
* @param in |
|||
* @param list |
|||
*/ |
|||
@Transactional |
|||
public void addListing(InStorehouseMain in, List<InStorehouseListing> list) { |
|||
list.forEach(l->{ |
|||
l.setCusterSid(in.getCusterSid()); |
|||
l.setCusterName(in.getCusterName()); |
|||
l.setMainSid(in.getSid()); |
|||
inStorehouseListingService.insert(l); |
|||
saveOrUpdateProdStock(l); |
|||
}); |
|||
} |
|||
|
|||
/** |
|||
* 新增或者修改商品库存信息 |
|||
* @param l |
|||
*/ |
|||
private void saveOrUpdateProdStock(InStorehouseListing l) { |
|||
PagerVo<ProdStock> proStocks = getProdStock(l); |
|||
long total = proStocks.getTotal(); |
|||
if(total==0){ |
|||
addProdStock(l); |
|||
}else{ |
|||
updateProdStock(l, proStocks); |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* 修改商品库存信息 |
|||
* @param l |
|||
* @param proStocks |
|||
*/ |
|||
private void updateProdStock(InStorehouseListing l, PagerVo<ProdStock> proStocks) { |
|||
ResultBean<Object> r = ResultBean.fireFail(); |
|||
ProdStock prodStock = proStocks.getRecords().get(0); |
|||
String num = prodStock.getNum(); |
|||
if(com.yxt.common.base.utils.StringUtils.isBlank(num)){ |
|||
// log.info("{}",l.getProName()+"商品数量不能为空");
|
|||
} |
|||
BigDecimal i=new BigDecimal(num).add(new BigDecimal(l.getNum())); |
|||
// prodStock.setNum(l.getNum());
|
|||
prodStock.setConfirmedPrice(l.getConfirmedPrice()); |
|||
prodStock.setNum(i.toString()); // TODO 当系统调试通后需要做修改 将下一行代码注释去掉
|
|||
BigDecimal multiply = new BigDecimal(prodStock.getNum()).multiply(new BigDecimal(prodStock.getConfirmedPrice())); |
|||
prodStock.setCalculatedValue(multiply.toString()); |
|||
prodStock.setStoreHouseName(l.getStoreHouseName()); |
|||
prodStock.setStoreHouseSid(l.getStoreHouseSid()); |
|||
prodStock.setModifyTime(new Date()); |
|||
prodStockService.updateById(prodStock); |
|||
} |
|||
|
|||
/** |
|||
* 新增商品库存信息 |
|||
* @param l |
|||
*/ |
|||
private void addProdStock(InStorehouseListing l) { |
|||
ProdStock prodStock=new ProdStock(); |
|||
prodStock.setProName(l.getProName());// varchar 50 质物名称
|
|||
prodStock.setProModel(l.getProModel());// varchar 50 规格(型号)
|
|||
prodStock.setManufacturer(l.getManufacturer());// varchar 50 生成厂家(产地)
|
|||
prodStock.setNum(l.getNum());// varchar 10 数量
|
|||
prodStock.setWeight(l.getWeight());// varchar 50 重量
|
|||
prodStock.setConfirmedPrice(l.getConfirmedPrice());// decime 50 2 质权人确认的单价
|
|||
prodStock.setCalculatedValue(l.getCalculatedValue());// decime 50 2 核算的价值
|
|||
prodStock.setLocationNumber(l.getLocationNumber());// varchar 10 货位号
|
|||
prodStock.setLocationId(l.getLocationId());// varchar 10 货位号
|
|||
prodStock.setCusterName(l.getCusterName());// varchar 50 客户名称(企业)
|
|||
prodStock.setProUnit(l.getProUnit());// varchar 50 规格单位
|
|||
prodStock.setCusterSid(l.getCusterSid());// varchar 64 客户Sid(企业)
|
|||
prodStock.setStoreHouseSid(l.getStoreHouseSid());// varchar 64 仓库Sid
|
|||
prodStock.setStoreHouseName(l.getStoreHouseName());// varchar 100 仓库名称
|
|||
prodStock.setProSid(l.getProSid()); |
|||
prodStock.setBrandInfoName(l.getBrandInfoName());//品牌名称
|
|||
prodStock.setBrandInfoKey(l.getBrandInfoKey());//品牌名称
|
|||
prodStock.setProductTypeName(l.getProductTypeName());//分类名称
|
|||
prodStock.setProductTypeKey(l.getProductTypeKey());//分类key
|
|||
prodStockService.insert(prodStock); |
|||
ResultBean productListByNameAndCode = productService.getProductListByNameAndCode(l.getProName(), l.getProSid()); |
|||
if (productListByNameAndCode.getSuccess()){ |
|||
List<Product> data = (List<Product>) productListByNameAndCode.getData(); |
|||
if(data.size()==0){ |
|||
Product product=new Product(); |
|||
product.setName(l.getProName()); |
|||
product.setBarCode(l.getProSid()); |
|||
productService.addProduct(product); |
|||
} |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* 根据商品的名称 规格 客户查询库存信息 |
|||
* @param l |
|||
* @return |
|||
*/ |
|||
private PagerVo<ProdStock> getProdStock(InStorehouseListing l) { |
|||
PagerQuery<ProdStockQuery> pq=new PagerQuery<>(); |
|||
pq.setCurrent(0); |
|||
pq.setSize(10); |
|||
ProdStockQuery stockQuery = new ProdStockQuery(); |
|||
stockQuery.setCusterSid(l.getCusterSid()); |
|||
stockQuery.setProModel(l.getProModel()); |
|||
stockQuery.setProName(l.getProName()); |
|||
stockQuery.setProSid(l.getProSid()); |
|||
stockQuery.setStoreHouseSid(l.getStoreHouseSid()); |
|||
stockQuery.setLocationNumber(l.getLocationNumber()); |
|||
stockQuery.setLocationId(l.getLocationId()); |
|||
pq.setParams(stockQuery); |
|||
PagerVo<ProdStock> proStocks = prodStockService.getProStocks(pq); |
|||
return proStocks; |
|||
} |
|||
|
|||
public ResultBean getInStorehouse(String sid) { |
|||
ResultBean<Object> r = ResultBean.fireFail(); |
|||
InStorehouseMain inStorehouseMain = baseMapper.selectOne( |
|||
new QueryWrapper<InStorehouseMain>().eq("sid",sid)); |
|||
if(inStorehouseMain==null){ |
|||
return r.setMsg("数据不存在"); |
|||
} |
|||
InStoreHouseMainDetailVo ihmdv=new InStoreHouseMainDetailVo(); |
|||
BeanUtils.copyProperties(inStorehouseMain,ihmdv); |
|||
List<InStorehouseListing> list=inStorehouseListingService.selectInStorehouseListingsByMainSid(sid); |
|||
ihmdv.setList(list); |
|||
return ResultBean.fireSuccess().setData(ihmdv); |
|||
} |
|||
|
|||
/** |
|||
* 根据采购申请单保存入库单相关数据 |
|||
* @param dto |
|||
* @return |
|||
*/ |
|||
@Transactional |
|||
public ResultBean saveOrUpdateByPurchaseSid(PurchasenewDto dto,String purchaseSid) { |
|||
ResultBean<Object> r = ResultBean.fireFail(); |
|||
Map<String,Object> params=new HashMap<>(); |
|||
params.put("purchase_sid",purchaseSid); |
|||
List<InStorehouseMain> inStorehouseMains = baseMapper.selectByMap(params); |
|||
if(inStorehouseMains!=null&&inStorehouseMains.size()>0){ |
|||
InStorehouseMain inStorehouseMain = inStorehouseMains.get(0); |
|||
dto.setSid(inStorehouseMain.getSid()); |
|||
deleteByMainSid(inStorehouseMain.getSid()); |
|||
deleteBySid(inStorehouseMain.getSid()); |
|||
} |
|||
InStoreHouseMainDto inStoreHouseMainDto=new InStoreHouseMainDto(); |
|||
inStoreHouseMainDto.setLocationName(dto.getProducts().get(0).getLocationNumber()); |
|||
inStoreHouseMainDto.setLocationId(dto.getProducts().get(0).getLocationId()); |
|||
inStoreHouseMainDto.setNo("RK"+dto.getPurchaseNo()); //varchar 50 编号
|
|||
inStoreHouseMainDto.setApplicationDate(dto.getPurchaseDate()); //date 50 制单日期
|
|||
inStoreHouseMainDto.setCreatorSid(dto.getPurchasePersonSid()); //varchar 64 制单人Sid
|
|||
inStoreHouseMainDto.setCreatorName(dto.getPurchasePerson()); /// varchar 50 制单人姓名
|
|||
inStoreHouseMainDto.setCusterSid(dto.getCustId()); //varchar 64 客户Sid(企业)
|
|||
inStoreHouseMainDto.setCusterName(dto.getCustName()); // varchar 100 客户名称(企业)
|
|||
inStoreHouseMainDto.setStoreHouseSid(dto.getStorehouseId()); // varchar 64 仓库Sid
|
|||
inStoreHouseMainDto.setStoreHouseName(dto.getStorehouseName()); // varchar 100 仓库名称
|
|||
List<InStorehouseListing> list=new ArrayList<>(); |
|||
List<PurchasenewProductDto> products = dto.getProducts(); |
|||
products.forEach(p->{ |
|||
InStorehouseListing ppd=new InStorehouseListing(); |
|||
ppd.setCusterSid(p.getCusterSid());// varchar 64 客户Sid(企业)
|
|||
ppd.setCusterName(p.getCusterName()) ;//varchar 100 客户名称(企业)
|
|||
ppd.setStoreHouseSid(p.getStoreHouseSid()) ;//varchar 64 仓库Sid
|
|||
ppd.setStoreHouseName(p.getStoreHouseName()) ;//varchar 100 仓库名称
|
|||
ppd.setProName(p.getProName());// varchar 50 质物名称
|
|||
ppd.setProSid(p.getProId());// varchar 50 质物名称
|
|||
ppd.setProModel(p.getProModel()) ;//varchar 50 规格(型号)
|
|||
ppd.setProUnit(p.getProUnit()) ;//varchar 50 规格单位
|
|||
ppd.setManufacturer(p.getManufacturer());// varchar 50 生成厂家(产地)
|
|||
ppd.setNum(p.getEstimateNum()) ;//varchar 10 数量
|
|||
ppd.setWeight(p.getEstimateWeight()) ;//varchar 50 重量
|
|||
ppd.setConfirmedPrice(p.getEstimateConfirmedPrice());// decime 50 2 质权人确认的单价
|
|||
ppd.setCalculatedValue(p.getEstimateCalculatedValue()) ;//decime 50 2 核算的价值
|
|||
ppd.setLocationNumber(p.getLocationNumber()) ;//varchar 10 货位号
|
|||
ppd.setLocationId(p.getLocationId()) ;//varchar 10 货位号id
|
|||
ppd.setPurchaseSid(purchaseSid);//采购申请单的sid
|
|||
ppd.setBrandInfoName(p.getBrandInfoName());//品牌名称
|
|||
ppd.setBrandInfoKey(p.getBrandInfoKey());//品牌名称
|
|||
ppd.setProductTypeName(p.getProductTypeName());//分类名称
|
|||
ppd.setProductTypeKey(p.getProductTypeKey());//分类key
|
|||
list.add(ppd); |
|||
}); |
|||
inStoreHouseMainDto.setList(list); |
|||
inStoreHouseMainDto.setPurchaseSid(purchaseSid);//采购申请单的sid
|
|||
addInStorehouses(inStoreHouseMainDto); |
|||
return r.success(); |
|||
} |
|||
|
|||
/** |
|||
* 根据入库单的sid删除商品信息 减少库存数量 |
|||
* @param sid |
|||
* @return |
|||
*/ |
|||
@Transactional |
|||
public ResultBean deleteByMainSid(String sid){ |
|||
ResultBean<Object> r = ResultBean.fireFail(); |
|||
List<InStorehouseListing> inStorehouseListings = inStorehouseListingService.selectInStorehouseListingsByMainSid(sid); |
|||
// inStorehouseListings.forEach(i->{
|
|||
// prodStockService.reduceNumByProdSidAndCustSid(i.getProSid(), i.getCusterSid(),i.getNum());
|
|||
// });
|
|||
inStorehouseListingService.deleteByMainSid(sid); |
|||
Map<String,Object> params=new HashMap<>(); |
|||
params.put("sid",sid); |
|||
baseMapper.deleteByMap(params); |
|||
return r.success(); |
|||
} |
|||
|
|||
public void deleteByPurchaseSid(String sid) { |
|||
Map<String,Object> params=new HashMap<>(); |
|||
params.put("purchase_sid",sid); |
|||
List<InStorehouseMain> inStorehouseMains = baseMapper.selectByMap(params); |
|||
if(inStorehouseMains!=null&&inStorehouseMains.size()>0){ |
|||
InStorehouseMain inStorehouseMain = inStorehouseMains.get(0); |
|||
deleteByMainSid(inStorehouseMain.getSid()); |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* 获取所有未入库的采购订单编号和仓库信息 |
|||
* @return |
|||
*/ |
|||
public Map<String, Object> getQuery(InStorehouseMainQuery query) { |
|||
// Purchasenew purchase = new Purchasenew();
|
|||
// if (org.springframework.util.StringUtils.hasLength(inStorehouse.getReceivingId())){
|
|||
// Receiving receivingAble = receivingMapper.selectById(inStorehouse.getReceivingId());
|
|||
// purchase = purchaseMapper.selectById(receivingAble.getPurchaseId());
|
|||
// }
|
|||
|
|||
QueryWrapper<Receiving> receivingQueryWrapper = new QueryWrapper<>(); |
|||
receivingQueryWrapper.eq("status","已审核") |
|||
.select("receiving_id"); |
|||
|
|||
|
|||
QueryWrapper<Location> locationQueryWrapper = new QueryWrapper<>(); |
|||
locationQueryWrapper.eq("status","空闲") |
|||
.eq("type","入库区") |
|||
//.eq(org.springframework.util.StringUtils.hasLength(purchase.getStorehouse()),"storehouse",purchase.getStorehouse())
|
|||
.select("location_id"); |
|||
|
|||
//List<Receiving> receivingList = receivingMapper.selectList(receivingQueryWrapper);
|
|||
Map<String,Object> params=new HashMap<>(); |
|||
params.put("status","1");//未入库的采购订单
|
|||
params.put("cust_id",query.getCusterSid());//未入库的采购订单
|
|||
List<Purchasenew> purchasenews = purchasenewService.listByMap(params); |
|||
List<Location> locationList = locationMapper.selectList(locationQueryWrapper); |
|||
|
|||
List<Map<String,String>> receivingIdList = new ArrayList<>(); |
|||
List<Map<String,String>> locationIdList = new ArrayList<>(); |
|||
|
|||
for (Purchasenew receiving : purchasenews){ |
|||
Map<String,String> map=new HashMap<>(); |
|||
map.put("no",receiving.getPurchaseNo()); |
|||
map.put("sid",receiving.getSid()); |
|||
receivingIdList.add(map); |
|||
} |
|||
|
|||
if (locationList != null){ |
|||
for (Location location : locationList){ |
|||
Map<String,String> map=new HashMap<>(); |
|||
map.put("locationId",location.getLocationId()); |
|||
map.put("locationName",location.getName()); |
|||
locationIdList.add(map); |
|||
} |
|||
} |
|||
Map<String,Object> map = new HashMap<>(); |
|||
map.put("receivingIdList",receivingIdList); |
|||
map.put("locationIdList",locationIdList); |
|||
return map; |
|||
} |
|||
|
|||
public ResultBean addInStorehouseByPurchase(PurchaseInStoreHouseParams params) { |
|||
ResultBean<Object> r = ResultBean.fireFail(); |
|||
String purchaseSid = params.getPurchaseSid(); |
|||
String userName = params.getUserName(); |
|||
String storeHouseSid = params.getStoreHouseSid(); |
|||
String storeHouseName = params.getStoreHouseName(); |
|||
|
|||
// Location location = locationMapper.selectById(storeHouseSid);
|
|||
// if(location==null){
|
|||
// return r.setMsg("仓库信息不存在");
|
|||
// }
|
|||
String custerSid = params.getCusterSid(); |
|||
Map<String,Object> param5=new HashMap<>(); |
|||
param5.put("sid",purchaseSid); |
|||
List<Purchasenew> purchasenews = purchasenewService.listByMap(param5); |
|||
if(purchasenews==null||purchasenews.size()==0){ |
|||
return r.setMsg("数据不存在"); |
|||
} |
|||
Purchasenew purchasenew = purchasenews.get(0); |
|||
Map<String,Object> params2=new HashMap<>(); |
|||
params2.put("purchase_sid",purchasenew.getSid()); |
|||
List<InStorehouseMain> inStorehouseMains = baseMapper.selectByMap(params2); |
|||
if(inStorehouseMains.size()>0){ |
|||
return r.setMsg("采购订单已经有入库记录"); |
|||
} |
|||
PurchasenewDto pd=new PurchasenewDto(); |
|||
BeanUtil.copyProperties(purchasenew,pd); |
|||
Map<String,Object> params3=new HashMap<>(); |
|||
params3.put("main_sid",purchasenew.getSid()); |
|||
List<PurchasenewProduct> purchasenewProducts = purchasenewProductService.listByMap(params3); |
|||
if (purchasenewProducts==null||purchasenewProducts.size()==0){ |
|||
return r.setMsg("没有商品信息!"); |
|||
} |
|||
List<PurchasenewProductDto> purchasenewProductDtos =new ArrayList<>(); |
|||
purchasenewProducts.forEach(p->{ |
|||
PurchasenewProductDto ppd=new PurchasenewProductDto(); |
|||
BeanUtil.copyProperties(p,ppd); |
|||
ppd.setStoreHouseSid(storeHouseSid); |
|||
ppd.setStoreHouseName(storeHouseName); |
|||
purchasenewProductDtos.add(ppd); |
|||
}); |
|||
pd.setProducts(purchasenewProductDtos); |
|||
pd.setPurchasePersonSid(custerSid); |
|||
pd.setPurchasePerson(userName); |
|||
saveOrUpdateByPurchaseSid(pd,purchasenew.getSid()); |
|||
purchasenewService.updatePutInStatus(purchasenew.getSid()); |
|||
return r.success(); |
|||
} |
|||
} |
@ -0,0 +1,30 @@ |
|||
package com.wh.service.api.outstorehouse; |
|||
|
|||
|
|||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|||
import com.wh.mapper.api.instorehouse.InStorehouseMainMapper; |
|||
import com.wh.mapper.api.outstorehouse.OutStorehouseListingMapper; |
|||
import com.wh.mapper.api.outstorehouse.OutStorehouseMainMapper; |
|||
import com.wh.pojo.api.InStorehouseListing; |
|||
import com.wh.pojo.api.InStorehouseMain; |
|||
import com.wh.pojo.api.OutStorehouseListing; |
|||
import com.wh.pojo.api.OutStorehouseMain; |
|||
import com.yxt.common.base.service.MybatisBaseService; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
import java.util.List; |
|||
|
|||
@Service |
|||
public class OutStorehouseListingService extends MybatisBaseService<OutStorehouseListingMapper, OutStorehouseListing> { |
|||
|
|||
|
|||
public List<OutStorehouseListing> selectInStorehouseListingsByMainSid(String sid) { |
|||
List<OutStorehouseListing> list=baseMapper.selectList( |
|||
new QueryWrapper<OutStorehouseListing>().eq("main_sid",sid)); |
|||
return list; |
|||
} |
|||
|
|||
public int deleteByMainSid(String sid) { |
|||
return baseMapper.deleteByMainSid(sid); |
|||
} |
|||
} |
@ -0,0 +1,299 @@ |
|||
package com.wh.service.api.outstorehouse; |
|||
|
|||
|
|||
import cn.hutool.core.util.StrUtil; |
|||
import com.alibaba.fastjson.JSONObject; |
|||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|||
import com.baomidou.mybatisplus.core.toolkit.StringUtils; |
|||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|||
import com.wh.api.Api; |
|||
import com.wh.mapper.api.instorehouse.InStorehouseMainMapper; |
|||
import com.wh.mapper.api.outstorehouse.OutStorehouseMainMapper; |
|||
import com.wh.mapper.initial.LocationMapper; |
|||
import com.wh.mapper.initial.ProductMapper; |
|||
import com.wh.mapper.instorehouse.PurchaseMapper; |
|||
import com.wh.mapper.instorehouse.PutInMapper; |
|||
import com.wh.mapper.instorehouse.ReceivingMapper; |
|||
import com.wh.mapper.stock.StockMapper; |
|||
import com.wh.mapper.storehousemanage.RemoveMapper; |
|||
import com.wh.pojo.*; |
|||
import com.wh.pojo.api.*; |
|||
import com.wh.service.api.instorehouse.InStorehouseListingService; |
|||
import com.wh.service.api.instorehouse.InStorehouseMainService; |
|||
import com.wh.service.api.prodstock.ProdStockService; |
|||
import com.wh.service.outstorehouse.PickingService; |
|||
import com.wh.vo.PageResult; |
|||
import com.wh.vo.PickingUser; |
|||
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 lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.beans.BeanUtils; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.context.annotation.Bean; |
|||
import org.springframework.stereotype.Service; |
|||
import org.springframework.transaction.annotation.Transactional; |
|||
|
|||
import java.math.BigDecimal; |
|||
import java.util.*; |
|||
|
|||
@Slf4j |
|||
@Service |
|||
public class OutStorehouseMainService extends MybatisBaseService<OutStorehouseMainMapper, OutStorehouseMain> { |
|||
@Autowired |
|||
private OutStorehouseListingService outStorehouseListingService; |
|||
@Autowired |
|||
private ProdStockService prodStockService; |
|||
@Autowired |
|||
private InStorehouseMainService inStorehouseMainService; |
|||
@Autowired |
|||
private PickingService pickingService; |
|||
@Transactional |
|||
public ResultBean addOutStorehouse(OutStorehouseMainDto outStorehouseMainDto) { |
|||
|
|||
ResultBean<Object> r = ResultBean.fireFail(); |
|||
if(outStorehouseMainDto==null){ |
|||
return r.setMsg("数据不能为空"); |
|||
} |
|||
String no = outStorehouseMainDto.getNo(); |
|||
if(StringUtils.isBlank(no)){ |
|||
return r.setMsg("编码不能为空"); |
|||
} |
|||
List<OutStorehouseListing> list = outStorehouseMainDto.getList(); |
|||
if(list==null||list.size()==0){ |
|||
return r.setMsg("商品信息不能为空"); |
|||
} |
|||
if(com.yxt.common.base.utils.StringUtils.isNotBlank(outStorehouseMainDto.getSid())){ |
|||
String sid = outStorehouseMainDto.getSid(); |
|||
OutStorehouseMain outStorehouseMain = fetchBySid(sid); |
|||
outStorehouseMain.setApplicationDate(outStorehouseMainDto.getApplicationDate()); |
|||
outStorehouseMain.setCreatorName(outStorehouseMainDto.getCreatorName()); |
|||
outStorehouseMain.setNo(outStorehouseMainDto.getNo()); //varchar 50 编号
|
|||
outStorehouseMain.setCusterSid(outStorehouseMainDto.getCusterSid()); //varchar 64 客户Sid(企业)
|
|||
outStorehouseMain.setCusterName(outStorehouseMainDto.getCusterName()); // varchar 100 客户名称(企业)
|
|||
outStorehouseMain.setStoreHouseSid(outStorehouseMainDto.getStoreHouseSid()); // varchar 64 仓库Sid
|
|||
outStorehouseMain.setStoreHouseName(outStorehouseMainDto.getStoreHouseName()); // varchar 100 仓库名称
|
|||
outStorehouseMain.setOutDate(outStorehouseMainDto.getOutDate()); //出库日期
|
|||
baseMapper.updateById(outStorehouseMain); |
|||
outStorehouseListingService.deleteByMainSid(sid); |
|||
try{ |
|||
boolean b = validaProStock(list,outStorehouseMain); |
|||
if(!b){ |
|||
return r.setMsg("出库数量大于库存数量"); |
|||
} |
|||
}catch (Exception e){ |
|||
return r.setMsg(e.getMessage()); |
|||
} |
|||
addListing(outStorehouseMain, list); |
|||
return r.success(); |
|||
} |
|||
QueryWrapper<OutStorehouseMain> queryWrapper = new QueryWrapper<>(); |
|||
queryWrapper.eq("no",outStorehouseMainDto.getNo()); |
|||
if(baseMapper.selectCount(queryWrapper) != 0){ |
|||
return r.setMsg("申请单编号已经存在"); |
|||
} |
|||
OutStorehouseMain out=new OutStorehouseMain(); |
|||
BeanUtils.copyProperties(outStorehouseMainDto,out); |
|||
out.setSid(UUID.randomUUID().toString()); |
|||
try{ |
|||
boolean b = validaProStock(list,out); |
|||
if(!b){ |
|||
return r.setMsg("出库数量大于库存数量"); |
|||
} |
|||
}catch (Exception e){ |
|||
return r.setMsg(e.getMessage()); |
|||
} |
|||
//申请单主表信息
|
|||
baseMapper.insert(out); |
|||
addListing(out, list); |
|||
return ResultBean.fireSuccess().setMsg("添加成功").setData(out); |
|||
} |
|||
/** |
|||
* 新增商品信息 |
|||
* @param out |
|||
* @param list |
|||
*/ |
|||
@Transactional |
|||
public void addListing(OutStorehouseMain out, List<OutStorehouseListing> list) throws RuntimeException{ |
|||
list.forEach(l->{ |
|||
l.setCusterSid(out.getCusterSid()); |
|||
l.setCusterName(out.getCusterName()); |
|||
l.setMainSid(out.getSid()); |
|||
outStorehouseListingService.insert(l); |
|||
// saveOrUpdateProdStock(l,out);
|
|||
}); |
|||
} |
|||
|
|||
/** |
|||
* 新增或者修改商品库存信息 |
|||
* @param l |
|||
*/ |
|||
public void saveOrUpdateProdStock(OutStorehouseListing l,OutStorehouseMain out) { |
|||
PagerVo<ProdStock> proStocks = getProdStock(l,out); |
|||
long total = proStocks.getTotal(); |
|||
if(total==0){ |
|||
throw new RuntimeException(l.getProName()+"库存信息不存在"); |
|||
}else{ |
|||
updateProdStock(l, proStocks); |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* 修改商品库存信息 |
|||
* @param l |
|||
* @param proStocks |
|||
*/ |
|||
private void updateProdStock(OutStorehouseListing l, PagerVo<ProdStock> proStocks) { |
|||
log.info("OutStorehouseMainService/updateProdStock/l:{}", JSONObject.toJSONString(l)); |
|||
log.info("OutStorehouseMainService/updateProdStock/proStocks:{}", JSONObject.toJSONString(proStocks)); |
|||
ResultBean<Object> r = ResultBean.fireFail(); |
|||
ProdStock prodStock = proStocks.getRecords().get(0); |
|||
String num = prodStock.getNum(); |
|||
if(com.yxt.common.base.utils.StringUtils.isBlank(num)){ |
|||
// log.info("{}",l.getProName()+"商品数量不能为空");
|
|||
} |
|||
if(Integer.valueOf(l.getRealityNum())>Integer.valueOf(num)){ |
|||
throw new RuntimeException(l.getProName()+"出库信息超出库存信息"); |
|||
} |
|||
int i=Integer.valueOf(num)-Integer.valueOf(l.getRealityNum()); |
|||
prodStock.setNum(i+""); |
|||
String mainSid = l.getMainSid(); |
|||
QueryWrapper<OutStorehouseMain> queryWrapper = new QueryWrapper<>(); |
|||
queryWrapper.eq("sid",mainSid); |
|||
OutStorehouseMain outStorehouseMain = baseMapper.selectOne(queryWrapper); |
|||
outStorehouseMain.setModifyTime(new Date()); |
|||
outStorehouseMain.setState(2); |
|||
baseMapper.updateById(outStorehouseMain); |
|||
BigDecimal multiply = new BigDecimal(prodStock.getNum()).multiply(new BigDecimal(prodStock.getConfirmedPrice())); |
|||
prodStockService.updateByProdStockId(prodStock.getNum(),multiply.toString(),prodStock.getId()); |
|||
|
|||
} |
|||
|
|||
/** |
|||
* 验证库存信息 |
|||
* @param list |
|||
* @return |
|||
* @throws RuntimeException |
|||
*/ |
|||
private boolean validaProStock(List<OutStorehouseListing> list,OutStorehouseMain out) throws RuntimeException{ |
|||
list.forEach(l->{ |
|||
PagerVo<ProdStock> prodStock = getProdStock(l,out); |
|||
long total = prodStock.getTotal(); |
|||
if(total==0){ |
|||
throw new RuntimeException(l.getProName()+"不存在库存"); // 抛出异常,事务回滚,
|
|||
} |
|||
ProdStock prodStock1 = prodStock.getRecords().get(0); |
|||
String num = prodStock1.getNum(); |
|||
int r=Integer.valueOf(num)-Integer.valueOf(l.getRealityNum()); |
|||
if(r<0){ |
|||
throw new RuntimeException(l.getProName()+"出库数量超出库存"); // 抛出异常,事务回滚,
|
|||
} |
|||
}); |
|||
return true; |
|||
} |
|||
|
|||
/** |
|||
* 根据商品的名称 规格 客户查询库存信息 |
|||
* @param l |
|||
* @return |
|||
*/ |
|||
private PagerVo<ProdStock> getProdStock(OutStorehouseListing l,OutStorehouseMain out) { |
|||
PagerQuery<ProdStockQuery> pq=new PagerQuery<>(); |
|||
pq.setCurrent(0); |
|||
pq.setSize(10); |
|||
ProdStockQuery stockQuery = new ProdStockQuery(); |
|||
stockQuery.setCusterSid(out.getCusterSid()); |
|||
stockQuery.setProModel(l.getProModel()); |
|||
stockQuery.setProName(l.getProName()); |
|||
stockQuery.setProSid(l.getProSid()); |
|||
stockQuery.setStoreHouseSid(l.getStoreHouseSid()); |
|||
stockQuery.setLocationId(l.getLocationId()); |
|||
stockQuery.setLocationNumber(l.getLocationNumber()); |
|||
pq.setParams(stockQuery); |
|||
PagerVo<ProdStock> proStocks = prodStockService.getProStocks(pq); |
|||
return proStocks; |
|||
} |
|||
|
|||
public PagerVo<OutStorehouseVo> listPage(PagerQuery<OutStorehouseMainQuery> pq) { |
|||
OutStorehouseMainQuery query = pq.getParams(); |
|||
QueryWrapper<OutStorehouseVo> qw = createQueryWrapper(query); |
|||
IPage<OutStorehouseVo> page = PagerUtil.queryToPage(pq); |
|||
IPage<OutStorehouseVo> pagging = baseMapper.selectPageVo(page, qw); |
|||
PagerVo<OutStorehouseVo> p = PagerUtil.pageToVo(pagging, null); |
|||
return p; |
|||
} |
|||
private QueryWrapper<OutStorehouseVo> createQueryWrapper(OutStorehouseMainQuery query) { |
|||
// todo: 这里根据具体业务调整查询条件
|
|||
// 多字段Like示例:qw.and(wraInStorehouseMainpper -> wrapper.like("name", query.getName()).or().like("remark", query.getName()));
|
|||
QueryWrapper<OutStorehouseVo> qw = new QueryWrapper<>(); |
|||
qw.eq("1",1); |
|||
if (org.apache.commons.lang3.StringUtils.isNotBlank(query.getNo())) { |
|||
qw.like("no", query.getNo()); |
|||
} |
|||
if (org.apache.commons.lang3.StringUtils.isNotBlank(query.getApplicationDateStart())) { |
|||
qw.ge("application_date", query.getApplicationDateStart()); |
|||
} |
|||
if (StrUtil.isNotBlank(query.getApplicationDateEnd())) { |
|||
qw.lt("application_date", query.getApplicationDateEnd()); |
|||
} |
|||
if (StrUtil.isNotBlank(query.getCreatorName())) { |
|||
qw.like("creator_name", query.getCreatorName()); |
|||
} |
|||
if (StrUtil.isNotBlank(query.getCusterName())) { |
|||
qw.like("custer_name", query.getCusterName()); |
|||
} |
|||
if (StrUtil.isNotBlank(query.getCusterSid())) { |
|||
qw.eq("custer_sid", query.getCusterSid()); |
|||
} |
|||
|
|||
if (StrUtil.isNotBlank(query.getState())) { |
|||
qw.like("state", query.getState()); |
|||
} |
|||
qw.orderByDesc("id"); |
|||
return qw; |
|||
} |
|||
|
|||
public ResultBean getOutStorehouse(String sid) { |
|||
ResultBean<Object> r = ResultBean.fireFail(); |
|||
OutStorehouseMain outStorehouseMain = baseMapper.selectOne( |
|||
new QueryWrapper<OutStorehouseMain>().eq("sid",sid)); |
|||
if(outStorehouseMain==null){ |
|||
return r.setMsg("数据不存在"); |
|||
} |
|||
OutStorehouseDetailVo osv=new OutStorehouseDetailVo(); |
|||
BeanUtils.copyProperties(outStorehouseMain,osv); |
|||
List<OutStorehouseListing> list=outStorehouseListingService.selectInStorehouseListingsByMainSid(sid); |
|||
osv.setList(list); |
|||
return ResultBean.fireSuccess().setData(osv); |
|||
} |
|||
@Transactional |
|||
public int deleteOutStorehouseMainBySid(String sid) { |
|||
int i = deleteBySid(sid); |
|||
List<OutStorehouseListing> list=outStorehouseListingService.selectInStorehouseListingsByMainSid(sid); |
|||
int ii=outStorehouseListingService.deleteByMainSid(sid); |
|||
// list.forEach(l->{
|
|||
// prodStockService.addNumByProdSidAndCustSid(l.getProSid(), l.getCusterSid(),l.getRealityNum(),
|
|||
// l.getStoreHouseSid(), l.getLocationNumber());
|
|||
// });
|
|||
return i; |
|||
} |
|||
@Transactional |
|||
public ResultBean importOutStorehouse(OutStorehouseMainDto outStorehouseMainDto) { |
|||
ResultBean resultBean = addOutStorehouse(outStorehouseMainDto); |
|||
if(!resultBean.getSuccess()){ |
|||
return resultBean; |
|||
} |
|||
OutStorehouseMain out = (OutStorehouseMain) resultBean.getData(); |
|||
PickingUser pu=new PickingUser(); |
|||
pu.setOutStorehouseId(out.getSid()); |
|||
ResultBean picking = pickingService.picking(pu); |
|||
return picking; |
|||
} |
|||
|
|||
public List<OutStorehouseMain> listAllForPicking(OutStorehouseMainQuery pq) { |
|||
return baseMapper.listAllForPicking(pq.getCusterSid()); |
|||
} |
|||
} |
@ -0,0 +1,127 @@ |
|||
package com.wh.service.api.prodstock; |
|||
|
|||
|
|||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|||
import com.wh.mapper.api.prodstock.ProdStockMapper; |
|||
import com.wh.pojo.Product; |
|||
import com.wh.pojo.api.*; |
|||
import com.wh.service.initial.ProductService; |
|||
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 lombok.extern.slf4j.Slf4j; |
|||
import org.apache.commons.lang3.StringUtils; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
import org.springframework.transaction.annotation.Transactional; |
|||
|
|||
import java.util.ArrayList; |
|||
import java.util.HashMap; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
@Slf4j |
|||
@Service |
|||
public class ProdStockService extends MybatisBaseService<ProdStockMapper, ProdStock> { |
|||
@Autowired |
|||
private ProductService productService; |
|||
public PagerVo<ProdStock> getProStocks(PagerQuery<ProdStockQuery> pq ) { |
|||
ProdStockQuery params = pq.getParams(); |
|||
QueryWrapper<ProdStock> qw = createQueryWrapper(params); |
|||
IPage<ProdStock> page = PagerUtil.queryToPage(pq); |
|||
IPage<ProdStock> pagging = baseMapper.selectPage(page, qw); |
|||
PagerVo<ProdStock> p = PagerUtil.pageToVo(pagging, null); |
|||
Integer integer = baseMapper.selectCount(qw); |
|||
p.setTotal(integer); |
|||
return p; |
|||
} |
|||
|
|||
public PagerVo<ProdStockVo> listPage(PagerQuery<ProdStockQuery> pq) { |
|||
ProdStockQuery query = pq.getParams(); |
|||
QueryWrapper<ProdStock> qw = createQueryWrapper(query); |
|||
IPage<ProdStock> page = PagerUtil.queryToPage(pq); |
|||
IPage<ProdStock> prodStockIPage = baseMapper.selectPage(page, qw); |
|||
PagerVo<ProdStockVo> p = PagerUtil.pageToVo(prodStockIPage, null); |
|||
return p; |
|||
} |
|||
private QueryWrapper<ProdStock> createQueryWrapper(ProdStockQuery query) { |
|||
// todo: 这里根据具体业务调整查询条件
|
|||
// 多字段Like示例:qw.and(wrapper -> wrapper.like("name", query.getName()).or().like("remark", query.getName()));
|
|||
QueryWrapper<ProdStock> qw = new QueryWrapper<>(); |
|||
|
|||
if (StringUtils.isNotBlank(query.getCusterSid())) { |
|||
qw.eq("custer_sid", query.getCusterSid()); |
|||
} |
|||
if (StringUtils.isNotBlank(query.getProName())) { |
|||
qw.eq("pro_name", query.getProName()); |
|||
} |
|||
if (StringUtils.isNotBlank(query.getProModel())) { |
|||
qw.eq("pro_model", query.getProModel()); |
|||
} |
|||
if (StringUtils.isNotBlank(query.getProSid())) { |
|||
qw.eq("pro_sid", query.getProSid()); |
|||
} |
|||
if (StringUtils.isNotBlank(query.getLocationNumber())) { |
|||
qw.eq("location_number", query.getLocationNumber()); |
|||
} |
|||
if(StringUtils.isNotBlank(query.getStoreHouseSid())){ |
|||
qw.eq("store_house_sid",query.getStoreHouseSid()); |
|||
} |
|||
return qw; |
|||
} |
|||
|
|||
public void reduceNumByProdSidAndCustSid(String proSid, String custerSid, String num) { |
|||
log.info("reduceNumByProdSidAndCustSid:{},{},{}",proSid,custerSid,num); |
|||
baseMapper.reduceNumByProdSidAndCustSid(proSid,custerSid,num); |
|||
} |
|||
public void addNumByProdSidAndCustSid(String proSid, String custerSid, String num, String storehousesid, String locationnum) { |
|||
log.info("addNumByProdSidAndCustSid:{},{},{}",proSid,custerSid,num); |
|||
baseMapper.addNumByProdSidAndCustSid(proSid,custerSid,storehousesid,locationnum,num); |
|||
} |
|||
@Transactional |
|||
public List<ProdStock> importStock(List<ProdStock> list) { |
|||
List<ProdStock> r=new ArrayList<>(); |
|||
for (ProdStock l : list) { |
|||
String storeHouseSid = l.getStoreHouseSid(); |
|||
String custerSid = l.getCusterSid(); |
|||
String proSid = l.getProSid(); |
|||
if(StringUtils.isBlank(storeHouseSid)|| |
|||
/* StringUtils.isBlank(custerSid)||*/ |
|||
StringUtils.isBlank(proSid)|| |
|||
StringUtils.isBlank(l.getProName())|| |
|||
/* StringUtils.isBlank(l.getProModel())||*/ |
|||
StringUtils.isBlank(l.getLocationId())|| |
|||
StringUtils.isBlank(l.getLocationNumber())){ |
|||
r.add(l); |
|||
continue; |
|||
} |
|||
Map<String, Object> columnMap=new HashMap<>(); |
|||
columnMap.put("store_house_sid",storeHouseSid); |
|||
// columnMap.put("custer_sid",custerSid);
|
|||
columnMap.put("pro_sid",proSid); |
|||
columnMap.put("pro_model",l.getProModel()); |
|||
columnMap.put("pro_name",l.getProName()); |
|||
baseMapper.deleteByMap(columnMap); //依据最新的库存为准 之前的库存删了
|
|||
baseMapper.insert(l); |
|||
|
|||
ResultBean productListByNameAndCode = productService.getProductListByNameAndCode(l.getProName(), proSid); |
|||
if (productListByNameAndCode.getSuccess()){ |
|||
List<Product> data = (List<Product>) productListByNameAndCode.getData(); |
|||
if(data.size()==0){ |
|||
Product product=new Product(); |
|||
product.setName(l.getProName()); |
|||
product.setBarCode(proSid); |
|||
productService.addProduct(product); |
|||
} |
|||
} |
|||
} |
|||
return r; |
|||
} |
|||
|
|||
public void updateByProdStockId(String num, String value, Integer id) { |
|||
baseMapper.updateByProdStockId(num,value,id); |
|||
} |
|||
} |
@ -0,0 +1,113 @@ |
|||
/********************************************************* |
|||
********************************************************* |
|||
******************** ******************* |
|||
************* ************ |
|||
******* _oo0oo_ ******* |
|||
*** o8888888o *** |
|||
* 88" . "88 * |
|||
* (| -_- |) * |
|||
* 0\ = /0 * |
|||
* ___/`---'\___ * |
|||
* .' \\| |// '. *
|
|||
* / \\||| : |||// \ *
|
|||
* / _||||| -:- |||||- \ * |
|||
* | | \\\ - /// | | *
|
|||
* | \_| ''\---/'' |_/ | * |
|||
* \ .-\__ '-' ___/-. / * |
|||
* ___'. .' /--.--\ `. .'___ * |
|||
* ."" '< `.___\_<|>_/___.' >' "". * |
|||
* | | : `- \`.;`\ _ /`;.`/ - ` : | | * |
|||
* \ \ `_. \_ __\ /__ _/ .-` / / * |
|||
* =====`-.____`.___ \_____/___.-`___.-'===== * |
|||
* `=---=' * |
|||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * |
|||
*********__佛祖保佑__永无BUG__验收通过__钞票多多__********* |
|||
*********************************************************/ |
|||
package com.wh.service.brandinfo; |
|||
|
|||
import cn.hutool.core.bean.BeanUtil; |
|||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|||
import com.wh.mapper.brandinfo.BrandInfoMapper; |
|||
import com.wh.pojo.brandinfo.*; |
|||
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.vo.PagerVo; |
|||
import org.apache.commons.lang3.StringUtils; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
|
|||
/** |
|||
* Project: yxt_supervise(宇信通监管) <br/> |
|||
* File: BrandInfoService.java <br/> |
|||
* Class: com.supervise.biz.brandinfo.BrandInfoService <br/> |
|||
* Description: 品牌信息 业务逻辑. <br/> |
|||
* Copyright: Copyright (c) 2011 <br/> |
|||
* Company: https://gitee.com/liuzp315 <br/>
|
|||
* Makedate: 2022-11-11 11:40:28 <br/> |
|||
* |
|||
* @author dongjianzhao |
|||
* @version 1.0 |
|||
* @since 1.0 |
|||
*/ |
|||
@Service |
|||
public class BrandInfoService extends MybatisBaseService<BrandInfoMapper, BrandInfo> { |
|||
private QueryWrapper<BrandInfo> createQueryWrapper(BrandInfoQuery query) { |
|||
// todo: 这里根据具体业务调整查询条件
|
|||
// 多字段Like示例:qw.and(wrapper -> wrapper.like("name", query.getName()).or().like("remark", query.getName()));
|
|||
QueryWrapper<BrandInfo> qw = new QueryWrapper<>(); |
|||
return qw; |
|||
} |
|||
|
|||
public PagerVo<BrandInfoVo> listPageVo(PagerQuery<BrandInfoQuery> pq) { |
|||
BrandInfoQuery query = pq.getParams(); |
|||
QueryWrapper<BrandInfo> qw = createQueryWrapper(query); |
|||
IPage<BrandInfo> page = PagerUtil.queryToPage(pq); |
|||
IPage<BrandInfoVo> pagging = baseMapper.selectPageVo(page, qw); |
|||
PagerVo<BrandInfoVo> p = PagerUtil.pageToVo(pagging, null); |
|||
return p; |
|||
} |
|||
|
|||
public void saveOrUpdateDto(BrandInfoDto dto){ |
|||
String dtoSid = dto.getSid(); |
|||
if (StringUtils.isBlank(dtoSid)) { |
|||
this.insertByDto(dto); |
|||
return; |
|||
} |
|||
this.updateByDto(dto); |
|||
} |
|||
|
|||
public void insertByDto(BrandInfoDto dto){ |
|||
BrandInfo entity = new BrandInfo(); |
|||
BeanUtil.copyProperties(dto, entity, "id", "sid"); |
|||
baseMapper.insert(entity); |
|||
} |
|||
|
|||
public void updateByDto(BrandInfoDto dto){ |
|||
String dtoSid = dto.getSid(); |
|||
if (StringUtils.isBlank(dtoSid)) { |
|||
return; |
|||
} |
|||
BrandInfo entity = fetchBySid(dtoSid); |
|||
BeanUtil.copyProperties(dto, entity, "id", "sid"); |
|||
baseMapper.updateById(entity); |
|||
} |
|||
|
|||
public BrandInfoDetailsVo fetchDetailsVoBySid(String sid){ |
|||
BrandInfo entity = fetchBySid(sid); |
|||
BrandInfoDetailsVo vo = new BrandInfoDetailsVo(); |
|||
BeanUtil.copyProperties(entity, vo); |
|||
return vo; |
|||
} |
|||
|
|||
public BrandInfoVo selectByCode(String key) { |
|||
BrandInfoVo vo = baseMapper.selectByCode(key); |
|||
return vo; |
|||
} |
|||
|
|||
public BrandInfo fetchByCodeForLimit(String brandSid) { |
|||
BrandInfo vo = baseMapper.fetchByCodeForLimit(brandSid); |
|||
return vo; |
|||
} |
|||
} |
@ -0,0 +1,117 @@ |
|||
/********************************************************* |
|||
********************************************************* |
|||
******************** ******************* |
|||
************* ************ |
|||
******* _oo0oo_ ******* |
|||
*** o8888888o *** |
|||
* 88" . "88 * |
|||
* (| -_- |) * |
|||
* 0\ = /0 * |
|||
* ___/`---'\___ * |
|||
* .' \\| |// '. *
|
|||
* / \\||| : |||// \ *
|
|||
* / _||||| -:- |||||- \ * |
|||
* | | \\\ - /// | | *
|
|||
* | \_| ''\---/'' |_/ | * |
|||
* \ .-\__ '-' ___/-. / * |
|||
* ___'. .' /--.--\ `. .'___ * |
|||
* ."" '< `.___\_<|>_/___.' >' "". * |
|||
* | | : `- \`.;`\ _ /`;.`/ - ` : | | * |
|||
* \ \ `_. \_ __\ /__ _/ .-` / / * |
|||
* =====`-.____`.___ \_____/___.-`___.-'===== * |
|||
* `=---=' * |
|||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * |
|||
*********__佛祖保佑__永无BUG__验收通过__钞票多多__********* |
|||
*********************************************************/ |
|||
package com.wh.service.dictcommon; |
|||
|
|||
import cn.hutool.core.bean.BeanUtil; |
|||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|||
import com.wh.mapper.dictcommon.DictCommonMapper; |
|||
import com.wh.pojo.dictcommon.*; |
|||
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.vo.PagerVo; |
|||
import org.apache.commons.lang3.StringUtils; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
/** |
|||
* Project: yxt_supervise(宇信通监管) <br/> |
|||
* File: DictCommonService.java <br/> |
|||
* Class: com.supervise.biz.dictcommon.DictCommonService <br/> |
|||
* Description: 数据字典——数据项 业务逻辑. <br/> |
|||
* Copyright: Copyright (c) 2011 <br/> |
|||
* Company: https://gitee.com/liuzp315 <br/>
|
|||
* Makedate: 2022-11-11 11:40:29 <br/> |
|||
* |
|||
* @author dongjianzhao |
|||
* @version 1.0 |
|||
* @since 1.0 |
|||
*/ |
|||
@Service |
|||
public class DictCommonService extends MybatisBaseService<DictCommonMapper, DictCommon> { |
|||
private QueryWrapper<DictCommon> createQueryWrapper(DictCommonQuery query) { |
|||
// todo: 这里根据具体业务调整查询条件
|
|||
// 多字段Like示例:qw.and(wrapper -> wrapper.like("name", query.getName()).or().like("remark", query.getName()));
|
|||
QueryWrapper<DictCommon> qw = new QueryWrapper<>(); |
|||
return qw; |
|||
} |
|||
|
|||
public PagerVo<DictCommonVo> listPageVo(PagerQuery<DictCommonQuery> pq) { |
|||
DictCommonQuery query = pq.getParams(); |
|||
QueryWrapper<DictCommon> qw = createQueryWrapper(query); |
|||
IPage<DictCommon> page = PagerUtil.queryToPage(pq); |
|||
IPage<DictCommonVo> pagging = baseMapper.selectPageVo(page, qw); |
|||
PagerVo<DictCommonVo> p = PagerUtil.pageToVo(pagging, null); |
|||
return p; |
|||
} |
|||
|
|||
public void saveOrUpdateDto(DictCommonDto dto){ |
|||
String dtoSid = dto.getSid(); |
|||
if (StringUtils.isBlank(dtoSid)) { |
|||
this.insertByDto(dto); |
|||
return; |
|||
} |
|||
this.updateByDto(dto); |
|||
} |
|||
|
|||
public void insertByDto(DictCommonDto dto){ |
|||
DictCommon entity = new DictCommon(); |
|||
BeanUtil.copyProperties(dto, entity, "id", "sid"); |
|||
baseMapper.insert(entity); |
|||
} |
|||
|
|||
public void updateByDto(DictCommonDto dto){ |
|||
String dtoSid = dto.getSid(); |
|||
if (StringUtils.isBlank(dtoSid)) { |
|||
return; |
|||
} |
|||
DictCommon entity = fetchBySid(dtoSid); |
|||
BeanUtil.copyProperties(dto, entity, "id", "sid"); |
|||
baseMapper.updateById(entity); |
|||
} |
|||
|
|||
public DictCommonDetailsVo fetchDetailsVoBySid(String sid){ |
|||
DictCommon entity = fetchBySid(sid); |
|||
DictCommonDetailsVo vo = new DictCommonDetailsVo(); |
|||
BeanUtil.copyProperties(entity, vo); |
|||
return vo; |
|||
} |
|||
|
|||
public DictCommonDetailsVo fetchByKey(String value) { |
|||
DictCommonDetailsVo vo = baseMapper.fetchByKey(value); |
|||
return vo; |
|||
} |
|||
|
|||
public DictCommonDetailsVo fetchByKeyAndType(String value, String type) { |
|||
DictCommonDetailsVo vo = baseMapper.fetchByKeyAndType(value,type); |
|||
return vo; |
|||
} |
|||
|
|||
public DictCommonDetailsVo fetchByKeyAndTypeForLimit(String category, String categoryKey) { |
|||
DictCommonDetailsVo vo = baseMapper.fetchByKeyAndTypeForLimit(category,categoryKey); |
|||
return vo; |
|||
} |
|||
} |
@ -0,0 +1,102 @@ |
|||
/********************************************************* |
|||
********************************************************* |
|||
******************** ******************* |
|||
************* ************ |
|||
******* _oo0oo_ ******* |
|||
*** o8888888o *** |
|||
* 88" . "88 * |
|||
* (| -_- |) * |
|||
* 0\ = /0 * |
|||
* ___/`---'\___ * |
|||
* .' \\| |// '. *
|
|||
* / \\||| : |||// \ *
|
|||
* / _||||| -:- |||||- \ * |
|||
* | | \\\ - /// | | *
|
|||
* | \_| ''\---/'' |_/ | * |
|||
* \ .-\__ '-' ___/-. / * |
|||
* ___'. .' /--.--\ `. .'___ * |
|||
* ."" '< `.___\_<|>_/___.' >' "". * |
|||
* | | : `- \`.;`\ _ /`;.`/ - ` : | | * |
|||
* \ \ `_. \_ __\ /__ _/ .-` / / * |
|||
* =====`-.____`.___ \_____/___.-`___.-'===== * |
|||
* `=---=' * |
|||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * |
|||
*********__佛祖保佑__永无BUG__验收通过__钞票多多__********* |
|||
*********************************************************/ |
|||
package com.wh.service.dicttype; |
|||
|
|||
import cn.hutool.core.bean.BeanUtil; |
|||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|||
import com.wh.mapper.dicttype.DictTypeMapper; |
|||
import com.wh.pojo.dicttype.*; |
|||
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.vo.PagerVo; |
|||
import org.apache.commons.lang3.StringUtils; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
/** |
|||
* Project: yxt_supervise(宇信通监管) <br/> |
|||
* File: DictTypeService.java <br/> |
|||
* Class: com.supervise.biz.dicttype.DictTypeService <br/> |
|||
* Description: 数据字典——数据类型 业务逻辑. <br/> |
|||
* Copyright: Copyright (c) 2011 <br/> |
|||
* Company: https://gitee.com/liuzp315 <br/>
|
|||
* Makedate: 2022-11-11 11:40:29 <br/> |
|||
* |
|||
* @author dongjianzhao |
|||
* @version 1.0 |
|||
* @since 1.0 |
|||
*/ |
|||
@Service |
|||
public class DictTypeService extends MybatisBaseService<DictTypeMapper, DictType> { |
|||
private QueryWrapper<DictType> createQueryWrapper(DictTypeQuery query) { |
|||
// todo: 这里根据具体业务调整查询条件
|
|||
// 多字段Like示例:qw.and(wrapper -> wrapper.like("name", query.getName()).or().like("remark", query.getName()));
|
|||
QueryWrapper<DictType> qw = new QueryWrapper<>(); |
|||
return qw; |
|||
} |
|||
|
|||
public PagerVo<DictTypeVo> listPageVo(PagerQuery<DictTypeQuery> pq) { |
|||
DictTypeQuery query = pq.getParams(); |
|||
QueryWrapper<DictType> qw = createQueryWrapper(query); |
|||
IPage<DictType> page = PagerUtil.queryToPage(pq); |
|||
IPage<DictTypeVo> pagging = baseMapper.selectPageVo(page, qw); |
|||
PagerVo<DictTypeVo> p = PagerUtil.pageToVo(pagging, null); |
|||
return p; |
|||
} |
|||
|
|||
public void saveOrUpdateDto(DictTypeDto dto){ |
|||
String dtoSid = dto.getSid(); |
|||
if (StringUtils.isBlank(dtoSid)) { |
|||
this.insertByDto(dto); |
|||
return; |
|||
} |
|||
this.updateByDto(dto); |
|||
} |
|||
|
|||
public void insertByDto(DictTypeDto dto){ |
|||
DictType entity = new DictType(); |
|||
BeanUtil.copyProperties(dto, entity, "id", "sid"); |
|||
baseMapper.insert(entity); |
|||
} |
|||
|
|||
public void updateByDto(DictTypeDto dto){ |
|||
String dtoSid = dto.getSid(); |
|||
if (StringUtils.isBlank(dtoSid)) { |
|||
return; |
|||
} |
|||
DictType entity = fetchBySid(dtoSid); |
|||
BeanUtil.copyProperties(dto, entity, "id", "sid"); |
|||
baseMapper.updateById(entity); |
|||
} |
|||
|
|||
public DictTypeDetailsVo fetchDetailsVoBySid(String sid){ |
|||
DictType entity = fetchBySid(sid); |
|||
DictTypeDetailsVo vo = new DictTypeDetailsVo(); |
|||
BeanUtil.copyProperties(entity, vo); |
|||
return vo; |
|||
} |
|||
} |
@ -0,0 +1,119 @@ |
|||
/********************************************************* |
|||
********************************************************* |
|||
******************** ******************* |
|||
************* ************ |
|||
******* _oo0oo_ ******* |
|||
*** o8888888o *** |
|||
* 88" . "88 * |
|||
* (| -_- |) * |
|||
* 0\ = /0 * |
|||
* ___/`---'\___ * |
|||
* .' \\| |// '. *
|
|||
* / \\||| : |||// \ *
|
|||
* / _||||| -:- |||||- \ * |
|||
* | | \\\ - /// | | *
|
|||
* | \_| ''\---/'' |_/ | * |
|||
* \ .-\__ '-' ___/-. / * |
|||
* ___'. .' /--.--\ `. .'___ * |
|||
* ."" '< `.___\_<|>_/___.' >' "". * |
|||
* | | : `- \`.;`\ _ /`;.`/ - ` : | | * |
|||
* \ \ `_. \_ __\ /__ _/ .-` / / * |
|||
* =====`-.____`.___ \_____/___.-`___.-'===== * |
|||
* `=---=' * |
|||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * |
|||
*********__佛祖保佑__永无BUG__验收通过__钞票多多__********* |
|||
*********************************************************/ |
|||
package com.wh.service.entinfo; |
|||
|
|||
import cn.hutool.core.bean.BeanUtil; |
|||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|||
import com.wh.mapper.entinfo.EntInfoMapper; |
|||
import com.wh.pojo.entinfo.*; |
|||
import com.yxt.common.core.query.PagerQuery; |
|||
import com.yxt.common.core.result.ResultBean; |
|||
import com.yxt.common.core.vo.PagerVo; |
|||
import org.apache.commons.lang3.StringUtils; |
|||
import com.yxt.common.base.service.MybatisBaseService; |
|||
import com.yxt.common.base.utils.PagerUtil; |
|||
|
|||
import org.springframework.cloud.openfeign.FeignClient; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
import javax.annotation.Resource; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* Project: warehouse(仓储) <br/> |
|||
* File: EntInfoService.java <br/> |
|||
* Class: com.wh.biz.entinfo.EntInfoService <br/> |
|||
* Description: 客户信息 业务逻辑. <br/> |
|||
* Copyright: Copyright (c) 2011 <br/> |
|||
* Company: https://gitee.com/liuzp315 <br/>
|
|||
* Makedate: 2023-06-13 22:19:45 <br/> |
|||
* |
|||
* @author liupopo |
|||
* @version 1.0 |
|||
* @since 1.0 |
|||
*/ |
|||
@Service |
|||
public class EntInfoService extends MybatisBaseService<EntInfoMapper, EntInfo> { |
|||
// @Resource
|
|||
// private WhEnterpriseInformationFeign enterpriseInformationFeign;
|
|||
|
|||
private QueryWrapper<EntInfo> createQueryWrapper(EntInfoQuery query) { |
|||
// todo: 这里根据具体业务调整查询条件
|
|||
// 多字段Like示例:qw.and(wrapper -> wrapper.like("name", query.getName()).or().like("remark", query.getName()));
|
|||
QueryWrapper<EntInfo> qw = new QueryWrapper<>(); |
|||
return qw; |
|||
} |
|||
|
|||
public PagerVo<EntInfoVo> listPageVo(PagerQuery<EntInfoQuery> pq) { |
|||
EntInfoQuery query = pq.getParams(); |
|||
QueryWrapper<EntInfo> qw = createQueryWrapper(query); |
|||
IPage<EntInfo> page = PagerUtil.queryToPage(pq); |
|||
IPage<EntInfoVo> pagging = baseMapper.selectPageVo(page, qw); |
|||
PagerVo<EntInfoVo> p = PagerUtil.pageToVo(pagging, null); |
|||
return p; |
|||
} |
|||
|
|||
public void saveOrUpdateDto(EntInfoDto dto){ |
|||
String dtoSid = dto.getSid(); |
|||
if (StringUtils.isBlank(dtoSid)) { |
|||
this.insertByDto(dto); |
|||
return; |
|||
} |
|||
this.updateByDto(dto); |
|||
} |
|||
|
|||
public void insertByDto(EntInfoDto dto){ |
|||
EntInfo entity = new EntInfo(); |
|||
BeanUtil.copyProperties(dto, entity, "id", "sid"); |
|||
baseMapper.insert(entity); |
|||
} |
|||
|
|||
public void updateByDto(EntInfoDto dto){ |
|||
String dtoSid = dto.getSid(); |
|||
if (StringUtils.isBlank(dtoSid)) { |
|||
return; |
|||
} |
|||
EntInfo entity = fetchBySid(dtoSid); |
|||
BeanUtil.copyProperties(dto, entity, "id", "sid"); |
|||
baseMapper.updateById(entity); |
|||
} |
|||
|
|||
public EntInfoDetailsVo fetchDetailsVoBySid(String sid){ |
|||
EntInfo entity = fetchBySid(sid); |
|||
EntInfoDetailsVo vo = new EntInfoDetailsVo(); |
|||
BeanUtil.copyProperties(entity, vo); |
|||
return vo; |
|||
} |
|||
|
|||
// public List<WhEnterpriseInformationVo> listAll() {
|
|||
// PagerQuery<WhEnterpriseInformationQuery> pq=new PagerQuery<>();
|
|||
// pq.setSize(10000);
|
|||
// ResultBean<PagerVo<WhEnterpriseInformationVo>> pagerVoResultBean =
|
|||
// enterpriseInformationFeign.listPage(pq);
|
|||
// return pagerVoResultBean.getData().getRecords();
|
|||
// }
|
|||
} |
@ -0,0 +1,29 @@ |
|||
package com.wh.service.initial; |
|||
|
|||
import com.wh.pojo.*; |
|||
import com.wh.vo.PageResult; |
|||
import com.yxt.common.core.query.PagerQuery; |
|||
import com.yxt.common.core.vo.PagerVo; |
|||
|
|||
import java.util.List; |
|||
|
|||
public interface LocationService { |
|||
PageResult getLocationList(PageResult pageResult); |
|||
PagerVo<Location> getSupplierList(PagerQuery<LocationQuery> pq); |
|||
void addLocation(Location location); |
|||
|
|||
void updataLocation(Location location); |
|||
int deleteById(String id); |
|||
void deleteLocation(String name); |
|||
Location getLocationById(String id); |
|||
List<Storehouse> getStorehouse(); |
|||
|
|||
List<LocationType> getType(); |
|||
|
|||
List<Location> getLocations(); |
|||
|
|||
List<LocationVo> getLocationsByStoreId(String id); |
|||
|
|||
|
|||
List<Location> getLocationByLocationId(String locationId); |
|||
} |
@ -0,0 +1,118 @@ |
|||
package com.wh.service.initial; |
|||
|
|||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|||
import com.wh.mapper.initial.LocationMapper; |
|||
import com.wh.mapper.initial.LocationTypeMapper; |
|||
import com.wh.mapper.initial.StorehouseMapper; |
|||
import com.wh.pojo.*; |
|||
import com.wh.vo.PageResult; |
|||
import com.yxt.common.core.query.PagerQuery; |
|||
import com.yxt.common.core.vo.PagerVo; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
import org.springframework.util.StringUtils; |
|||
|
|||
import java.util.List; |
|||
|
|||
@Service |
|||
public class LocationServiceImpl implements LocationService{ |
|||
|
|||
@Autowired |
|||
private LocationTypeMapper locationTypeMapper; |
|||
|
|||
@Autowired |
|||
private StorehouseMapper storehouseMapper; |
|||
|
|||
@Autowired |
|||
private LocationMapper locationMapper; |
|||
|
|||
@Override |
|||
public PageResult getLocationList(PageResult pageResult) { |
|||
Page<Location> locationPage = new Page<>(pageResult.getPageNum(),pageResult.getPageSize()); |
|||
QueryWrapper<Location> queryWrapper = new QueryWrapper<>(); |
|||
boolean flag = StringUtils.hasLength(pageResult.getQuery()); |
|||
queryWrapper.like(flag,"name",pageResult.getQuery()); |
|||
locationPage = locationMapper.selectPage(locationPage,queryWrapper); |
|||
pageResult.setTotal((long) locationPage.getRecords().size()).setRows(locationPage.getRecords()); |
|||
|
|||
return pageResult; |
|||
} |
|||
|
|||
@Override |
|||
public PagerVo<Location> getSupplierList(PagerQuery<LocationQuery> pq) { |
|||
Page<Location> locationPage = new Page<>(pq.getCurrent(),pq.getSize()); |
|||
QueryWrapper<Location> queryWrapper = new QueryWrapper<>(); |
|||
String name = pq.getParams().getName(); |
|||
String storehouseid = pq.getParams().getStorehouseid(); |
|||
if(!StringUtils.isEmpty(name)){ |
|||
queryWrapper.like("name",name); |
|||
} |
|||
if(!StringUtils.isEmpty(storehouseid)){ |
|||
queryWrapper.eq("storehouseid",storehouseid); |
|||
} |
|||
|
|||
locationPage = locationMapper.selectPage(locationPage,queryWrapper); |
|||
Integer integer = locationMapper.selectCount(queryWrapper); |
|||
PagerVo<Location> pv=new PagerVo<>(); |
|||
pv.setCurrent(pq.getCurrent()); |
|||
pv.setTotal(integer); |
|||
pv.setSize(pq.getSize()); |
|||
pv.setRecords(locationPage.getRecords()); |
|||
return pv; |
|||
} |
|||
|
|||
@Override |
|||
public void addLocation(Location location) { |
|||
locationMapper.insert(location); |
|||
} |
|||
|
|||
@Override |
|||
public void updataLocation(Location location) { |
|||
locationMapper.updateById(location); |
|||
} |
|||
|
|||
@Override |
|||
public int deleteById(String id) { |
|||
return locationMapper.deleteById(id); |
|||
} |
|||
|
|||
@Override |
|||
public void deleteLocation(String name) { |
|||
locationMapper.deleteById(name); |
|||
} |
|||
|
|||
@Override |
|||
public Location getLocationById(String id) { |
|||
return locationMapper.selectById(id); |
|||
} |
|||
|
|||
@Override |
|||
public List<Storehouse> getStorehouse() { |
|||
return storehouseMapper.selectList(null); |
|||
} |
|||
|
|||
@Override |
|||
public List<LocationType> getType() { |
|||
return locationTypeMapper.selectList(null); |
|||
} |
|||
|
|||
@Override |
|||
public List<Location> getLocations() { |
|||
return locationMapper.listAll(); |
|||
} |
|||
|
|||
@Override |
|||
public List<LocationVo> getLocationsByStoreId(String id) { |
|||
return locationMapper.getLocationsByStoreId(id); |
|||
} |
|||
|
|||
@Override |
|||
public List<Location> getLocationByLocationId(String locationId) { |
|||
QueryWrapper<Location> queryWrapper = new QueryWrapper<>(); |
|||
queryWrapper.eq("location_id",locationId); |
|||
List<Location> locations = locationMapper.selectList(queryWrapper); |
|||
return locations; |
|||
} |
|||
|
|||
} |
@ -0,0 +1,48 @@ |
|||
package com.wh.service.initial; |
|||
|
|||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|||
import com.wh.pojo.Product; |
|||
import com.wh.pojo.ProductQuery; |
|||
import com.wh.pojo.Storehouse; |
|||
import com.wh.pojo.shstorehouse.ShStorehouseVo; |
|||
import com.wh.vo.PageResult; |
|||
import com.yxt.common.core.query.PagerQuery; |
|||
import com.yxt.common.core.result.ResultBean; |
|||
import com.yxt.common.core.vo.PagerVo; |
|||
import org.springframework.util.StringUtils; |
|||
|
|||
import java.util.List; |
|||
|
|||
public interface ProductService { |
|||
PagerVo<Product> getProductList(PagerQuery<ProductQuery> pq); |
|||
|
|||
void addProduct(Product product); |
|||
|
|||
void updataProduct(Product product); |
|||
|
|||
void deleteProduct(String barCode); |
|||
|
|||
List<Storehouse> getStorehouse(); |
|||
|
|||
/** |
|||
* 根据名称 code去查询商品 |
|||
* @param name |
|||
* @param code |
|||
* @return |
|||
*/ |
|||
public ResultBean<List<Product>> getProductListByNameAndCode(String name, String code) ; |
|||
|
|||
/** |
|||
* 根据名称 去查询商品 |
|||
* @param name |
|||
* @return |
|||
*/ |
|||
public ResultBean<List<Product>> getProductListByName(String name) ; |
|||
|
|||
/** |
|||
* 根据 code 去查询商品 |
|||
* @param code |
|||
* @return |
|||
*/ |
|||
public ResultBean<List<Product>> getProductListByCode(String code); |
|||
} |
@ -0,0 +1,95 @@ |
|||
package com.wh.service.initial; |
|||
|
|||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|||
import com.wh.mapper.initial.ProductMapper; |
|||
import com.wh.mapper.initial.StorehouseMapper; |
|||
import com.wh.pojo.Product; |
|||
import com.wh.pojo.ProductQuery; |
|||
import com.wh.pojo.Storehouse; |
|||
import com.wh.pojo.shstorehouse.ShStorehouseVo; |
|||
import com.wh.vo.PageResult; |
|||
import com.yxt.common.core.query.PagerQuery; |
|||
import com.yxt.common.core.result.ResultBean; |
|||
import com.yxt.common.core.vo.PagerVo; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
import org.springframework.util.StringUtils; |
|||
|
|||
import java.util.HashMap; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
@Service |
|||
public class ProductServiceImpl implements ProductService{ |
|||
|
|||
@Autowired |
|||
private StorehouseMapper storehouseMapper; |
|||
|
|||
@Autowired |
|||
private ProductMapper productMapper; |
|||
|
|||
@Override |
|||
public PagerVo<Product> getProductList(PagerQuery<ProductQuery> pq) { |
|||
Page<Product> productPage = new Page<>(pq.getCurrent(),pq.getSize()); |
|||
QueryWrapper<Product> queryWrapper = new QueryWrapper<>(); |
|||
String name = pq.getParams().getName(); |
|||
if(!StringUtils.isEmpty(name)){ |
|||
queryWrapper.like("name",name); |
|||
} |
|||
productPage = productMapper.selectPage(productPage,queryWrapper); |
|||
Integer integer = productMapper.selectCount(queryWrapper); |
|||
// PageResult pageResult=new PageResult();
|
|||
// pageResult.setTotal((long) productPage.getRecords().size()).setRows(productPage.getRecords());
|
|||
PagerVo<Product> pv=new PagerVo<>(); |
|||
pv.setCurrent(pq.getCurrent()); |
|||
pv.setTotal(integer); |
|||
pv.setSize(pq.getSize()); |
|||
pv.setRecords(productPage.getRecords()); |
|||
// System.out.println(productPage.getRecords().size());
|
|||
return pv; |
|||
} |
|||
public ResultBean<List<Product>> getProductListByNameAndCode(String name,String code) { |
|||
ResultBean rb=ResultBean.fireFail(); |
|||
QueryWrapper<Product> queryWrapper = new QueryWrapper<>(); |
|||
if(StringUtils.isEmpty(name)&&StringUtils.isEmpty(code)){ |
|||
return rb.setMsg("参数为空"); |
|||
} |
|||
if (!StringUtils.isEmpty(name)){ |
|||
queryWrapper.eq("name",name); |
|||
} |
|||
if (!StringUtils.isEmpty(code)){ |
|||
queryWrapper.eq("bar_code",code); |
|||
} |
|||
List<Product> products = productMapper.selectList(queryWrapper); |
|||
return rb.success().setData(products); |
|||
} |
|||
public ResultBean<List<Product>> getProductListByName(String name) { |
|||
return getProductListByNameAndCode(name,null); |
|||
} |
|||
public ResultBean<List<Product>> getProductListByCode(String code) { |
|||
return getProductListByNameAndCode(null,code); |
|||
} |
|||
@Override |
|||
public void addProduct(Product product) { |
|||
productMapper.insert(product); |
|||
} |
|||
|
|||
@Override |
|||
public void updataProduct(Product product) { |
|||
productMapper.updateById(product); |
|||
} |
|||
|
|||
@Override |
|||
public void deleteProduct(String barCode) { |
|||
Map<String,Object> map = new HashMap<>(); |
|||
map.put("bar_code",barCode); |
|||
productMapper.deleteByMap(map); |
|||
} |
|||
|
|||
@Override |
|||
public List<Storehouse> getStorehouse() { |
|||
List<Storehouse> storehouses = storehouseMapper.selectList(null); |
|||
return storehouses; |
|||
} |
|||
} |
@ -0,0 +1,14 @@ |
|||
package com.wh.service.initial; |
|||
|
|||
import com.wh.pojo.Storehouse; |
|||
import com.wh.vo.PageResult; |
|||
|
|||
public interface StorehouseService { |
|||
PageResult getStorehouseList(PageResult pageResult); |
|||
|
|||
void addStorehouse(Storehouse storehouse); |
|||
|
|||
void updataStorehouse(Storehouse storehouse); |
|||
|
|||
void deleteStorehouse(String name) throws Exception; |
|||
} |
@ -0,0 +1,67 @@ |
|||
package com.wh.service.initial; |
|||
|
|||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|||
import com.wh.mapper.initial.LocationMapper; |
|||
import com.wh.mapper.initial.StorehouseMapper; |
|||
import com.wh.pojo.Location; |
|||
import com.wh.pojo.Storehouse; |
|||
import com.wh.vo.PageResult; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
import org.springframework.util.StringUtils; |
|||
|
|||
import java.util.List; |
|||
|
|||
@Service |
|||
public class StorehouseServiceImpl implements StorehouseService{ |
|||
|
|||
@Autowired |
|||
private StorehouseMapper storehouseMapper; |
|||
|
|||
|
|||
@Autowired |
|||
private LocationMapper locationMapper; |
|||
|
|||
@Override |
|||
public PageResult getStorehouseList(PageResult pageResult) { |
|||
Page<Storehouse> storehousePage = new Page<>(pageResult.getPageNum(),pageResult.getPageSize()); |
|||
QueryWrapper<Storehouse> queryWrapper = new QueryWrapper<>(); |
|||
boolean flag = StringUtils.hasLength(pageResult.getQuery()); |
|||
String query = pageResult.getQuery(); |
|||
String entSid=pageResult.getEntSid(); |
|||
if(org.apache.commons.lang3.StringUtils.isNotBlank(query)){ |
|||
queryWrapper.like(flag,"name",query); |
|||
} |
|||
if(org.apache.commons.lang3.StringUtils.isNotBlank(entSid)){ |
|||
queryWrapper.eq(flag,"ent_sid",entSid); |
|||
} |
|||
storehousePage = storehouseMapper.selectPage(storehousePage,queryWrapper); |
|||
pageResult.setTotal((long) storehousePage.getRecords().size()).setRows(storehousePage.getRecords()); |
|||
|
|||
return pageResult; |
|||
} |
|||
|
|||
@Override |
|||
public void addStorehouse(Storehouse storehouse) { |
|||
storehouseMapper.insert(storehouse); |
|||
} |
|||
|
|||
@Override |
|||
public void updataStorehouse(Storehouse storehouse) { |
|||
storehouseMapper.updateById(storehouse); |
|||
} |
|||
|
|||
@Override |
|||
public void deleteStorehouse(String name) throws Exception { |
|||
Storehouse storehouse = storehouseMapper.selectById(name); |
|||
|
|||
QueryWrapper<Location> queryWrapper = new QueryWrapper<>(); |
|||
queryWrapper.eq("storehouse",name); |
|||
List<Location> locationList = locationMapper.selectList(queryWrapper); |
|||
if (locationList.size() != 0) throw new Exception("出库中有货位"); |
|||
|
|||
|
|||
storehouseMapper.deleteById(name); |
|||
} |
|||
} |
@ -0,0 +1,22 @@ |
|||
package com.wh.service.initial; |
|||
|
|||
|
|||
import com.wh.pojo.Supplier; |
|||
import com.wh.pojo.SupplierQuery; |
|||
import com.wh.vo.PageResult; |
|||
import com.yxt.common.core.query.PagerQuery; |
|||
import com.yxt.common.core.vo.PagerVo; |
|||
|
|||
import java.util.List; |
|||
|
|||
public interface SupplierService { |
|||
PageResult getSupplierList(PageResult pageResult); |
|||
PagerVo<Supplier> getSupplierList(PagerQuery<SupplierQuery> pq); |
|||
void addSupplier(Supplier supplier); |
|||
|
|||
void updataSupplier(Supplier supplier); |
|||
|
|||
void deleteSupplier(String name); |
|||
|
|||
List<Supplier> listAll(); |
|||
} |
@ -0,0 +1,78 @@ |
|||
package com.wh.service.initial; |
|||
|
|||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|||
import com.wh.mapper.initial.SupplierMapper; |
|||
import com.wh.pojo.Product; |
|||
import com.wh.pojo.Supplier; |
|||
import com.wh.pojo.SupplierQuery; |
|||
import com.wh.vo.PageResult; |
|||
import com.yxt.common.core.query.PagerQuery; |
|||
import com.yxt.common.core.vo.PagerVo; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
import org.springframework.util.StringUtils; |
|||
|
|||
import java.util.List; |
|||
|
|||
@Service |
|||
public class SupplierServiceImpl implements SupplierService{ |
|||
|
|||
@Autowired |
|||
private SupplierMapper supplierMapper; |
|||
|
|||
@Override |
|||
public PageResult getSupplierList(PageResult pageResult) { |
|||
Page<Supplier> supplierPage = new Page<>(pageResult.getPageNum(),pageResult.getPageSize()); |
|||
QueryWrapper<Supplier> queryWrapper = new QueryWrapper<>(); |
|||
boolean flag = StringUtils.hasLength(pageResult.getQuery()); |
|||
queryWrapper.like(flag,"name",pageResult.getQuery()); |
|||
supplierPage = supplierMapper.selectPage(supplierPage,queryWrapper); |
|||
pageResult.setTotal((long) supplierPage.getRecords().size()).setRows(supplierPage.getRecords()); |
|||
|
|||
return pageResult; |
|||
} |
|||
|
|||
@Override |
|||
public PagerVo<Supplier> getSupplierList(PagerQuery<SupplierQuery> pq) { |
|||
Page<Supplier> supplierPage = new Page<>(pq.getCurrent(),pq.getSize()); |
|||
QueryWrapper<Supplier> queryWrapper = new QueryWrapper<>(); |
|||
String name = pq.getParams().getName(); |
|||
String number = pq.getParams().getNumber(); |
|||
if(!StringUtils.isEmpty(name)){ |
|||
queryWrapper.like("name",name); |
|||
} |
|||
if(!StringUtils.isEmpty(number)){ |
|||
queryWrapper.like("number",number); |
|||
} |
|||
supplierPage = supplierMapper.selectPage(supplierPage,queryWrapper); |
|||
Integer integer = supplierMapper.selectCount(queryWrapper); |
|||
// pageResult.setTotal((long) supplierPage.getRecords().size()).setRows(supplierPage.getRecords());
|
|||
PagerVo<Supplier> pv=new PagerVo<>(); |
|||
pv.setCurrent(pq.getCurrent()); |
|||
pv.setTotal(integer); |
|||
pv.setSize(pq.getSize()); |
|||
pv.setRecords(supplierPage.getRecords()); |
|||
return pv; |
|||
} |
|||
|
|||
@Override |
|||
public void addSupplier(Supplier supplier) { |
|||
supplierMapper.insert(supplier); |
|||
} |
|||
|
|||
@Override |
|||
public void updataSupplier(Supplier supplier) { |
|||
supplierMapper.updateById(supplier); |
|||
} |
|||
|
|||
@Override |
|||
public void deleteSupplier(String name) { |
|||
supplierMapper.deleteById(name); |
|||
} |
|||
|
|||
@Override |
|||
public List<Supplier> listAll() { |
|||
return supplierMapper.listAll(); |
|||
} |
|||
} |
@ -0,0 +1,25 @@ |
|||
package com.wh.service.instorehouse; |
|||
|
|||
import com.wh.pojo.Product; |
|||
import com.wh.pojo.Purchase; |
|||
import com.wh.pojo.Storehouse; |
|||
import com.wh.pojo.Supplier; |
|||
import com.wh.vo.PageResult; |
|||
|
|||
import java.util.List; |
|||
|
|||
public interface PurchaseService { |
|||
PageResult getPurchaseList(PageResult pageResult); |
|||
|
|||
void addPurchase(Purchase purchase); |
|||
|
|||
List<Product> getProductList(String name); |
|||
|
|||
List<Supplier> getSupplier(); |
|||
|
|||
List<Storehouse> getStorehouse(); |
|||
|
|||
void deletePurchase(String purchaseId); |
|||
|
|||
void updataPurchase(Purchase purchase); |
|||
} |
@ -0,0 +1,84 @@ |
|||
package com.wh.service.instorehouse; |
|||
|
|||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|||
import com.wh.mapper.initial.ProductMapper; |
|||
import com.wh.mapper.initial.StorehouseMapper; |
|||
import com.wh.mapper.initial.SupplierMapper; |
|||
import com.wh.mapper.instorehouse.PurchaseMapper; |
|||
import com.wh.pojo.*; |
|||
import com.wh.vo.PageResult; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
import org.springframework.util.StringUtils; |
|||
|
|||
import java.util.List; |
|||
|
|||
@Service |
|||
public class PurchaseServiceImpl implements PurchaseService{ |
|||
|
|||
@Autowired |
|||
private StorehouseMapper storehouseMapper; |
|||
|
|||
@Autowired |
|||
private SupplierMapper supplierMapper; |
|||
|
|||
@Autowired |
|||
private ProductMapper productMapper; |
|||
|
|||
@Autowired |
|||
private PurchaseMapper purchaseMapper; |
|||
|
|||
@Override |
|||
public PageResult getPurchaseList(PageResult pageResult) { |
|||
Page<Purchase> purchasePage = new Page<>(pageResult.getPageNum(),pageResult.getPageSize()); |
|||
QueryWrapper<Purchase> queryWrapper = new QueryWrapper<>(); |
|||
boolean flag = StringUtils.hasLength(pageResult.getQuery()); |
|||
queryWrapper.like(flag,"purchase_id",pageResult.getQuery()); |
|||
|
|||
purchasePage = purchaseMapper.selectPage(purchasePage,queryWrapper); |
|||
pageResult.setTotal((long) purchasePage.getRecords().size()).setRows(purchasePage.getRecords()); |
|||
// System.out.println(purchasePage.getRecords().size());
|
|||
return pageResult; |
|||
} |
|||
|
|||
@Override |
|||
public void addPurchase(Purchase purchase) { |
|||
purchaseMapper.insert(purchase); |
|||
} |
|||
|
|||
@Override |
|||
public List<Product> getProductList(String name) { |
|||
boolean flag = StringUtils.hasLength(name); |
|||
QueryWrapper<Product> queryWrapper = new QueryWrapper<>(); |
|||
queryWrapper.eq(flag,"name",name); |
|||
List<Product> productList = productMapper.selectList(queryWrapper); |
|||
return productList; |
|||
|
|||
} |
|||
|
|||
@Override |
|||
public List<Supplier> getSupplier() { |
|||
List<Supplier> supplierList = supplierMapper.selectList(null); |
|||
return supplierList; |
|||
} |
|||
|
|||
@Override |
|||
public List<Storehouse> getStorehouse() { |
|||
// QueryWrapper<Storehouse> queryWrapper = new QueryWrapper<>();
|
|||
// queryWrapper.eq("type","入库区");
|
|||
// return storehouseMapper.selectList(queryWrapper);
|
|||
return storehouseMapper.selectList(null); |
|||
} |
|||
|
|||
@Override |
|||
public void deletePurchase(String purchaseId) { |
|||
purchaseMapper.deleteById(purchaseId); |
|||
} |
|||
|
|||
@Override |
|||
public void updataPurchase(Purchase purchase) { |
|||
purchaseMapper.updateById(purchase); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,20 @@ |
|||
package com.wh.service.instorehouse; |
|||
|
|||
import com.wh.pojo.InStorehouse; |
|||
import com.wh.vo.PageResult; |
|||
|
|||
import java.util.Map; |
|||
|
|||
public interface PutInService { |
|||
Map<String, Object> getQuery(InStorehouse inStorehouse); |
|||
|
|||
String addInStorehouse(InStorehouse inStorehouse); |
|||
|
|||
PageResult getInStorehouseList(PageResult pageResult); |
|||
|
|||
void updataInStorehouse(InStorehouse inStorehouse); |
|||
|
|||
String deleteInStorehouse(String inStorehouseId, String receivingId); |
|||
|
|||
|
|||
} |
@ -0,0 +1,220 @@ |
|||
package com.wh.service.instorehouse; |
|||
|
|||
|
|||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|||
|
|||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|||
import com.wh.api.Api; |
|||
import com.wh.mapper.initial.LocationMapper; |
|||
import com.wh.mapper.initial.ProductMapper; |
|||
import com.wh.mapper.instorehouse.PurchaseMapper; |
|||
import com.wh.mapper.instorehouse.ReceivingMapper; |
|||
import com.wh.mapper.stock.StockMapper; |
|||
import com.wh.mapper.instorehouse.PutInMapper; |
|||
import com.wh.mapper.storehousemanage.RemoveMapper; |
|||
import com.wh.pojo.*; |
|||
|
|||
import com.wh.vo.PageResult; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
|
|||
import org.springframework.stereotype.Service; |
|||
import org.springframework.util.StringUtils; |
|||
|
|||
import java.util.ArrayList; |
|||
import java.util.HashMap; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
@Service |
|||
public class PutInServiceImpl implements PutInService { |
|||
|
|||
@Autowired |
|||
private PutInMapper putInMapper; |
|||
|
|||
@Autowired |
|||
private ReceivingMapper receivingMapper; |
|||
|
|||
@Autowired |
|||
private LocationMapper locationMapper; |
|||
|
|||
@Autowired |
|||
private StockMapper stockMapper; |
|||
|
|||
@Autowired |
|||
private PurchaseMapper purchaseMapper; |
|||
|
|||
@Autowired |
|||
private ProductMapper productMapper; |
|||
|
|||
@Autowired |
|||
private RemoveMapper removeMapper; |
|||
|
|||
|
|||
|
|||
|
|||
@Override |
|||
public Map<String, Object> getQuery(InStorehouse inStorehouse) { |
|||
Purchase purchase = new Purchase(); |
|||
if (StringUtils.hasLength(inStorehouse.getReceivingId())){ |
|||
Receiving receivingAble = receivingMapper.selectById(inStorehouse.getReceivingId()); |
|||
purchase = purchaseMapper.selectById(receivingAble.getPurchaseId()); |
|||
} |
|||
|
|||
QueryWrapper<Receiving> receivingQueryWrapper = new QueryWrapper<>(); |
|||
receivingQueryWrapper.eq("status","已审核") |
|||
.select("receiving_id"); |
|||
|
|||
|
|||
QueryWrapper<Location> locationQueryWrapper = new QueryWrapper<>(); |
|||
locationQueryWrapper.eq("status","空闲") |
|||
.eq("type","入库区") |
|||
.eq(StringUtils.hasLength(purchase.getStorehouse()),"storehouse",purchase.getStorehouse()) |
|||
.select("location_id"); |
|||
|
|||
List<Receiving> receivingList = receivingMapper.selectList(receivingQueryWrapper); |
|||
List<Location> locationList = locationMapper.selectList(locationQueryWrapper); |
|||
|
|||
List<String> receivingIdList = new ArrayList<>(); |
|||
List<Location> locationIdList = new ArrayList<>(); |
|||
|
|||
for (Receiving receiving : receivingList){ |
|||
receivingIdList.add(receiving.getReceivingId()); |
|||
} |
|||
|
|||
if (locationList != null){ |
|||
for (Location location : locationList){ |
|||
locationIdList.add(location); |
|||
} |
|||
} |
|||
|
|||
|
|||
Map<String,Object> map = new HashMap<>(); |
|||
map.put("receivingIdList",receivingIdList); |
|||
map.put("locationIdList",locationIdList); |
|||
|
|||
return map; |
|||
} |
|||
|
|||
@Override |
|||
public String addInStorehouse(InStorehouse inStorehouse) { |
|||
QueryWrapper<InStorehouse> queryWrapper = new QueryWrapper<>(); |
|||
queryWrapper.eq("location_id",inStorehouse.getLocationId()); |
|||
if(putInMapper.selectCount(queryWrapper) != 0){ |
|||
return "已有记录"; |
|||
} |
|||
inStorehouse.setStatus("待审核") |
|||
.setInStorehouseId("IN" + System.currentTimeMillis()) |
|||
.setCreateTime(new Api().getTime()); |
|||
putInMapper.insert(inStorehouse); |
|||
Receiving receiving = receivingMapper.selectById(inStorehouse.getReceivingId()); |
|||
receiving.setStatus("进行中"); |
|||
receivingMapper.updateById(receiving); |
|||
return "添加成功"; |
|||
} |
|||
|
|||
@Override |
|||
public PageResult getInStorehouseList(PageResult pageResult) { |
|||
Page<InStorehouse> page = new Page<>(pageResult.getPageNum(),pageResult.getPageSize()); |
|||
|
|||
boolean flag = StringUtils.hasLength(pageResult.getQuery()); |
|||
|
|||
QueryWrapper<InStorehouse> queryWrapper = new QueryWrapper<>(); |
|||
queryWrapper.like(flag,"in_storehouse_id",pageResult.getQuery()); |
|||
|
|||
page = putInMapper.selectPage(page,queryWrapper); |
|||
|
|||
pageResult.setTotal((long) page.getRecords().size()).setRows(page.getRecords()); |
|||
|
|||
|
|||
return pageResult; |
|||
} |
|||
|
|||
|
|||
@Override |
|||
//
|
|||
public void updataInStorehouse(InStorehouse inStorehouse) { |
|||
//判断订单状态
|
|||
if (inStorehouse.getStatus().equals("已审核")){ |
|||
//设置审核时间
|
|||
inStorehouse.setCheckTime(new Api().getTime()); |
|||
check(inStorehouse); |
|||
}else if(inStorehouse.getStatus().equals("待审核")){ |
|||
inStorehouse.setCheckTime("") |
|||
.setCheckPerson(""); |
|||
stockMapper.deleteById(inStorehouse.getLocationId()); |
|||
|
|||
Location location = locationMapper.selectById(inStorehouse.getLocationId()); |
|||
location.setStatus("空闲"); |
|||
locationMapper.updateById(location); |
|||
|
|||
} |
|||
putInMapper.updateById(inStorehouse); |
|||
} |
|||
|
|||
@Override |
|||
public String deleteInStorehouse(String inStorehouseId, String receivingId) { |
|||
Receiving receiving = receivingMapper.selectById(receivingId); |
|||
receiving.setStatus("已审核"); |
|||
receivingMapper.updateById(receiving); |
|||
putInMapper.deleteById(inStorehouseId); |
|||
return "撤销成功"; |
|||
} |
|||
|
|||
|
|||
|
|||
public void check(InStorehouse inStorehouse){ |
|||
Stock stock = new Stock(); |
|||
|
|||
//获取货位名称
|
|||
Location location = locationMapper.selectById(inStorehouse.getLocationId()); |
|||
String locationName = location.getName(); |
|||
|
|||
//获取商品条码
|
|||
String barCode = null; |
|||
//获取接货单
|
|||
Receiving receiving = receivingMapper.selectById(inStorehouse.getReceivingId()); |
|||
if (StringUtils.hasLength(receiving.getPurchaseId())) { |
|||
Purchase purchase = purchaseMapper.selectById(receiving.getPurchaseId()); |
|||
barCode = purchase.getBarCode(); |
|||
stock.setTotalQuantity(purchase.getCount()) |
|||
.setAvailableQuantity(purchase.getCount()); |
|||
} else { |
|||
Remove remove = removeMapper.selectById(receiving.getRemoveId()); |
|||
barCode = remove.getBarCode(); |
|||
stock.setTotalQuantity(remove.getCount()) |
|||
.setAvailableQuantity(remove.getCount()); |
|||
} |
|||
|
|||
//获取商品名称
|
|||
Product product = productMapper.selectById(barCode); |
|||
String productName = product.getName(); |
|||
|
|||
//赋值
|
|||
stock.setInStorehouseId(inStorehouse.getInStorehouseId()) |
|||
.setLocationId(inStorehouse.getLocationId()) |
|||
.setLocationName(locationName) |
|||
.setBarCode(barCode) |
|||
.setProductName(productName) |
|||
.setLockedQuantity(0) |
|||
.setStatus("待上架"); |
|||
|
|||
stockMapper.insert(stock); |
|||
|
|||
//修改移库源货位库存
|
|||
if (receiving.getRemoveId() != null){ |
|||
Remove remove = removeMapper.selectById(receiving.getRemoveId()); |
|||
Stock fromStock = stockMapper.selectById(remove.getFromLocationId()); |
|||
fromStock.setLockedQuantity(fromStock.getLockedQuantity() - remove.getCount()) |
|||
.setTotalQuantity(fromStock.getTotalQuantity() - remove.getCount()); |
|||
stockMapper.updateById(fromStock); |
|||
|
|||
} |
|||
|
|||
|
|||
location.setStatus(barCode); |
|||
locationMapper.updateById(location); |
|||
|
|||
} |
|||
|
|||
|
|||
} |
@ -0,0 +1,19 @@ |
|||
package com.wh.service.instorehouse; |
|||
|
|||
import com.wh.pojo.Receiving; |
|||
import com.wh.vo.Options; |
|||
import com.wh.vo.PageResult; |
|||
|
|||
import java.util.List; |
|||
|
|||
public interface ReceivingService { |
|||
List<Options> getOptions(); |
|||
|
|||
void addReceiving(String id,String user); |
|||
|
|||
PageResult getReceiving(PageResult pageResult); |
|||
|
|||
void updataReceiving(Receiving receiving); |
|||
|
|||
void deleteReceiving(String receivingId,String purchaseId); |
|||
} |
@ -0,0 +1,132 @@ |
|||
package com.wh.service.instorehouse; |
|||
|
|||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|||
import com.wh.api.Api; |
|||
import com.wh.mapper.instorehouse.PurchaseMapper; |
|||
import com.wh.mapper.instorehouse.ReceivingMapper; |
|||
import com.wh.mapper.storehousemanage.RemoveMapper; |
|||
import com.wh.pojo.Purchase; |
|||
import com.wh.pojo.Receiving; |
|||
import com.wh.pojo.Remove; |
|||
import com.wh.vo.Options; |
|||
import com.wh.vo.PageResult; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
import org.springframework.util.StringUtils; |
|||
|
|||
import java.text.SimpleDateFormat; |
|||
import java.util.ArrayList; |
|||
import java.util.Date; |
|||
import java.util.List; |
|||
|
|||
@Service |
|||
public class ReceivingServiceImpl implements ReceivingService{ |
|||
|
|||
@Autowired |
|||
private ReceivingMapper receivingMapper; |
|||
|
|||
@Autowired |
|||
private PurchaseMapper purchaseMapper; |
|||
|
|||
@Autowired |
|||
private RemoveMapper removeMapper; |
|||
|
|||
@Override |
|||
public List<Options> getOptions() { |
|||
List<Options> optionsList = new ArrayList<>(); |
|||
List<Options> optionsList2 = new ArrayList<>(); |
|||
List<Options> optionsList3 = new ArrayList<>(); |
|||
Options optionsPurchase = new Options(); |
|||
Options optionsRemove = new Options(); |
|||
QueryWrapper<Purchase> purchaseQueryWrapper = new QueryWrapper<>(); |
|||
purchaseQueryWrapper.eq("status","已审核"); |
|||
|
|||
|
|||
List<Purchase> purchaseList = purchaseMapper.selectList(purchaseQueryWrapper); |
|||
// System.out.println(purchaseList);
|
|||
// System.out.println(purchaseList.get(0).getPurchaseId());
|
|||
|
|||
for(Purchase purchase : purchaseList){ |
|||
optionsList2.add(new Options().setLabel(purchase.getPurchaseId()).setValue(purchase.getPurchaseId())); |
|||
} |
|||
optionsPurchase.setValue("purchase").setLabel("采购订单编号").setChildren(optionsList2); |
|||
// System.out.println(optionsList2);
|
|||
optionsList.add(optionsPurchase); |
|||
|
|||
QueryWrapper<Remove> removeQueryWrapper = new QueryWrapper<>(); |
|||
removeQueryWrapper.eq("status","已审核"); |
|||
List<Remove> removeList = removeMapper.selectList(removeQueryWrapper); |
|||
for(Remove remove : removeList){ |
|||
optionsList3.add(new Options().setLabel(remove.getRemoveId()).setValue(remove.getRemoveId())); |
|||
} |
|||
optionsRemove.setValue("remove").setLabel("移库编号").setChildren(optionsList3); |
|||
|
|||
|
|||
|
|||
optionsList.add(optionsRemove); |
|||
|
|||
System.out.println(optionsList); |
|||
return optionsList; |
|||
} |
|||
|
|||
@Override |
|||
public void addReceiving(String id,String user) { |
|||
|
|||
|
|||
// System.out.println(purchase);
|
|||
|
|||
Receiving receiving = new Receiving(); |
|||
receiving.setReceivingId("IR" + Long.toString(System.currentTimeMillis())) |
|||
.setReceivingPerson(user) |
|||
.setReceivingTime(new Api().getTime()) |
|||
.setStatus("待审核"); |
|||
|
|||
|
|||
if (id.charAt(0) == 'I'){ |
|||
Purchase purchase = purchaseMapper.selectById(id); |
|||
receiving.setPurchaseId(purchase.getPurchaseId()); |
|||
purchase.setStatus("进行中"); |
|||
purchaseMapper.updateById(purchase); |
|||
}else { |
|||
Remove remove = removeMapper.selectById(id); |
|||
receiving.setRemoveId(remove.getRemoveId()); |
|||
remove.setStatus("进行中"); |
|||
removeMapper.updateById(remove); |
|||
} |
|||
receivingMapper.insert(receiving); |
|||
|
|||
} |
|||
|
|||
@Override |
|||
public PageResult getReceiving(PageResult pageResult) { |
|||
Page<Receiving> receivingPage = new Page<>(pageResult.getPageNum(),pageResult.getPageSize()); |
|||
QueryWrapper<Receiving> queryWrapper = new QueryWrapper<>(); |
|||
boolean flag = StringUtils.hasLength(pageResult.getQuery()); |
|||
queryWrapper.like(flag,"receiving_id",pageResult.getQuery()); |
|||
|
|||
receivingPage = receivingMapper.selectPage(receivingPage,queryWrapper); |
|||
pageResult.setTotal((long) receivingPage.getRecords().size()).setRows(receivingPage.getRecords()); |
|||
// System.out.println(receivingPage.getRecords().size());
|
|||
return pageResult; |
|||
} |
|||
|
|||
@Override |
|||
public void updataReceiving(Receiving receiving) { |
|||
if (StringUtils.hasLength(receiving.getCheckPerson())){ |
|||
receiving.setCheckTime(new Api().getTime()); |
|||
} |
|||
receivingMapper.updateById(receiving); |
|||
} |
|||
|
|||
@Override |
|||
public void deleteReceiving(String receivingId,String purchaseId) { |
|||
receivingMapper.deleteById(receivingId); |
|||
Purchase purchase = purchaseMapper.selectById(purchaseId); |
|||
purchase.setStatus("已审核"); |
|||
purchaseMapper.updateById(purchase); |
|||
|
|||
} |
|||
|
|||
|
|||
} |
@ -0,0 +1,20 @@ |
|||
package com.wh.service.outstorehouse; |
|||
|
|||
import com.wh.pojo.OutStorehouse; |
|||
import com.wh.vo.PageResult; |
|||
|
|||
import java.util.Map; |
|||
|
|||
public interface OutStorehouseService { |
|||
Map<String, Object> getQuery(OutStorehouse outStorehouse); |
|||
|
|||
PageResult getOutStorehouseList(PageResult pageResult); |
|||
|
|||
void addOutStorehouse(OutStorehouse outStorehouse); |
|||
|
|||
void updataOutStorehouse(OutStorehouse outStorehouse); |
|||
|
|||
void deleteOutStorehouse(String id,Integer count , String locationId); |
|||
|
|||
void out(OutStorehouse outStorehouse); |
|||
} |
@ -0,0 +1,157 @@ |
|||
package com.wh.service.outstorehouse; |
|||
|
|||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|||
import com.wh.api.Api; |
|||
import com.wh.mapper.initial.ProductMapper; |
|||
import com.wh.mapper.outstorehouse.OutStorehouseMapper; |
|||
import com.wh.mapper.outstorehouse.PickingMapper; |
|||
import com.wh.mapper.stock.StockMapper; |
|||
import com.wh.pojo.*; |
|||
import com.wh.vo.PageResult; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
import org.springframework.util.StringUtils; |
|||
|
|||
import java.util.*; |
|||
|
|||
@Service |
|||
public class OutStorehouseServiceImpl implements OutStorehouseService { |
|||
|
|||
@Autowired |
|||
private OutStorehouseMapper outStorehouseMapper; |
|||
|
|||
@Autowired |
|||
private StockMapper stockMapper; |
|||
|
|||
@Autowired |
|||
private ProductMapper productMapper; |
|||
|
|||
@Autowired |
|||
private PickingMapper pickingMapper; |
|||
|
|||
@Override |
|||
public Map<String, Object> getQuery(OutStorehouse outStorehouse) { |
|||
Map<String,Object> map = new HashMap<>(); |
|||
Set<String> barCodeList = new HashSet<>(); |
|||
Set<String> locationIdList = new HashSet<>(); |
|||
String productName = ""; |
|||
Integer availableQuantity = 0; |
|||
|
|||
|
|||
boolean barCodeFlag = StringUtils.hasLength(outStorehouse.getBarCode()); |
|||
boolean locationIdFlag = StringUtils.hasLength(outStorehouse.getLocationId()); |
|||
|
|||
QueryWrapper<Stock> queryWrapper = new QueryWrapper<>(); |
|||
queryWrapper.eq(barCodeFlag,"bar_code",outStorehouse.getBarCode()) |
|||
.eq(locationIdFlag,"location_id",outStorehouse.getLocationId()) |
|||
.eq("status","已上架"); |
|||
|
|||
List<Stock> stockList = stockMapper.selectList(queryWrapper); |
|||
|
|||
if (stockList.size() == 1){ |
|||
productName = stockList.get(0).getProductName(); |
|||
availableQuantity = stockList.get(0).getAvailableQuantity(); |
|||
|
|||
} |
|||
|
|||
for (Stock stock : stockList){ |
|||
barCodeList.add(stock.getBarCode()); |
|||
locationIdList.add(stock.getLocationId()); |
|||
} |
|||
|
|||
map.put("barCodeList",barCodeList); |
|||
map.put("locationIdList",locationIdList); |
|||
map.put("availableQuantity",availableQuantity); |
|||
map.put("productName",productName); |
|||
|
|||
|
|||
return map; |
|||
} |
|||
|
|||
@Override |
|||
public PageResult getOutStorehouseList(PageResult pageResult) { |
|||
Page<OutStorehouse> page = new Page<>(pageResult.getPageNum(),pageResult.getPageSize()); |
|||
boolean flag = StringUtils.hasLength(pageResult.getQuery()); |
|||
QueryWrapper<OutStorehouse> queryWrapper = new QueryWrapper<>(); |
|||
queryWrapper.like(flag,"out_storehouse_id",pageResult.getQuery()); |
|||
page = outStorehouseMapper.selectPage(page,queryWrapper); |
|||
pageResult.setTotal((long) page.getRecords().size()).setRows(page.getRecords()); |
|||
return pageResult; |
|||
} |
|||
|
|||
@Override |
|||
public void addOutStorehouse(OutStorehouse outStorehouse) { |
|||
outStorehouse.setCreateTime(new Api().getTime()); |
|||
/**修改stock*/ |
|||
Stock stock = stockMapper.selectById(outStorehouse.getLocationId()); |
|||
stock.setAvailableQuantity( |
|||
stock.getAvailableQuantity() - outStorehouse.getCount() |
|||
); |
|||
stockMapper.updateById(stock); |
|||
outStorehouseMapper.insert(outStorehouse); |
|||
} |
|||
|
|||
@Override |
|||
public void updataOutStorehouse(OutStorehouse outStorehouse) { |
|||
/** 修改stock*/ |
|||
Stock stock = stockMapper.selectById(outStorehouse.getLocationId()); |
|||
if (outStorehouse.getStatus().equals("已审核")){ |
|||
//设置锁定数量
|
|||
stock.setLockedQuantity( |
|||
stock.getLockedQuantity() + outStorehouse.getCount() |
|||
); |
|||
//设置审核时间
|
|||
outStorehouse.setCheckTime(new Api().getTime()); |
|||
//设置拣货id/添加拣货单
|
|||
if (!StringUtils.hasLength(outStorehouse.getPickingId())){ |
|||
String pickingId = "PI" + System.currentTimeMillis(); |
|||
outStorehouse.setPickingId(pickingId); |
|||
Picking picking = new Picking(); |
|||
picking.setPickingId(pickingId) |
|||
.setOutStorehouseId(outStorehouse.getOutStorehouseId()) |
|||
.setCreatePerson(outStorehouse.getCheckPerson()) |
|||
.setCreateTime(new Api().getTime()) |
|||
.setStatus("待拣货"); |
|||
pickingMapper.insert(picking); |
|||
} |
|||
} else if (outStorehouse.getStatus().equals("待审核")){ |
|||
stock.setLockedQuantity( |
|||
stock.getLockedQuantity() - outStorehouse.getCount() |
|||
); |
|||
if (StringUtils.hasLength(outStorehouse.getPickingId())){ |
|||
pickingMapper.deleteById(outStorehouse.getPickingId()); |
|||
} |
|||
outStorehouse.setPickingId("") |
|||
.setCheckPerson("") |
|||
.setCheckTime(""); |
|||
} |
|||
stockMapper.updateById(stock); |
|||
outStorehouseMapper.updateById(outStorehouse); |
|||
} |
|||
|
|||
@Override |
|||
public void deleteOutStorehouse(String id , Integer count , String locationId) { |
|||
|
|||
Stock stock = stockMapper.selectById(locationId); |
|||
stock.setAvailableQuantity( |
|||
stock.getAvailableQuantity() + count |
|||
); |
|||
stockMapper.updateById(stock); |
|||
|
|||
outStorehouseMapper.deleteById(id); |
|||
} |
|||
|
|||
@Override |
|||
public void out(OutStorehouse outStorehouse) { |
|||
outStorehouse.setOutTime(new Api().getTime()); |
|||
outStorehouseMapper.updateById(outStorehouse); |
|||
|
|||
Stock stock = stockMapper.selectById(outStorehouse.getLocationId()); |
|||
stock.setTotalQuantity(stock.getTotalQuantity() - outStorehouse.getCount()) |
|||
.setLockedQuantity(stock.getLockedQuantity() - outStorehouse.getCount()); |
|||
stockMapper.updateById(stock); |
|||
} |
|||
|
|||
|
|||
} |
@ -0,0 +1,20 @@ |
|||
package com.wh.service.outstorehouse; |
|||
|
|||
import com.wh.pojo.Picking; |
|||
import com.wh.vo.PageResult; |
|||
import com.wh.vo.PickingUser; |
|||
import com.yxt.common.core.result.ResultBean; |
|||
|
|||
import java.util.List; |
|||
|
|||
public interface PickingService { |
|||
List<String> getOptions(); |
|||
|
|||
void picking(String id,String user); |
|||
|
|||
PageResult getPickingList(PageResult pageResult); |
|||
|
|||
void finish(Picking picking); |
|||
|
|||
ResultBean picking(PickingUser pickingUser); |
|||
} |
@ -0,0 +1,108 @@ |
|||
package com.wh.service.outstorehouse; |
|||
|
|||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|||
import com.wh.api.Api; |
|||
import com.wh.mapper.outstorehouse.OutStorehouseMapper; |
|||
import com.wh.mapper.outstorehouse.PickingMapper; |
|||
import com.wh.pojo.OutStorehouse; |
|||
import com.wh.pojo.Picking; |
|||
import com.wh.pojo.api.OutStorehouseListing; |
|||
import com.wh.pojo.api.OutStorehouseMain; |
|||
import com.wh.service.api.outstorehouse.OutStorehouseListingService; |
|||
import com.wh.service.api.outstorehouse.OutStorehouseMainService; |
|||
import com.wh.vo.PageResult; |
|||
import com.wh.vo.PickingUser; |
|||
import com.yxt.common.core.result.ResultBean; |
|||
import org.apache.ibatis.annotations.Select; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
import org.springframework.transaction.annotation.Transactional; |
|||
import org.springframework.util.StringUtils; |
|||
|
|||
import javax.annotation.Resource; |
|||
import java.util.ArrayList; |
|||
import java.util.HashMap; |
|||
import java.util.List; |
|||
|
|||
@Service |
|||
public class PickingServiceImpl implements PickingService{ |
|||
|
|||
@Autowired |
|||
private PickingMapper pickingMapper; |
|||
|
|||
@Autowired |
|||
private OutStorehouseMapper outStorehouseMapper; |
|||
@Resource |
|||
private OutStorehouseMainService outStorehouseMainService; |
|||
@Resource |
|||
private OutStorehouseListingService outStorehouseListingService; |
|||
@Override |
|||
public List<String> getOptions() { |
|||
QueryWrapper<Picking> queryWrapper = new QueryWrapper<>(); |
|||
queryWrapper.eq("status","待拣货"); |
|||
List<Picking> pickingList = pickingMapper.selectList(queryWrapper); |
|||
|
|||
List<String> outStorehouseIdList = new ArrayList<>(); |
|||
|
|||
for (Picking picking : pickingList){ |
|||
outStorehouseIdList.add(picking.getPickingId()); |
|||
} |
|||
return outStorehouseIdList; |
|||
} |
|||
|
|||
@Override |
|||
public void picking(String id , String user) { |
|||
Picking picking = pickingMapper.selectById(id); |
|||
OutStorehouse outStorehouse = outStorehouseMapper.selectById(picking.getOutStorehouseId()); |
|||
//更新拣货单
|
|||
picking.setStatus("拣货中") |
|||
.setRecipientPerson(user) |
|||
.setRecipientTime(new Api().getTime()); |
|||
pickingMapper.updateById(picking); |
|||
|
|||
//更新出库单
|
|||
outStorehouse.setStatus("拣货中"); |
|||
outStorehouseMapper.updateById(outStorehouse); |
|||
|
|||
} |
|||
|
|||
@Override |
|||
public PageResult getPickingList(PageResult pageResult) { |
|||
Page<Picking> page = new Page<>(pageResult.getPageNum(),pageResult.getPageSize()); |
|||
|
|||
boolean flag = StringUtils.hasLength(pageResult.getQuery()); |
|||
|
|||
QueryWrapper<Picking> queryWrapper = new QueryWrapper<>(); |
|||
queryWrapper.like(flag,"pickingId",pageResult.getQuery()); |
|||
page = pickingMapper.selectPage(page,queryWrapper); |
|||
|
|||
pageResult.setRows(page.getRecords()).setTotal((long) page.getRecords().size()); |
|||
return pageResult; |
|||
} |
|||
|
|||
@Override |
|||
public void finish(Picking picking) { |
|||
pickingMapper.updateById(picking); |
|||
OutStorehouse outStorehouse = outStorehouseMapper.selectById(picking.getOutStorehouseId()); |
|||
outStorehouse.setStatus("已拣货"); |
|||
outStorehouseMapper.updateById(outStorehouse); |
|||
} |
|||
@Transactional |
|||
@Override |
|||
public ResultBean picking(PickingUser pickingUser) { |
|||
ResultBean rb=ResultBean.fireFail(); |
|||
String outStorehouseId = pickingUser.getOutStorehouseId(); |
|||
OutStorehouseMain outStorehouseMain = outStorehouseMainService.fetchBySid(outStorehouseId); |
|||
List<OutStorehouseListing> outStorehouseListings = outStorehouseListingService.selectInStorehouseListingsByMainSid(outStorehouseId); |
|||
if(outStorehouseMain==null||outStorehouseListings==null||outStorehouseListings.size()==0){ |
|||
return rb.setMsg("没有查询相应的出库单信息"); |
|||
} |
|||
for (OutStorehouseListing outStorehouseListing : outStorehouseListings) { |
|||
outStorehouseMainService.saveOrUpdateProdStock(outStorehouseListing,outStorehouseMain); |
|||
} |
|||
return rb.success(); |
|||
} |
|||
|
|||
|
|||
} |
@ -0,0 +1,226 @@ |
|||
package com.wh.service.purchasenew; |
|||
|
|||
|
|||
import cn.hutool.core.bean.BeanUtil; |
|||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|||
import com.baomidou.mybatisplus.core.toolkit.StringUtils; |
|||
import com.wh.mapper.purchasenew.PurchasenewMapper; |
|||
import com.wh.pojo.api.InStoreHouseMainDto; |
|||
import com.wh.pojo.purchasenew.*; |
|||
import com.wh.pojo.purchasenewproduct.PurchasenewProduct; |
|||
import com.wh.pojo.purchasenewproduct.PurchasenewProductDto; |
|||
import com.wh.pojo.purchasenewproduct.PurchasenewProductVo; |
|||
import com.wh.service.api.instorehouse.InStorehouseMainService; |
|||
import com.wh.service.api.prodstock.ProdStockService; |
|||
import com.wh.service.purchasenewproduct.PurchasenewProductService; |
|||
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 lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
import org.springframework.transaction.annotation.Transactional; |
|||
|
|||
import java.text.SimpleDateFormat; |
|||
import java.util.*; |
|||
|
|||
@Slf4j |
|||
@Service |
|||
public class PurchasenewService extends MybatisBaseService<PurchasenewMapper, Purchasenew> { |
|||
@Autowired |
|||
private PurchasenewProductService purchasenewProductService; |
|||
@Autowired |
|||
private ProdStockService prodStockService; |
|||
@Autowired |
|||
private InStorehouseMainService inStorehouseMainService; |
|||
private QueryWrapper<Purchasenew> createQueryWrapper(PurchasenewQuery query) { |
|||
// todo: 这里根据具体业务调整查询条件
|
|||
// 多字段Like示例:qw.and(wrapper -> wrapper.like("name", query.getName()).or().like("remark", query.getName()));
|
|||
QueryWrapper<Purchasenew> qw = new QueryWrapper<>(); |
|||
if(org.apache.commons.lang3.StringUtils.isNotBlank(query.getPurchaseDateEnd())){ |
|||
qw.le("purchase_date",query.getPurchaseDateEnd()); |
|||
} |
|||
if(org.apache.commons.lang3.StringUtils.isNotBlank(query.getPurchaseDateStart())){ |
|||
qw.ge("purchase_date",query.getPurchaseDateStart()); |
|||
} |
|||
if(org.apache.commons.lang3.StringUtils.isNotBlank(query.getPurchaseNo())){ |
|||
qw.like("purchase_no",query.getPurchaseNo()); |
|||
} |
|||
if(org.apache.commons.lang3.StringUtils.isNotBlank(query.getCustName())){ |
|||
qw.like("cust_name",query.getCustName()); |
|||
} |
|||
if(org.apache.commons.lang3.StringUtils.isNotBlank(query.getCustId())){ |
|||
qw.eq("cust_id",query.getCustId()); |
|||
} |
|||
if(org.apache.commons.lang3.StringUtils.isNotBlank(query.getState())){ |
|||
qw.eq("state",query.getState()); |
|||
} |
|||
return qw; |
|||
} |
|||
|
|||
public PagerVo<PurchasenewVo> listPageVo(PagerQuery<PurchasenewQuery> pq) { |
|||
PurchasenewQuery query = pq.getParams(); |
|||
QueryWrapper<Purchasenew> qw = createQueryWrapper(query); |
|||
IPage<Purchasenew> page = PagerUtil.queryToPage(pq); |
|||
IPage<PurchasenewVo> pagging = baseMapper.selectPageVo(page, qw); |
|||
PagerVo<PurchasenewVo> p = PagerUtil.pageToVo(pagging, null); |
|||
return p; |
|||
} |
|||
@Transactional |
|||
public ResultBean saveOrUpdateDto(PurchasenewDto dto){ |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
// String custId = dto.getCustId();
|
|||
// ResultBean<List<WhEnterpriseInformationVo>> listResultBean = whEnterpriseInformationFeign.EnterpriseList();
|
|||
// List<WhEnterpriseInformationVo> data = listResultBean.getData();
|
|||
// data.forEach(d->{
|
|||
// String enterpriseName = d.getEnterpriseName();
|
|||
// String sid = d.getSid();
|
|||
// if(sid.equals(custId)){
|
|||
// dto.setCustName(enterpriseName);
|
|||
// }
|
|||
// });
|
|||
String dtoSid = dto.getSid(); |
|||
List<PurchasenewProductDto> products = dto.getProducts(); |
|||
if(products.size()==0){ |
|||
return rb.setMsg("商品列表不能为空"); |
|||
} |
|||
if (StringUtils.isBlank(dtoSid)) { |
|||
String purchaseNo= dto.getPurchaseNo(); |
|||
if(org.apache.commons.lang3.StringUtils.isBlank(purchaseNo)){ |
|||
SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd"); |
|||
String format = sdf.format(new Date()); |
|||
PurchasenewQuery query=new PurchasenewQuery(); |
|||
query.setCustId(dto.getCustId()); |
|||
query.setPurchaseNo("RK"+format); |
|||
QueryWrapper<Purchasenew> qw = createQueryWrapper(query); |
|||
List<Purchasenew> purchasenews = baseMapper.selectList(qw); |
|||
int size = purchasenews.size(); |
|||
String no="RK"+format; |
|||
if(size==0){ |
|||
no=no+"01"; |
|||
} |
|||
if(size>0&&size<10){ |
|||
no=no+"0"+size; |
|||
} |
|||
if(size>=10){ |
|||
no=no+size; |
|||
} |
|||
dto.setPurchaseNo(no); |
|||
} |
|||
return this.insertByDto(dto); |
|||
} |
|||
return this.updateByDto(dto); |
|||
} |
|||
|
|||
public ResultBean insertByDto(PurchasenewDto dto){ |
|||
|
|||
ResultBean rb = ResultBean.fireFail(); |
|||
Purchasenew entity = new Purchasenew(); |
|||
BeanUtil.copyProperties(dto, entity, "id", "sid"); |
|||
baseMapper.insert(entity); |
|||
return addPurchasenewProduct(dto, rb, entity); |
|||
// inStorehouseMainService.saveOrUpdateByPurchaseSid(dto,entity.getSid());
|
|||
|
|||
} |
|||
|
|||
public ResultBean updateByDto(PurchasenewDto dto){ |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
String dtoSid = dto.getSid(); |
|||
if (StringUtils.isBlank(dtoSid)) { |
|||
return rb.setMsg("主键信息不能为空"); |
|||
} |
|||
Purchasenew entity = fetchBySid(dtoSid); |
|||
int state = entity.getState(); |
|||
if(2==state){ |
|||
return rb.setMsg("采购订单已经入库不允许修改"); |
|||
} |
|||
BeanUtil.copyProperties(dto, entity, "id", "sid"); |
|||
baseMapper.updateById(entity); |
|||
//dto.setSid(entity.getSid());
|
|||
purchasenewProductService.deleteByPurchaseSid(dtoSid); |
|||
addPurchasenewProduct(dto, rb, entity); |
|||
return rb.success();//inStorehouseMainService.saveOrUpdateByPurchaseSid(dto,entity.getSid());// TODO 当系统调试通后需要做修改 不能再 执行下一行代码了
|
|||
} |
|||
|
|||
private ResultBean addPurchasenewProduct(PurchasenewDto dto, ResultBean rb, Purchasenew entity) { |
|||
List<PurchasenewProduct> l =new ArrayList<>(); |
|||
List<PurchasenewProductDto> products = dto.getProducts(); |
|||
products.forEach(p->{ |
|||
PurchasenewProduct pp=new PurchasenewProduct(); |
|||
BeanUtil.copyProperties(p,pp,"id","sid"); |
|||
pp.setMainSid(entity.getSid()); |
|||
pp.setStoreHouseName(dto.getStorehouseName()); |
|||
pp.setStoreHouseSid(dto.getStorehouseId()); |
|||
l.add(pp); |
|||
}); |
|||
boolean b = purchasenewProductService.saveBatch(l); |
|||
if (b) |
|||
return rb.success(); |
|||
return rb; |
|||
} |
|||
|
|||
public PurchasenewDetailsVo fetchDetailsVoBySid(String sid){ |
|||
Purchasenew entity = fetchBySid(sid); |
|||
if(entity==null){ |
|||
return null; |
|||
} |
|||
PurchasenewDetailsVo vo = new PurchasenewDetailsVo(); |
|||
//根据采购订单的sid查询 对应的商品列表
|
|||
List<PurchasenewProductVo> purchasenewProductVos = purchasenewProductService.fetchDetailsVoByPurchaseSid(sid); |
|||
BeanUtil.copyProperties(entity, vo); |
|||
vo.setProducts(purchasenewProductVos); |
|||
return vo; |
|||
} |
|||
@Transactional |
|||
public int delByPurchasenewSids(String[] sids) { |
|||
for (String sid : sids) { |
|||
Purchasenew entity = fetchBySid(sid); |
|||
int state = entity.getState(); |
|||
if(2==state){ |
|||
continue; |
|||
} |
|||
Map<String,Object> params=new HashMap<>(); |
|||
params.put("sid",sid); |
|||
baseMapper.deleteByMap(params); |
|||
purchasenewProductService.deleteByPurchaseSid(sid); |
|||
// inStorehouseMainService.deleteByPurchaseSid(sid);
|
|||
} |
|||
return sids.length; |
|||
} |
|||
|
|||
public ResultBean updatePutInStatus(String sid) { |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
int i=baseMapper.updatePutInStatus(sid); |
|||
return rb.success(); |
|||
} |
|||
|
|||
public List<Purchasenew> listForInput(PurchasenewQuery pq) { |
|||
String custId = pq.getCustId(); |
|||
return baseMapper.listForInput(custId); |
|||
} |
|||
|
|||
public void updateStateToInputBySid(String purchaseSid) { |
|||
Purchasenew purchasenew = fetchBySid(purchaseSid); |
|||
purchasenew.setState(2); |
|||
purchasenew.setModifyTime(new Date()); |
|||
baseMapper.updateById(purchasenew); |
|||
} |
|||
|
|||
public ResultBean importPurchase(PurchasenewForImportDto dto) { |
|||
PurchasenewDto d=new PurchasenewDto(); |
|||
BeanUtil.copyProperties(dto,d); |
|||
ResultBean resultBean = saveOrUpdateDto(d); |
|||
if(!resultBean.getSuccess()){ |
|||
return resultBean; |
|||
} |
|||
InStoreHouseMainDto inStoreHouseMainDto=new InStoreHouseMainDto(); |
|||
inStoreHouseMainDto.setLocationId(dto.getLocationId()); |
|||
inStoreHouseMainDto.setLocationName(dto.getLocationNumber()); |
|||
inStoreHouseMainDto.setNo(dto.getPurchaseNo()); |
|||
// inStoreHouseMainDto.setNo(dto.getPurchaseNo());
|
|||
return inStorehouseMainService.addInStorehouse(inStoreHouseMainDto); |
|||
} |
|||
} |
@ -0,0 +1,138 @@ |
|||
/********************************************************* |
|||
********************************************************* |
|||
******************** ******************* |
|||
************* ************ |
|||
******* _oo0oo_ ******* |
|||
*** o8888888o *** |
|||
* 88" . "88 * |
|||
* (| -_- |) * |
|||
* 0\ = /0 * |
|||
* ___/`---'\___ * |
|||
* .' \\| |// '. *
|
|||
* / \\||| : |||// \ *
|
|||
* / _||||| -:- |||||- \ * |
|||
* | | \\\ - /// | | *
|
|||
* | \_| ''\---/'' |_/ | * |
|||
* \ .-\__ '-' ___/-. / * |
|||
* ___'. .' /--.--\ `. .'___ * |
|||
* ."" '< `.___\_<|>_/___.' >' "". * |
|||
* | | : `- \`.;`\ _ /`;.`/ - ` : | | * |
|||
* \ \ `_. \_ __\ /__ _/ .-` / / * |
|||
* =====`-.____`.___ \_____/___.-`___.-'===== * |
|||
* `=---=' * |
|||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * |
|||
*********__佛祖保佑__永无BUG__验收通过__钞票多多__********* |
|||
*********************************************************/ |
|||
package com.wh.service.purchasenewproduct; |
|||
|
|||
import cn.hutool.core.bean.BeanUtil; |
|||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|||
import com.wh.mapper.purchasenewproduct.PurchasenewProductMapper; |
|||
import com.wh.pojo.purchasenewproduct.*; |
|||
import com.yxt.common.base.service.MybatisBaseService; |
|||
import com.yxt.common.core.query.PagerQuery; |
|||
import com.yxt.common.core.result.ResultBean; |
|||
import com.yxt.common.core.vo.PagerVo; |
|||
import org.apache.commons.lang3.StringUtils; |
|||
import com.yxt.common.base.utils.PagerUtil; |
|||
|
|||
import org.springframework.stereotype.Service; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* Project: warehouse(仓储) <br/> |
|||
* File: PurchasenewProductService.java <br/> |
|||
* Class: com.wh..biz.purchasenewproduct.PurchasenewProductService <br/> |
|||
* Description: purchasenew_product 业务逻辑. <br/> |
|||
* Copyright: Copyright (c) 2011 <br/> |
|||
* Company: https://gitee.com/liuzp315 <br/>
|
|||
* Makedate: 2023-06-10 18:09:57 <br/> |
|||
* |
|||
* @author liupopo |
|||
* @version 1.0 |
|||
* @since 1.0 |
|||
*/ |
|||
@Service |
|||
public class PurchasenewProductService extends MybatisBaseService<PurchasenewProductMapper, PurchasenewProduct> { |
|||
private QueryWrapper<PurchasenewProduct> createQueryWrapper(PurchasenewProductQuery query) { |
|||
// todo: 这里根据具体业务调整查询条件
|
|||
// 多字段Like示例:qw.and(wrapper -> wrapper.like("name", query.getName()).or().like("remark", query.getName()));
|
|||
QueryWrapper<PurchasenewProduct> qw = new QueryWrapper<>(); |
|||
if(StringUtils.isNotBlank(query.getMainSid())){ |
|||
qw.eq("main_sid",query.getMainSid()); |
|||
} |
|||
return qw; |
|||
} |
|||
|
|||
public PagerVo<PurchasenewProductVo> listPageVo(PagerQuery<PurchasenewProductQuery> pq) { |
|||
PurchasenewProductQuery query = pq.getParams(); |
|||
QueryWrapper<PurchasenewProduct> qw = createQueryWrapper(query); |
|||
IPage<PurchasenewProduct> page = PagerUtil.queryToPage(pq); |
|||
IPage<PurchasenewProductVo> pagging = baseMapper.selectPageVo(page, qw); |
|||
PagerVo<PurchasenewProductVo> p = PagerUtil.pageToVo(pagging, null); |
|||
return p; |
|||
} |
|||
|
|||
public void saveOrUpdateDto(PurchasenewProductDto dto){ |
|||
String dtoSid = dto.getSid(); |
|||
if (StringUtils.isBlank(dtoSid)) { |
|||
this.insertByDto(dto); |
|||
return; |
|||
} |
|||
this.updateByDto(dto); |
|||
} |
|||
|
|||
public void insertByDto(PurchasenewProductDto dto){ |
|||
PurchasenewProduct entity = new PurchasenewProduct(); |
|||
BeanUtil.copyProperties(dto, entity, "id", "sid"); |
|||
baseMapper.insert(entity); |
|||
} |
|||
|
|||
public void updateByDto(PurchasenewProductDto dto){ |
|||
String dtoSid = dto.getSid(); |
|||
if (StringUtils.isBlank(dtoSid)) { |
|||
return; |
|||
} |
|||
PurchasenewProduct entity = fetchBySid(dtoSid); |
|||
BeanUtil.copyProperties(dto, entity, "id", "sid"); |
|||
baseMapper.updateById(entity); |
|||
} |
|||
|
|||
public PurchasenewProductDetailsVo fetchDetailsVoBySid(String sid){ |
|||
PurchasenewProduct entity = fetchBySid(sid); |
|||
PurchasenewProductDetailsVo vo = new PurchasenewProductDetailsVo(); |
|||
BeanUtil.copyProperties(entity, vo); |
|||
return vo; |
|||
} |
|||
|
|||
/** |
|||
* 根据采购订单的sid删除采购订单的商品信息 |
|||
* @param dtoSid |
|||
*/ |
|||
public ResultBean deleteByPurchaseSid(String dtoSid) { |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
if(StringUtils.isBlank(dtoSid)){ |
|||
return rb; |
|||
} |
|||
PurchasenewProductQuery query=new PurchasenewProductQuery(); |
|||
query.setMainSid(dtoSid); |
|||
QueryWrapper<PurchasenewProduct> qw = createQueryWrapper(query); |
|||
int delete = baseMapper.delete(qw); |
|||
if (delete>0) |
|||
return rb.success(); |
|||
return rb; |
|||
|
|||
} |
|||
|
|||
/** |
|||
* 根据采购订单的sid查询 对应的商品列表 |
|||
* @param sid |
|||
* @return |
|||
*/ |
|||
|
|||
public List<PurchasenewProductVo> fetchDetailsVoByPurchaseSid(String sid) { |
|||
return baseMapper.fetchDetailsVoByPurchaseSid(sid); |
|||
} |
|||
} |
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue