|
@ -8,6 +8,9 @@ import com.yxt.supervise.customer.api.gdinstoragegd.*; |
|
|
import com.yxt.supervise.customer.api.gdinstoragelog.GdInstorageLog; |
|
|
import com.yxt.supervise.customer.api.gdinstoragelog.GdInstorageLog; |
|
|
import com.yxt.supervise.customer.api.gdsales.GdSalesExcelVo; |
|
|
import com.yxt.supervise.customer.api.gdsales.GdSalesExcelVo; |
|
|
import com.yxt.supervise.customer.api.gdsales.GdSalesQuery; |
|
|
import com.yxt.supervise.customer.api.gdsales.GdSalesQuery; |
|
|
|
|
|
import com.yxt.supervise.customer.biz.gdinstoragelog.GdInstorageLogService; |
|
|
|
|
|
import com.yxt.supervise.customer.biz.gdinventorylog.GdInventoryLogService; |
|
|
|
|
|
import com.yxt.supervise.customer.biz.gdsaleslog.GdSalesLogService; |
|
|
import io.swagger.annotations.Api; |
|
|
import io.swagger.annotations.Api; |
|
|
import io.swagger.annotations.ApiOperation; |
|
|
import io.swagger.annotations.ApiOperation; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
@ -29,6 +32,18 @@ import java.util.List; |
|
|
public class GdInstorageGdRest implements GdInstorageGdFeign { |
|
|
public class GdInstorageGdRest implements GdInstorageGdFeign { |
|
|
@Autowired |
|
|
@Autowired |
|
|
private GdInstorageGdService gdInstorageGdService; |
|
|
private GdInstorageGdService gdInstorageGdService; |
|
|
|
|
|
@Autowired |
|
|
|
|
|
GdInstorageLogService instorageLogService; |
|
|
|
|
|
@Autowired |
|
|
|
|
|
GdInventoryLogService inventoryLogService; |
|
|
|
|
|
@Autowired |
|
|
|
|
|
GdSalesLogService gdSalesLogService; |
|
|
|
|
|
|
|
|
|
|
|
@PostMapping("/sendMsg") |
|
|
|
|
|
public void send(@RequestBody String message) { |
|
|
|
|
|
gdInstorageGdService.sendMsg(message); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ApiOperation("根据条件分页查询数据的列表") |
|
|
@ApiOperation("根据条件分页查询数据的列表") |
|
|
@PostMapping("/listPage") |
|
|
@PostMapping("/listPage") |
|
|
public ResultBean<PagerVo<GdInstorageGd>> listPage(@RequestBody PagerQuery<GdInstorageGdQuery> pq) { |
|
|
public ResultBean<PagerVo<GdInstorageGd>> listPage(@RequestBody PagerQuery<GdInstorageGdQuery> pq) { |
|
@ -56,21 +71,18 @@ public class GdInstorageGdRest implements GdInstorageGdFeign { |
|
|
public ResultBean<GdInstorageLog> uploadGdData(@RequestParam("file") MultipartFile file) { |
|
|
public ResultBean<GdInstorageLog> uploadGdData(@RequestParam("file") MultipartFile file) { |
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
GdInstorageLog gdInstorageLog=gdInstorageGdService.uploadAndInsert(file); |
|
|
GdInstorageLog gdInstorageLog=gdInstorageGdService.uploadAndInsert(file); |
|
|
gdInstorageLog.getOrderDate(); |
|
|
//判断都就给report服务发消息
|
|
|
|
|
|
if(ee(gdInstorageLog.getOrderDate())==true){ |
|
|
|
|
|
this.send(gdInstorageLog.getOrderDate()); |
|
|
|
|
|
} |
|
|
rb.success().setData(gdInstorageLog); |
|
|
rb.success().setData(gdInstorageLog); |
|
|
return rb; |
|
|
return rb; |
|
|
} |
|
|
} |
|
|
public class GdSalesThread extends Thread{ |
|
|
public Boolean ee(String orderDate){ |
|
|
String orderDate; |
|
|
//判断入库 销售 库存已经是否上传excel
|
|
|
public GdSalesThread(String orderDate) { |
|
|
if(instorageLogService.getLogByOrderDate(orderDate).equals(null) && inventoryLogService.getLogByOrderDate(orderDate).equals(null) && gdSalesLogService.getLogByOrderDate(orderDate).equals(null)){ |
|
|
this.orderDate = orderDate; |
|
|
return true; |
|
|
} |
|
|
|
|
|
public void run(){ |
|
|
|
|
|
|
|
|
|
|
|
System.out.println("excel线程开启"); |
|
|
|
|
|
gdInstorageGdService.uploadAndInsert(null); |
|
|
|
|
|
System.out.println("excel线程结束"); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
return false; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|