|
|
|
@ -36,6 +36,7 @@ import io.swagger.annotations.ApiOperation;
|
|
|
|
|
import io.swagger.annotations.ApiParam; |
|
|
|
|
import lombok.AllArgsConstructor; |
|
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
|
import org.springblade.common.constant.orderpackage.OrderPackageReservationStatusConstant; |
|
|
|
|
import org.springblade.core.boot.ctrl.BladeController; |
|
|
|
|
import org.springblade.core.excel.util.ExcelUtil; |
|
|
|
|
import org.springblade.core.mp.support.Condition; |
|
|
|
@ -98,6 +99,7 @@ public class DistributionStockArticleController extends BladeController {
|
|
|
|
|
DistributionStockArticleEntity detail = distributionStockArticleService.getOne(Condition.getQueryWrapper(distributionStockArticle)); |
|
|
|
|
return R.data(detail); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 配送在库订单 分页 |
|
|
|
|
*/ |
|
|
|
@ -150,8 +152,8 @@ public class DistributionStockArticleController extends BladeController {
|
|
|
|
|
@GetMapping("/getPackageListByStockArticleId") |
|
|
|
|
@ApiOperationSupport(order = 2) |
|
|
|
|
@ApiOperation(value = "分页", notes = "传入distributionStockArticle") |
|
|
|
|
public R<IPage<DistributionParcelListVO>> getPackageListByStockArticleId(@ApiIgnore @RequestParam Map<String,Object> packageDTO, Query query) { |
|
|
|
|
if (Func.isEmpty(packageDTO.get("id"))){ |
|
|
|
|
public R<IPage<DistributionParcelListVO>> getPackageListByStockArticleId(@ApiIgnore @RequestParam Map<String, Object> packageDTO, Query query) { |
|
|
|
|
if (Func.isEmpty(packageDTO.get("id"))) { |
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
IPage<DistributionParcelListVO> pages = distributionStockArticleService.getPackageListByStockArticleId(Condition.getPage(query), packageDTO); |
|
|
|
@ -171,9 +173,6 @@ public class DistributionStockArticleController extends BladeController {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
|
|
|
|
|
// if (Func.isEmpty(myCurrentWarehouse)){
|
|
|
|
|
// return R.fail("无仓库信息!!!");
|
|
|
|
@ -262,7 +261,6 @@ public class DistributionStockArticleController extends BladeController {
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 配送在库订单--客户版本 分页 |
|
|
|
|
*/ |
|
|
|
@ -282,11 +280,11 @@ public class DistributionStockArticleController extends BladeController {
|
|
|
|
|
// distributionStockArticle.setWarehouseIdList(collect);
|
|
|
|
|
// 得到当前登录用户的Id
|
|
|
|
|
List<BasicdataClientUserEntity> basicdataClientUserEntityListByUserIds = basicdataClientClient.getBasicdataClientUserEntityListByUserId(AuthUtil.getUserId()); |
|
|
|
|
List clientIds =null; |
|
|
|
|
if(Func.isNotEmpty(basicdataClientUserEntityListByUserIds)){ |
|
|
|
|
List clientIds = null; |
|
|
|
|
if (Func.isNotEmpty(basicdataClientUserEntityListByUserIds)) { |
|
|
|
|
clientIds = basicdataClientUserEntityListByUserIds.stream().map(BasicdataClientUserEntity::getClientId).collect(Collectors.toList()); |
|
|
|
|
distributionStockArticle.setClientIds(clientIds); |
|
|
|
|
}else { |
|
|
|
|
} else { |
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
IPage<DistributionStockArticleEntity> pages = distributionStockArticleService.selectClientListPage(Condition.getPage(query), distributionStockArticle); |
|
|
|
@ -294,8 +292,6 @@ public class DistributionStockArticleController extends BladeController {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 配送在库订单 自定义分页 |
|
|
|
|
*/ |
|
|
|
@ -354,22 +350,25 @@ public class DistributionStockArticleController extends BladeController {
|
|
|
|
|
public R updateClient(@Valid @RequestBody DistributionStockArticleEntity distributionStockArticle) { |
|
|
|
|
Long id = distributionStockArticle.getId(); |
|
|
|
|
DistributionStockArticleEntity oldStockArticle = distributionStockArticleService.getById(id); |
|
|
|
|
if (!OrderPackageReservationStatusConstant.daiyuyue.getValue().equals(oldStockArticle)) { |
|
|
|
|
return R.fail(oldStockArticle.getOrderCode() + "存在预约信息"); |
|
|
|
|
} |
|
|
|
|
DistributionStockArticleEntity newStockArticle = new DistributionStockArticleEntity(); |
|
|
|
|
BeanUtil.copy(oldStockArticle,newStockArticle); |
|
|
|
|
BeanUtil.copy(oldStockArticle, newStockArticle); |
|
|
|
|
String consigneePerson = distributionStockArticle.getConsigneePerson(); |
|
|
|
|
String customerName = distributionStockArticle.getCustomerName(); |
|
|
|
|
if(StringUtil.isNotBlank(consigneePerson)){ |
|
|
|
|
if (StringUtil.isNotBlank(consigneePerson)) { |
|
|
|
|
newStockArticle.setConsigneePerson(consigneePerson); |
|
|
|
|
newStockArticle.setConsigneeMobile(distributionStockArticle.getConsigneeMobile()); |
|
|
|
|
newStockArticle.setConsigneeAddress(distributionStockArticle.getConsigneeAddress()); |
|
|
|
|
}else{ |
|
|
|
|
} else { |
|
|
|
|
newStockArticle.setCustomerName(customerName); |
|
|
|
|
newStockArticle.setCustomerTelephone(distributionStockArticle.getCustomerTelephone()); |
|
|
|
|
newStockArticle.setCustomerAddress(distributionStockArticle.getCustomerAddress()); |
|
|
|
|
} |
|
|
|
|
String content = oldStockArticle.compareCustomerInfo(newStockArticle); |
|
|
|
|
if(StringUtil.isNotBlank(content)){ |
|
|
|
|
distributionOrderCustomerLogService.saveLog(content,1,id); |
|
|
|
|
if (StringUtil.isNotBlank(content)) { |
|
|
|
|
distributionOrderCustomerLogService.saveLog(content, 1, id); |
|
|
|
|
} |
|
|
|
|
return R.status(distributionStockArticleService.updateById(distributionStockArticle)); |
|
|
|
|
} |
|
|
|
@ -379,30 +378,37 @@ public class DistributionStockArticleController extends BladeController {
|
|
|
|
|
@ApiOperation(value = "修改", notes = "传入distributionStockArticle") |
|
|
|
|
public R updateBatchClient(@Valid @RequestBody DistributionStockArticleDTO distributionStockArticleDTO) { |
|
|
|
|
List<DistributionStockArticleEntity> entityList = distributionStockArticleDTO.getEntityList(); |
|
|
|
|
if (!entityList.isEmpty()) { |
|
|
|
|
boolean flag = entityList.stream().anyMatch(a -> !OrderPackageReservationStatusConstant.daiyuyue.getValue().equals(a.getReservationStatus())); |
|
|
|
|
if (flag) { |
|
|
|
|
String orderCode = entityList.stream().filter(f -> !OrderPackageReservationStatusConstant.daiyuyue.getValue().equals(f.getReservationStatus())).map(DistributionStockArticleEntity::getOrderCode).distinct().collect(Collectors.joining(",")); |
|
|
|
|
return R.fail(orderCode + "存在预约信息"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
for (DistributionStockArticleEntity stockArticleEntity : entityList) { |
|
|
|
|
Long id = stockArticleEntity.getId(); |
|
|
|
|
DistributionStockArticleEntity oldStockArticle = distributionStockArticleService.getById(id); |
|
|
|
|
DistributionStockArticleEntity newStockArticle = new DistributionStockArticleEntity(); |
|
|
|
|
BeanUtil.copy(oldStockArticle,newStockArticle); |
|
|
|
|
BeanUtil.copy(oldStockArticle, newStockArticle); |
|
|
|
|
String consigneePerson = stockArticleEntity.getConsigneePerson(); |
|
|
|
|
String customerName = stockArticleEntity.getCustomerName(); |
|
|
|
|
String mallName = stockArticleEntity.getMallName(); |
|
|
|
|
String consigneeUnit = stockArticleEntity.getConsigneeUnit(); |
|
|
|
|
if(StringUtil.isNotBlank(consigneePerson)){ |
|
|
|
|
if (StringUtil.isNotBlank(consigneePerson)) { |
|
|
|
|
newStockArticle.setConsigneePerson(consigneePerson); |
|
|
|
|
newStockArticle.setConsigneeMobile(stockArticleEntity.getConsigneeMobile()); |
|
|
|
|
newStockArticle.setConsigneeAddress(stockArticleEntity.getConsigneeAddress()); |
|
|
|
|
}else if (StringUtil.isNotBlank(customerName)){ |
|
|
|
|
} else if (StringUtil.isNotBlank(customerName)) { |
|
|
|
|
newStockArticle.setCustomerName(customerName); |
|
|
|
|
newStockArticle.setCustomerTelephone(stockArticleEntity.getCustomerTelephone()); |
|
|
|
|
newStockArticle.setCustomerAddress(stockArticleEntity.getCustomerAddress()); |
|
|
|
|
}else { |
|
|
|
|
} else { |
|
|
|
|
newStockArticle.setMallName(mallName); |
|
|
|
|
newStockArticle.setConsigneeUnit(consigneeUnit); |
|
|
|
|
} |
|
|
|
|
String content = oldStockArticle.compareCustomerInfo(newStockArticle); |
|
|
|
|
if(StringUtil.isNotBlank(content)){ |
|
|
|
|
distributionOrderCustomerLogService.saveLog(content,2,id); |
|
|
|
|
if (StringUtil.isNotBlank(content)) { |
|
|
|
|
distributionOrderCustomerLogService.saveLog(content, 2, id); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -414,9 +420,9 @@ public class DistributionStockArticleController extends BladeController {
|
|
|
|
|
@ApiOperation(value = "修改客户信息日志", notes = "传入distributionStockArticle") |
|
|
|
|
public R findEditCustomerLog(@Valid @RequestBody DistributionStockArticleDTO distributionStockArticleDTO) { |
|
|
|
|
Long orderId = distributionStockArticleDTO.getOrderId(); |
|
|
|
|
if(Objects.isNull(orderId)){ |
|
|
|
|
log.warn("##############findEditCustomerLog: 订单id不能为空 orderId={}",orderId); |
|
|
|
|
return R.fail(405,"订单id不能为空"); |
|
|
|
|
if (Objects.isNull(orderId)) { |
|
|
|
|
log.warn("##############findEditCustomerLog: 订单id不能为空 orderId={}", orderId); |
|
|
|
|
return R.fail(405, "订单id不能为空"); |
|
|
|
|
} |
|
|
|
|
return distributionStockArticleService.findEditCustomerLog(orderId); |
|
|
|
|
} |
|
|
|
@ -483,11 +489,11 @@ public class DistributionStockArticleController extends BladeController {
|
|
|
|
|
@GetMapping("/selectStockArticleAndParcel") |
|
|
|
|
@ApiOperationSupport(order = 7) |
|
|
|
|
@ApiOperation(value = "查询订单和订单的包件信息", notes = "传入ids") |
|
|
|
|
public R selectStockArticleAndParcel(@RequestParam(required = false) String typeService,@RequestParam(required = false) String genre,@RequestParam(required = false)String id) { |
|
|
|
|
public R selectStockArticleAndParcel(@RequestParam(required = false) String typeService, @RequestParam(required = false) String genre, @RequestParam(required = false) String id) { |
|
|
|
|
HashMap<String, Object> query = new HashMap<>(); |
|
|
|
|
query.put("typeService",typeService); |
|
|
|
|
query.put("genre",genre); |
|
|
|
|
query.put("id",id); |
|
|
|
|
query.put("typeService", typeService); |
|
|
|
|
query.put("genre", genre); |
|
|
|
|
query.put("id", id); |
|
|
|
|
R<List<DistributionStockArticleVO>> result = distributionStockArticleService.selectStockArticleAndParcel(query); |
|
|
|
|
return result; |
|
|
|
|
} |
|
|
|
@ -499,20 +505,20 @@ public class DistributionStockArticleController extends BladeController {
|
|
|
|
|
@GetMapping("/getShowTemplate") |
|
|
|
|
@ApiOperationSupport(order = 2) |
|
|
|
|
@ApiOperation(value = "生成二维码图片返回前端渲染") |
|
|
|
|
public void getShowTemplate(@ApiIgnore @RequestParam Map<String,Object> params,HttpServletResponse response) throws IllegalAccessException { |
|
|
|
|
public void getShowTemplate(@ApiIgnore @RequestParam Map<String, Object> params, HttpServletResponse response) throws IllegalAccessException { |
|
|
|
|
// boolean result = basicdataGoodsShelfService.getTemplate(params,response);
|
|
|
|
|
distributionStockArticleService.getShowTemplate(params,response); |
|
|
|
|
distributionStockArticleService.getShowTemplate(params, response); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@GetMapping("/showOrderPackgeCode") |
|
|
|
|
@ApiOperationSupport(order = 2) |
|
|
|
|
@ApiOperation(value = "返回模板和模板内容") |
|
|
|
|
public R showOrderPackgeCode(@ApiIgnore @RequestParam Map<String,Object> params){ |
|
|
|
|
public R showOrderPackgeCode(@ApiIgnore @RequestParam Map<String, Object> params) { |
|
|
|
|
|
|
|
|
|
OrderPackgeCodeDataVO orderPackgeCodeDataVo= null; |
|
|
|
|
OrderPackgeCodeDataVO orderPackgeCodeDataVo = null; |
|
|
|
|
try { |
|
|
|
|
orderPackgeCodeDataVo = distributionStockArticleService.showOrderPackgeCode(params ); |
|
|
|
|
orderPackgeCodeDataVo = distributionStockArticleService.showOrderPackgeCode(params); |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
return R.fail(e.getMessage()); |
|
|
|
|
} |
|
|
|
@ -528,9 +534,9 @@ public class DistributionStockArticleController extends BladeController {
|
|
|
|
|
@ApiOperationSupport(order = 12) |
|
|
|
|
@ApiOperation(value = "导入物料基础信息", notes = "传入excel") |
|
|
|
|
public R importStockArticleEntry(MultipartFile file) { |
|
|
|
|
log.info("传入>>>>>>>{}",file); |
|
|
|
|
log.info("传入>>>>>>>{}", file); |
|
|
|
|
DistributionStockArticleImporter materialImporter = new DistributionStockArticleImporter(distributionStockArticleService); |
|
|
|
|
ExcelUtil.save(file,materialImporter,DistributionStockArticleExcel.class); |
|
|
|
|
ExcelUtil.save(file, materialImporter, DistributionStockArticleExcel.class); |
|
|
|
|
return R.success("操作成功"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -541,19 +547,18 @@ public class DistributionStockArticleController extends BladeController {
|
|
|
|
|
@GetMapping("deliveryInfo") |
|
|
|
|
@ApiOperationSupport(order = 12) |
|
|
|
|
@ApiOperation(value = "导入物料基础信息", notes = "传入excel") |
|
|
|
|
public R getdeliveryInfo(@RequestParam Integer type,@RequestParam String code) { |
|
|
|
|
public R getdeliveryInfo(@RequestParam Integer type, @RequestParam String code) { |
|
|
|
|
|
|
|
|
|
return distributionStockArticleService.getdeliveryInfo(type,code); |
|
|
|
|
return distributionStockArticleService.getdeliveryInfo(type, code); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@GetMapping("/showOrderCode") |
|
|
|
|
@ApiOperationSupport(order = 2) |
|
|
|
|
@ApiOperation(value = "展示订单码") |
|
|
|
|
public R showOrderCode(@ApiIgnore @RequestParam Map<String,Object> params){ |
|
|
|
|
public R showOrderCode(@ApiIgnore @RequestParam Map<String, Object> params) { |
|
|
|
|
|
|
|
|
|
OrderCodeDataVO orderCodeDataVO= null; |
|
|
|
|
OrderCodeDataVO orderCodeDataVO = null; |
|
|
|
|
try { |
|
|
|
|
orderCodeDataVO = distributionStockArticleService.showOrderCode(params); |
|
|
|
|
} catch (Exception e) { |
|
|
|
@ -567,16 +572,16 @@ public class DistributionStockArticleController extends BladeController {
|
|
|
|
|
@GetMapping("/showOrderCodeByCode") |
|
|
|
|
@ApiOperationSupport(order = 2) |
|
|
|
|
@ApiOperation(value = "展示订单码") |
|
|
|
|
public R showOrderCodeByCode(@ApiIgnore @RequestParam Map<String,Object> params){ |
|
|
|
|
public R showOrderCodeByCode(@ApiIgnore @RequestParam Map<String, Object> params) { |
|
|
|
|
|
|
|
|
|
OrderCodeDataVO orderCodeDataVO= null; |
|
|
|
|
OrderCodeDataVO orderCodeDataVO = null; |
|
|
|
|
try { |
|
|
|
|
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse(); |
|
|
|
|
if(Objects.isNull(myCurrentWarehouse)){ |
|
|
|
|
if (Objects.isNull(myCurrentWarehouse)) { |
|
|
|
|
log.warn("##########showOrderCodeByCode: 仓库信息不存在"); |
|
|
|
|
return R.fail(405,"仓库信息不存在"); |
|
|
|
|
return R.fail(405, "仓库信息不存在"); |
|
|
|
|
} |
|
|
|
|
params.put("warehouseId",myCurrentWarehouse.getId()); |
|
|
|
|
params.put("warehouseId", myCurrentWarehouse.getId()); |
|
|
|
|
|
|
|
|
|
orderCodeDataVO = distributionStockArticleService.showOrderCodeByCode(params); |
|
|
|
|
} catch (Exception e) { |
|
|
|
@ -587,8 +592,6 @@ public class DistributionStockArticleController extends BladeController {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 已签收订单 |
|
|
|
|
*/ |
|
|
|
@ -600,8 +603,8 @@ public class DistributionStockArticleController extends BladeController {
|
|
|
|
|
IPage<DistributionSignforStockArticleVO> pages = distributionStockArticleService.pageSignforListtOwe(Condition.getPage(query), distributionStockArticle); |
|
|
|
|
return R.data(pages); |
|
|
|
|
|
|
|
|
|
}catch (Exception e){ |
|
|
|
|
log.error("已签订单错误e:{}",e); |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
log.error("已签订单错误e:{}", e); |
|
|
|
|
} |
|
|
|
|
return R.data(null); |
|
|
|
|
} |
|
|
|
@ -625,8 +628,8 @@ public class DistributionStockArticleController extends BladeController {
|
|
|
|
|
@GetMapping("/export-signforDistributionStockArticleList") |
|
|
|
|
@ApiOperationSupport(order = 2) |
|
|
|
|
@ApiOperation(value = "已签收订单 导出", notes = "传入distributionStockArticle") |
|
|
|
|
public void exportSignforDistributionStockArticleList(@ApiIgnore @RequestParam Map<String, Object> distributionStockArticle, Query query,HttpServletResponse response) { |
|
|
|
|
List<DistributionSignForStockArticleExcel> list = distributionStockArticleService.exportSignforDistributionStockArticleList(distributionStockArticle,Condition.getPage(query)); |
|
|
|
|
public void exportSignforDistributionStockArticleList(@ApiIgnore @RequestParam Map<String, Object> distributionStockArticle, Query query, HttpServletResponse response) { |
|
|
|
|
List<DistributionSignForStockArticleExcel> list = distributionStockArticleService.exportSignforDistributionStockArticleList(distributionStockArticle, Condition.getPage(query)); |
|
|
|
|
ExcelUtil.export(response, "在库订单明细" + DateUtil.time(), "在库订单明细", list, DistributionSignForStockArticleExcel.class); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|