提交 4b3a7435 作者: chaining

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

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