Browse Source

Merge branch 'dev' into test

test
zhenghaoyu 2 years ago
parent
commit
ca113b11b1
  1. 8
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionStockArticleEntity.java
  2. 2
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionStockListEntity.java
  3. 62
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionStockArticleController.java
  4. 8
      blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/controller/MtFactoryDataController.java

8
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionStockArticleEntity.java

@ -105,7 +105,7 @@ public class DistributionStockArticleEntity extends TenantEntity {
* 在库时间
*/
@ApiModelProperty(value = "在库时间")
private Integer storeTime;
private String storeTime;
/**
* 订单总件数
*/
@ -121,6 +121,12 @@ public class DistributionStockArticleEntity extends TenantEntity {
*/
@ApiModelProperty(value = "是否齐套")
private Integer completeSet;
/**
* 是否齐套名称
*/
@ApiModelProperty(value = "是否齐套名称")
@TableField(exist = false)
private String completeSetName;
/**
* 品牌
*/

2
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionStockListEntity.java

@ -16,6 +16,7 @@
*/
package com.logpm.distribution.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import io.swagger.annotations.ApiModel;
@ -146,6 +147,7 @@ public class DistributionStockListEntity extends TenantEntity {
* 预约数量
*/
@ApiModelProperty(value = "预约数量")
@TableField(exist = false)
private Integer reservationNum;

62
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionStockArticleController.java

@ -45,6 +45,9 @@ import org.springblade.core.tool.utils.DateUtil;
import org.springblade.core.excel.util.ExcelUtil;
import org.springblade.core.tool.constant.BladeConstant;
import springfox.documentation.annotations.ApiIgnore;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Map;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
@ -84,29 +87,52 @@ public class DistributionStockArticleController extends BladeController {
public R<IPage<DistributionStockArticleEntity>> list(@ApiIgnore @RequestParam Map<String, Object> distributionStockArticle, Query query) {
IPage<DistributionStockArticleEntity> pages = distributionStockArticleService.page(Condition.getPage(query), Condition.getQueryWrapper(distributionStockArticle, DistributionStockArticleEntity.class));
pages.getRecords().forEach( i ->{
R<List<DictBiz>> distribution_type = dictBizClient.getList("distribution_type");
DictBiz dictBiz = distribution_type.getData().get(i.getTypeService()-1);
i.setTypeName(dictBiz.getDictValue());
switch (i.getState()){
//计算在库天数
// SimpleDateFormat simpleFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
long time1 = i.getWarehouseEntryTime().getTime(); //入库
long time2 = new Date().getTime(); // 现在
int days = (int) ((time2 - time1) / (1000 * 60 * 60 * 24));
// int hours = (int) ((time2 - time1) / (1000 * 60 * 60));
// int minutes = (int) ((time2 - time1) / (1000 * 60));
// i.setStoreTime(days+"天"+hours+"小时"+minutes+"分钟");
if(days == 0){
days = 1;
}
i.setStoreTime(days+"天");
switch (i.getCompleteSet()){
case 1:
i.setStateName("待预约");
i.setCompleteSetName("否");
break;
case 2:
i.setStateName("已预约");
break;
case 3:
i.setStateName("待配送");
break;
case 4:
i.setStateName("配送中");
break;
case 5:
i.setStateName("已配送");
break;
case 6:
i.setStateName("已完成");
i.setCompleteSetName("是");
break;
}
R<List<DictBiz>> distribution_type = dictBizClient.getList("distribution_type");
if(Func.isNotEmpty(distribution_type.getData())){
DictBiz dictBiz = distribution_type.getData().get(i.getTypeService()-1);
i.setTypeName(dictBiz.getDictValue());
switch (i.getState()){
case 1:
i.setStateName("待预约");
break;
case 2:
i.setStateName("已预约");
break;
case 3:
i.setStateName("待配送");
break;
case 4:
i.setStateName("配送中");
break;
case 5:
i.setStateName("已配送");
break;
case 6:
i.setStateName("已完成");
break;
}
}
});
return R.data(pages);
}

8
blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/controller/MtFactoryDataController.java

@ -35,6 +35,7 @@ import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import java.util.Map;
import java.util.Objects;
/**
* 梦天数据 控制器
@ -78,11 +79,14 @@ public class MtFactoryDataController extends BladeController {
int code = r.getCode();
Map<String,Long> map = (Map<String, Long>) r.getData();
Long mainId = map.get("mainId");
Long mainId = null;
if(!Objects.isNull(map)){
mainId = map.get("mainId");
}
if(code == 200){
orderStatusLog.setStatus(0);
//开启异步线程处理数据
if(mainId != 0){
if(!Objects.isNull(mainId)){
asyncDataService.handlerMtDataToHt(map.get("mainId"));
}
}else{

Loading…
Cancel
Save