|
|
|
@ -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); |
|
|
|
|
} |
|
|
|
|