提交 4b3a7435 作者: chaining

Merge remote-tracking branch 'origin/dev' into dev

package com.boco.nbd.wios.export.impl;
import com.boco.nbd.wios.export.Export;
import com.boco.nbd.wios.manage.convert.WallboxApplyConvert;
import com.boco.nbd.wios.manage.entity.bo.SupplierBo;
import com.boco.nbd.wios.manage.entity.bo.SupplierVo;
import com.boco.nbd.wios.manage.entity.bo.WallboxApply;
import com.boco.nbd.wios.manage.entity.cams.enums.OrderStatus;
import com.boco.nbd.wios.manage.entity.vo.WallboxApplyInstallListVO;
import com.boco.nbd.wios.manage.entity.vo.WallboxApplyReqVO;
import com.boco.nbd.wios.manage.mapper.def.WallboxApplyMapper;
import com.boco.nbd.wios.manage.service.impl.SupplierService;
import com.boco.nbd.wios.manage.service.impl.WallboxApplyService;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
......@@ -25,9 +22,8 @@ import java.util.List;
/**
* 辅材导出WallboxApplyInstallListVO
*
*
* @author
* @version
*/
@Service
public class WallBoxExport implements Export<WallboxApplyInstallListVO> {
......@@ -36,13 +32,15 @@ public class WallBoxExport implements Export<WallboxApplyInstallListVO> {
private WallboxApplyMapper wallboxApplyMapper;
@Autowired
private WallboxApplyService wallboxApplyService;
@Override
public List<WallboxApplyInstallListVO> getExportList(String json) throws Exception {
ObjectMapper mapper = new ObjectMapper();
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
WallboxApplyReqVO condition = mapper.readValue(json, WallboxApplyReqVO.class);
List<WallboxApplyInstallListVO> list = wallboxApplyService.selectWallboxApplyListFromOrder(WallboxApplyConvert.INSTANCE.convert(condition));
WallboxApply wallboxApply = new WallboxApply();
BeanUtils.copyProperties(condition, wallboxApply);
List<WallboxApplyInstallListVO> list = wallboxApplyService.selectWallboxApplyListFromOrder(wallboxApply);
LocalDateTime currentTime = LocalDateTime.now();
Long no = 1L;
for (WallboxApplyInstallListVO apply : list) {
......@@ -61,11 +59,11 @@ public class WallBoxExport implements Export<WallboxApplyInstallListVO> {
apply.setTimeRemaining(Long.toString(remainingHours));
apply.setId(no++);
apply.setNumber("1");
if (!StringUtils.isEmpty(apply.getInstallStatus())){
if (!StringUtils.isEmpty(apply.getInstallStatus())) {
apply.setInstallStatusName(OrderStatus.getText(Integer.parseInt(apply.getInstallStatus())));
}
}
return list;
}
}
......@@ -196,19 +196,20 @@ public class FlowOrderController {
@GetMapping("/getCanDeliveryOrder")
@ApiOperation("获取可以发货的订单列表")
public ResponseMessage2 getCanDeliveryOrder(@RequestParam String orderId,@RequestParam String isproduct){
List<OrderVo> list=flowOrderMapper.getCanDeliveryOrder(orderId);
List<OrderVo> list=flowOrderMapper.getCanDeliveryOrder(orderId,"品牌墙盒".equals(isproduct));
list.stream().forEach(i->{
MaterialsEx materials=materialsMapperEx.materialsByMaterialsCode(i.getItemModel());
if (materials!=null){
i.setMaterialName(materials.getMaterialsName());
}
});
if ("品牌墙盒".equals(isproduct)){
List<OrderVo> has = list.stream().filter(i -> i.getInstallWallboxModel().equals("CAMS")).collect(Collectors.toList());
return ResponseMessage2.Success2(has);
}else {
//List<OrderPO> has = list.stream().filter(i -> !i.getInstallWallboxModel().equals("CAMS")).collect(Collectors.toList());
return ResponseMessage2.Success2(list);
}
return ResponseMessage2.Success2(list);
// if ("品牌墙盒".equals(isproduct)){
// List<OrderVo> has = list.stream().filter(i -> i.getInstallWallboxModel().equals("CAMS")).collect(Collectors.toList());
// return ResponseMessage2.Success2(has);
// }else {
// //List<OrderPO> has = list.stream().filter(i -> !i.getInstallWallboxModel().equals("CAMS")).collect(Collectors.toList());
// return ResponseMessage2.Success2(list);
// }
}
}
......@@ -97,7 +97,7 @@ public interface FlowOrderMapper extends BaseMapper3<OrderPO> {
*/
List<VisitOrderPO> getVisitOrderScore(OrderBo orderBo);
@Select("select o.* from t_order o inner join t_wallbox_apply w on o.id=w.order_id where o.id like concat('%', #{orderId}, '%') and w.check_status=2 and IFNULL(w.tracking_status,'0')='0'")
List<OrderVo> getCanDeliveryOrder(@Param("orderId")String orderId);
//@Select("select o.* from t_order o inner join t_wallbox_apply w on o.id=w.order_id where o.id like concat('%', #{orderId}, '%') and w.check_status=2 and IFNULL(w.tracking_status,'0')='0'")
List<OrderVo> getCanDeliveryOrder(@Param("orderId")String orderId,@Param("isproduct")boolean isproduct);
}
......@@ -5,7 +5,6 @@ import cn.hutool.core.lang.Assert;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSON;
import com.boco.nbd.wios.manage.client.DepponClient;
import com.boco.nbd.wios.manage.convert.WallboxApplyConvert;
import com.boco.nbd.wios.manage.entity.bo.Order;
import com.boco.nbd.wios.manage.entity.bo.Supplier;
import com.boco.nbd.wios.manage.entity.bo.SupplierStaff;
......@@ -22,6 +21,7 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
......@@ -65,7 +65,7 @@ public class WallboxApplyController {
@ApiImplicitParams({@ApiImplicitParam(name = "orderId", value = "订单id", dataType = "string", paramType = "query",
required = true), @ApiImplicitParam(name = "ifEmergency", value = "是否紧急0否,1是", dataType = "int",
paramType = "query", required = true),})
public BaseResponse<Object> applyInstallation(String orderId, Integer ifEmergency,String receiverWarehouseId) {
public BaseResponse<Object> applyInstallation(String orderId, Integer ifEmergency, String receiverWarehouseId) {
Assert.notNull(orderId, "订单id不能为空");
Order order = orderService.get(orderId);
if (ObjectUtil.isNull(order)) {
......@@ -106,8 +106,10 @@ public class WallboxApplyController {
required = true), @ApiImplicitParam(name = "pagecount", value = "页码", dataType = "int", paramType =
"query", required = true)})
public BaseResponse<List<WallboxApplyInstallListVO>> list(WallboxApplyReqVO req) {
WallboxApply wallboxApply = new WallboxApply();
BeanUtils.copyProperties(req, wallboxApply);
List<WallboxApplyInstallListVO> list =
wallboxApplyService.selectWallboxApplyListFromOrder(WallboxApplyConvert.INSTANCE.convert(req));
wallboxApplyService.selectWallboxApplyListFromOrder(wallboxApply);
LocalDateTime currentTime = LocalDateTime.now();
for (WallboxApplyInstallListVO apply : list) {
apply.setNumber("1");
......@@ -145,8 +147,10 @@ public class WallboxApplyController {
throw new ServiceException("供应商不存在");
}
req.setSupplierId(supplier.getId());
WallboxApply wallboxApply = new WallboxApply();
BeanUtils.copyProperties(req, wallboxApply);
List<WallboxApplyInstallListVO> list =
wallboxApplyService.selectWallboxApplyListFromOrder(WallboxApplyConvert.INSTANCE.convert(req));
wallboxApplyService.selectWallboxApplyListFromOrder(wallboxApply);
LocalDateTime currentTime = LocalDateTime.now();
for (WallboxApplyInstallListVO apply : list) {
Date createdDate = apply.getCreatedTime();
......@@ -197,8 +201,10 @@ public class WallboxApplyController {
required = true), @ApiImplicitParam(name = "pagecount", value = "页码", dataType = "int", paramType =
"query", required = true)})
public void export(HttpServletResponse response, WallboxApplyReqVO req) throws IOException {
WallboxApply wallboxApply = new WallboxApply();
BeanUtils.copyProperties(req, wallboxApply);
List<WallboxApplyInstallListVO> list =
wallboxApplyService.selectWallboxApplyListFromOrder(WallboxApplyConvert.INSTANCE.convert(req));
wallboxApplyService.selectWallboxApplyListFromOrder(wallboxApply);
ExcelUtils.write(response, "墙盒申请数据导出.xls", "墙盒申请数据", WallboxApplyInstallListVO.class, list);
}
......@@ -211,6 +217,7 @@ public class WallboxApplyController {
public BaseResponse<Object> getInfo(@PathVariable("id") Long id) {
return new BaseResponse<>(wallboxApplyService.selectWallboxApplyById(id));
}
/**
* 根据订单号查询详情
*/
......@@ -266,7 +273,7 @@ public class WallboxApplyController {
@ApiOperation(value = "查询当前账号所属团队")
@GetMapping("/getTeamOrder")
public BaseResponse<Object> getTeamOrder(){
public BaseResponse<Object> getTeamOrder() {
SessionInfo loginUser = tokenService.getUser();
String userId = loginUser.getUserId();
......
server:
tomcat:
uri-encoding: UTF-8
servlet:
context-path: /api2
spring:
http:
encoding:
......
......@@ -296,4 +296,20 @@
and a.install_finish_time &lt;= #{installFinishEndTime}
</if>
</select>
<select id="getCanDeliveryOrder" resultType="com.boco.nbd.wios.manage.entity.bo.OrderVo">
select o.*
from t_order o
inner join t_wallbox_apply w on o.id=w.order_id
left join t_oem_cascade tc on tc.id = o.wallbox_model
where o.id like concat('%', #{orderId}, '%')
and w.check_status=2
and IFNULL(w.tracking_status,'0')='0'
<if test="isproduct == true">
and tc.name='CAMS'
</if>
<if test="isproduct == false">
and tc.name != 'CAMS'
</if>
</select>
</mapper>
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论