mirror of
http://192.168.1.205:9980/cf_devdept2/cf_imes_server.git
synced 2026-08-12 21:02:08 +08:00
Merge remote-tracking branch 'origin/main'
# Conflicts: # cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/dal/mysql/orderGroup/OrderGroupMapper.java
This commit is contained in:
+4
-3
@@ -2,6 +2,7 @@ package com.cf.imes.module.executor.controller.admin.order;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.incrementer.IdentifierGenerator;
|
||||
import com.cf.imes.framework.common.pojo.PageParam;
|
||||
import com.cf.imes.framework.security.core.util.SecurityFrameworkUtils;
|
||||
import com.cf.imes.framework.web.config.WebProperties;
|
||||
import com.cf.imes.module.executor.controller.admin.order.vo.order.*;
|
||||
@@ -304,7 +305,7 @@ public class OrderController {
|
||||
|
||||
System.out.println("orderXmlVO = " + orderXmlVO);
|
||||
}
|
||||
// orderService.importExcelData(orderDO, list, index);
|
||||
orderService.importExcelData(orderDO, list, index);
|
||||
|
||||
|
||||
} catch (Exception e) {
|
||||
@@ -411,8 +412,8 @@ public class OrderController {
|
||||
@GetMapping("/getOrderWarn")
|
||||
@Operation(summary = "生产单超期/到期告警 (工作台)")
|
||||
@PreAuthorize("@ss.hasPermission('productManager:List')")
|
||||
public CommonResult<Map<String, List<OrderOverdueRespVO>>> getOrderOverdue() {
|
||||
return success(orderService.getOrderWarn());
|
||||
public CommonResult<Map<String, PageResult<OrderOverdueRespVO>>> getOrderOverdue(@Valid PageParam pageParam) {
|
||||
return success(orderService.getOrderWarn(pageParam));
|
||||
}
|
||||
|
||||
}
|
||||
+2
-2
@@ -148,10 +148,10 @@ public interface OrderMapper extends BaseMapperX<OrderDO> {
|
||||
IPage<OrderGoodsResp> selectOrderIds(@Param("page") IPage page, @Param(Constants.WRAPPER) Wrapper<OrderDO> wrapper);
|
||||
|
||||
// 生产单预警统计
|
||||
List<OrderOverdueRespVO> selectOrderNear(@Param("today") LocalDateTime today, @Param("orderDate") LocalDateTime orderDate, @Param("organId") Long organId);
|
||||
IPage<OrderOverdueRespVO> selectOrderNear(@Param("orderDate") LocalDate orderDate, @Param("organId") Long organId, @Param("page") IPage<OrderOverdueRespVO> page);
|
||||
|
||||
// 生产单逾期统计
|
||||
List<OrderOverdueRespVO> selectOrderOverdue(@Param("today") LocalDateTime today, @Param("organId") Long organId);
|
||||
IPage<OrderOverdueRespVO> selectOrderOverdue(@Param("today") LocalDate today, @Param("organId") Long organId, @Param("page") IPage<OrderOverdueRespVO> page);
|
||||
|
||||
/**
|
||||
* 生产单数量统计
|
||||
|
||||
+5
-3
@@ -46,11 +46,12 @@ public interface OrderBodyMapper extends BaseMapperX<OrderBodyDO> {
|
||||
}
|
||||
|
||||
// 单个修改删除状态 by id
|
||||
default int updateDeletedById(Long id, Integer deleted, Long organId) {
|
||||
default int updateDeletedById(Collection<Long> ids, Integer deleted, Long organId, Long orderId) {
|
||||
return update(new LambdaUpdateWrapper<OrderBodyDO>()
|
||||
.set(OrderBodyDO::getDeleted, deleted)
|
||||
.eq(OrderBodyDO::getId, id)
|
||||
.eq(OrderBodyDO::getOrganId, organId));
|
||||
.in(OrderBodyDO::getId, ids)
|
||||
.eq(OrderBodyDO::getOrganId, organId)
|
||||
.eq(OrderBodyDO::getOrderId, orderId));
|
||||
}
|
||||
|
||||
default int deletedByOrderId(Long orderId, Long organId) {
|
||||
@@ -118,6 +119,7 @@ public interface OrderBodyMapper extends BaseMapperX<OrderBodyDO> {
|
||||
.eq(OrderBodyDO::getOrganId, organId)
|
||||
.eqIfPresent(OrderBodyDO::getOrderId, orderId));
|
||||
}
|
||||
|
||||
// 批量删除
|
||||
default int deleteBatch(Collection<?> orderId) {
|
||||
return delete(new LambdaQueryWrapperX<OrderBodyDO>()
|
||||
|
||||
+18
-5
@@ -36,11 +36,15 @@ public interface OrderGroupMapper extends BaseMapperX<OrderGroupDO> {
|
||||
}
|
||||
|
||||
// 单个修改删除状态 by bodyId
|
||||
default int updateDeletedById(Long id, Integer deleted, Long organId) {
|
||||
return update(new LambdaUpdateWrapper<OrderGroupDO>()
|
||||
.set(OrderGroupDO::getDeleted, deleted)
|
||||
.eq(OrderGroupDO::getBodyId, id)
|
||||
.eq(OrderGroupDO::getOrganId, organId));
|
||||
default int updateDeletedById(Collection<Long> bodyIds, Integer deleted, Long organId, Long orderId) {
|
||||
if (bodyIds != null && !bodyIds.isEmpty()) {
|
||||
return update(new LambdaUpdateWrapper<OrderGroupDO>()
|
||||
.set(OrderGroupDO::getDeleted, deleted)
|
||||
.in(OrderGroupDO::getBodyId, bodyIds)
|
||||
.eq(OrderGroupDO::getOrganId, organId)
|
||||
.eq(OrderGroupDO::getOrderId, orderId));
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
default int deletedById(Long id, Long organId) {
|
||||
@@ -87,12 +91,21 @@ public interface OrderGroupMapper extends BaseMapperX<OrderGroupDO> {
|
||||
.eq(OrderGroupDO::getOrganId, organId)
|
||||
.eqIfPresent(OrderGroupDO::getOrderId, orderId));
|
||||
}
|
||||
|
||||
// 批量删除
|
||||
default int deleteBatch(Collection<?> orderId) {
|
||||
return delete(new LambdaQueryWrapperX<OrderGroupDO>()
|
||||
.in(OrderGroupDO::getOrderId, orderId));
|
||||
}
|
||||
|
||||
// 批量查询
|
||||
default List<Long> selectListByBodyId(Collection<Long> bodyIds, Long orderId, Long organId, Integer deleted) {
|
||||
return selectList(new LambdaQueryWrapperX<OrderGroupDO>()
|
||||
.eq(OrderGroupDO::getOrderId, orderId)
|
||||
.eq(OrderGroupDO::getOrganId, organId)
|
||||
.in(OrderGroupDO::getBodyId, bodyIds)).stream().map(OrderGroupDO::getId).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
|
||||
List<OrderGroupRespVO> selectTestSQL(@Param("filed") String filed, @Param("field2") String field2 ,@Param("groupIds") List<Long> groupIds, @Param("organId") Long organId);
|
||||
|
||||
|
||||
+1
-1
@@ -70,7 +70,7 @@ public interface OrderPartsMapper extends BaseMapperX<OrderPartsDO> {
|
||||
|
||||
List<PrintOrderPartsRespVO> selectPartList( @Param("orderIds") List<Long> orderIds,@Param("organId") Long organId);
|
||||
|
||||
List<Long> selectPartsIdListByBodyId(@Param("bodyId") Long bodyId, @Param("organId") Long organId);
|
||||
List<Long> selectPartsIdListByBodyId(@Param("bodyIds") Collection<Long> bodyIds, @Param("organId") Long organId, @Param("orderId") Long orderId);
|
||||
|
||||
int countPartsByOrderId(@Param("orderId") Long orderId, @Param("organId") Long organId, @Param("deleted") Integer deleted);
|
||||
|
||||
|
||||
+3
-4
@@ -110,7 +110,7 @@ public interface PlateMapper extends BaseMapperX<PlateDO> {
|
||||
return update(wrapper);
|
||||
}
|
||||
|
||||
void updateDeletedById(@Param("plateIds") List<Long> plateIds, @Param("deleted") Integer deleted, @Param("organId") Long organId);
|
||||
void updateDeletedById(@Param("plateIds") List<Long> plateIds, @Param("deleted") Integer deleted, @Param("organId") Long organId, @Param("orderId") Long orderId);
|
||||
|
||||
int countPlateByOrderId(@Param("orderId") Long orderId, @Param("organId") Long organId, @Param("deleted") Integer deleted);
|
||||
|
||||
@@ -150,9 +150,8 @@ public interface PlateMapper extends BaseMapperX<PlateDO> {
|
||||
}
|
||||
|
||||
// 房间id查小板的开料状态
|
||||
List<Long> selectPlateTypeByRoomId(@Param("orderId") Long orderId, @Param("roomId") Set<Long> roomId,
|
||||
@Param("bodyId") Long bodyId, @Param("organId") Long organId,
|
||||
@Param("deleted") Integer deleted);
|
||||
List<Long> selectPlateTypeByRoomId(@Param("orderId") Long orderId, @Param("bodyIds") Collection<Long> bodyIds,
|
||||
@Param("organId") Long organId, @Param("deleted") Integer deleted);
|
||||
|
||||
// 根据生产单id删除
|
||||
default int deleteByOrderId(Long orderId, Long organId) {
|
||||
|
||||
+2
-1
@@ -4,6 +4,7 @@ import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.*;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.cf.imes.framework.common.pojo.PageParam;
|
||||
import com.cf.imes.module.executor.controller.admin.order.vo.order.*;
|
||||
import com.cf.imes.module.executor.controller.admin.order.vo.product.OrderBodyRespVO;
|
||||
import com.cf.imes.module.executor.controller.admin.order.vo.product.OrderRoomBodyRespVO;
|
||||
@@ -143,7 +144,7 @@ public interface OrderService {
|
||||
/**
|
||||
* 生产单超期告警分析统计
|
||||
*/
|
||||
Map<String,List<OrderOverdueRespVO>> getOrderWarn();
|
||||
Map<String,PageResult<OrderOverdueRespVO>> getOrderWarn(PageParam pageParam);
|
||||
|
||||
|
||||
/**
|
||||
|
||||
+63
-54
@@ -9,6 +9,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.incrementer.IdentifierGenerator;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.PageDTO;
|
||||
import com.cf.imes.framework.common.pojo.PageParam;
|
||||
import com.cf.imes.framework.mybatis.core.generator.SnowFlakeGenerator;
|
||||
import com.cf.imes.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import com.cf.imes.framework.organ.core.context.OrganContextHolder;
|
||||
@@ -63,6 +64,7 @@ import com.cf.imes.module.executor.dal.mysql.order.OrderMapper;
|
||||
import java.io.*;
|
||||
import java.net.URLEncoder;
|
||||
import java.time.*;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.time.temporal.ChronoUnit;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
@@ -153,6 +155,14 @@ public class OrderServiceImpl implements OrderService {
|
||||
validateCustomOrderNoExists(updateReqVO.getCustomOrderNo(), updateReqVO.getId());
|
||||
|
||||
// 发货日期校验
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
||||
LocalDate orderDate = LocalDate.from(updateReqVO.getOrderDate());
|
||||
LocalDate deliveryDate = LocalDate.from(updateReqVO.getDeliveryDate());
|
||||
if (deliveryDate.isBefore(orderDate)) {
|
||||
// 将 deliveryDate 设置为 orderDate 后的第 30 天
|
||||
deliveryDate = orderDate.plusMonths(1);
|
||||
}
|
||||
updateReqVO.setDeliveryDate(deliveryDate.atStartOfDay());
|
||||
// 更新
|
||||
OrderDO updateObj = BeanUtils.toBean(updateReqVO, OrderDO.class);
|
||||
if (updateReqVO.getCustomOrderNo() == null || updateReqVO.getCustomOrderNo().equals("")) {
|
||||
@@ -233,68 +243,69 @@ public class OrderServiceImpl implements OrderService {
|
||||
public void updateBodyDeletedByOrderId(Long orderId, Set<Long> roomIds, Long bodyId, Integer status) { // 要删除传1,还原传0
|
||||
validateOrderStatus(orderId, getUserOrganId(), OrderDeletedEnum.NOT_DELETED.getStatus());
|
||||
|
||||
List<Long> plateDOList;
|
||||
List<Long> bodyIds = null;
|
||||
List<Long> bodyIds = new ArrayList<>();
|
||||
Integer index = status == 1 ? 0 : 1;
|
||||
|
||||
if (roomIds != null && roomIds.size() != 0) {
|
||||
// 查询当前房间下的所有板材
|
||||
plateDOList = plateMapper.selectPlateTypeByRoomId(orderId, roomIds, null, getUserOrganId(), index);
|
||||
bodyIds = orderBodyMapper.selectBodyIdByRoomId(orderId, roomIds, getUserOrganId(), index);
|
||||
} else if (bodyId != null && bodyId != 0) {
|
||||
// 校验柜体存在
|
||||
validateOrderBodyExists(orderId, bodyId, getUserOrganId(), index);
|
||||
// 查询当前房间下的所有板材
|
||||
plateDOList = plateMapper.selectPlateTypeByRoomId(orderId, null, bodyId, getUserOrganId(), index);
|
||||
bodyIds = new ArrayList<>();
|
||||
bodyIds.add(bodyId);
|
||||
} else {
|
||||
plateDOList = null;
|
||||
}
|
||||
|
||||
if (CollectionUtils.isNotEmpty(bodyIds)) {
|
||||
bodyIds.forEach(id -> {
|
||||
// 逻辑删除
|
||||
orderBodyMapper.updateDeletedById(id, status, getUserOrganId());// 柜体
|
||||
orderGroupMapper.updateDeletedById(id, status, getUserOrganId());// 加工组
|
||||
if (bodyIds.size() != 0){
|
||||
List<Long> plateDOList = plateMapper.selectPlateTypeByRoomId(orderId, bodyIds, getUserOrganId(), index);
|
||||
// List<Long> groupIds = orderGroupMapper.selectListByBodyId(bodyIds, orderId, getUserOrganId(), index);
|
||||
|
||||
if (CollectionUtils.isNotEmpty(plateDOList) ){
|
||||
// (删除小板) 小板变为删除状态
|
||||
plateMapper.updateDeletedById(plateDOList, status, getUserOrganId());
|
||||
// 删除大板
|
||||
List<PlateDO> goodsIdList = plateMapper.selectPlateNum(orderId, getUserOrganId());
|
||||
Map<Long, List<PlateDO>> goodsIdMap = goodsIdList.stream()
|
||||
.collect(Collectors.groupingBy(PlateDO::getGoodsId));
|
||||
orderBodyMapper.updateDeletedById(bodyIds, status, getUserOrganId(), orderId);// 柜体
|
||||
orderGroupMapper.updateDeletedById(bodyIds, status, getUserOrganId(), orderId);// 加工组
|
||||
plateMapper.updateDeletedById(plateDOList, status, getUserOrganId(), orderId);// 删小板
|
||||
// 删除大板
|
||||
List<PlateDO> goodsIdList = plateMapper.selectPlateNum(orderId, getUserOrganId());
|
||||
Map<Long, List<PlateDO>> goodsIdMap = goodsIdList.stream()
|
||||
.collect(Collectors.groupingBy(PlateDO::getGoodsId));
|
||||
|
||||
List<Long> goodsIdDeleted = new ArrayList<>();
|
||||
List<Long> goodsIdDeleted = new ArrayList<>();
|
||||
|
||||
goodsIdMap.forEach((goodsId, plates) -> {
|
||||
if (plates.isEmpty()) {
|
||||
goodsIdDeleted.add(goodsId);
|
||||
return;
|
||||
}
|
||||
boolean allDeleted = true;
|
||||
for (PlateDO plateDO : plates) {
|
||||
if (status == 1) {
|
||||
goodsIdMap.forEach((k, v) -> {
|
||||
boolean allDeleted = true;
|
||||
for (PlateDO plateDO : v) {
|
||||
if (!plateDO.getDeleted()) {
|
||||
allDeleted = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (allDeleted) {
|
||||
goodsIdDeleted.add(k);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (goodsIdDeleted.size() > 0) {
|
||||
goodsMapper.updateDeletedById(goodsIdDeleted, status, getUserOrganId());
|
||||
if (!plateDO.getDeleted()) {
|
||||
allDeleted = false;
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
if (plateDO.getDeleted()) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
List<Long> partsList = orderPartsMapper.selectPartsIdListByBodyId(id, getUserOrganId()); // 配件
|
||||
orderPartsMapper.updateDeletedById(partsList, status, getUserOrganId());
|
||||
if (allDeleted) {
|
||||
goodsIdDeleted.add(goodsId);
|
||||
}
|
||||
});
|
||||
|
||||
if (goodsIdDeleted.size() > 0) {
|
||||
goodsMapper.updateDeletedById(goodsIdDeleted, status, getUserOrganId());
|
||||
}
|
||||
|
||||
List<Long> partsList = orderPartsMapper.selectPartsIdListByBodyId(bodyIds, getUserOrganId(), orderId); // 配件
|
||||
if (partsList != null && partsList.size() != 0){
|
||||
orderPartsMapper.updateDeletedById(partsList, status, getUserOrganId());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 生产单柜体数量判断
|
||||
if (orderBodyMapper.selectCountByOrderId(orderId, getUserOrganId(), OrderDeletedEnum.NOT_DELETED.getStatus()) == 0) {
|
||||
orderMapper.updateOrderStatus(orderId, OrderStatusEnum.EMPTY.getStatus(), getUserOrganId());
|
||||
}else {
|
||||
orderMapper.updateOrderStatus(orderId, OrderStatusEnum.NEW_ORDER.getStatus(), getUserOrganId());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -552,20 +563,18 @@ public class OrderServiceImpl implements OrderService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, List<OrderOverdueRespVO>> getOrderWarn() {
|
||||
Map<String, List<OrderOverdueRespVO>> map = new HashMap<>();
|
||||
|
||||
LocalDateTime yesterdayDay = LocalDateTime.now().minus(1, ChronoUnit.DAYS).withHour(23).withMinute(59).withSecond(59);
|
||||
|
||||
LocalDateTime today = LocalDateTime.now().withHour(0).withMinute(0).withSecond(0);
|
||||
LocalDateTime tomorrowDay = LocalDateTime.now().plus(1, ChronoUnit.DAYS).withHour(23).withMinute(59).withSecond(59);
|
||||
public Map<String, PageResult<OrderOverdueRespVO>> getOrderWarn(PageParam pageParam) {
|
||||
Map<String, PageResult<OrderOverdueRespVO>> map = new HashMap<>();
|
||||
|
||||
LocalDate todayDate = LocalDate.now();
|
||||
LocalDate tomorrow = LocalDate.now().plus(1, ChronoUnit.DAYS);
|
||||
PageDTO<OrderOverdueRespVO> page = new PageDTO<>(pageParam.getPageNo(), pageParam.getPageSize());
|
||||
// 查询预警单
|
||||
List<OrderOverdueRespVO> orderNearVOS = orderMapper.selectOrderNear(today, tomorrowDay, OrganContextHolder.getOrganId());
|
||||
map.put("orderNearVOS", orderNearVOS);
|
||||
IPage<OrderOverdueRespVO> orderNearVOS = orderMapper.selectOrderNear(tomorrow, OrganContextHolder.getOrganId(), page);
|
||||
map.put("orderNearVOS", new PageResult<OrderOverdueRespVO>(orderNearVOS.getRecords(), orderNearVOS.getTotal()));
|
||||
// 查询超时单
|
||||
List<OrderOverdueRespVO> orderOverdueVOS = orderMapper.selectOrderOverdue(yesterdayDay, OrganContextHolder.getOrganId());
|
||||
map.put("orderOverdueVOS", orderOverdueVOS);
|
||||
IPage<OrderOverdueRespVO> orderOverdueVOS = orderMapper.selectOrderOverdue(todayDate, OrganContextHolder.getOrganId(), page);
|
||||
map.put("orderOverdueVOS", new PageResult<OrderOverdueRespVO>(orderOverdueVOS.getRecords(), orderOverdueVOS.getTotal()));
|
||||
return map;
|
||||
}
|
||||
|
||||
@@ -797,7 +806,7 @@ public class OrderServiceImpl implements OrderService {
|
||||
// 判断生产单状态是否符合(开料之前状态判断)
|
||||
private void validateOrderStatus(Long orderId, Long organId, Integer status) {
|
||||
// 校验存在
|
||||
OrderDO orderDO = orderMapper.selectOrderOne(orderId, organId, status);
|
||||
OrderDO orderDO = orderMapper.selectOrderOne(orderId, organId);
|
||||
if (orderDO == null)
|
||||
throw exception(ORDER_NOT_EXISTS);
|
||||
// 状态排除
|
||||
|
||||
+2
-1
@@ -2,11 +2,12 @@ package com.cf.imes.module.executor.util.fileConversion.admin.api.webcad;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.cloud.openfeign.FeignClientsConfiguration;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
|
||||
|
||||
@FeignClient(url = "https://chenfeng.tech:7779", name = "apiOrderService")
|
||||
@FeignClient(url = "https://chenfeng.tech:7779", name = "apiOrderService", configuration = FeignClientsConfiguration.class )
|
||||
public interface ApiDataProduction {
|
||||
|
||||
// 登陆token
|
||||
|
||||
+2
-2
@@ -741,8 +741,8 @@ public class ApiTypeRealize {
|
||||
Map<Long, PlateDetail> plateDetails = new HashMap<>();
|
||||
if (dataPlates.getJSONObject("value") != null){
|
||||
// 获取 Orders 字段对应的数组
|
||||
JSONArray ordersArray = dataPlates.getJSONArray("Orders");
|
||||
// System.err.println(dataPlates);
|
||||
JSONArray ordersArray = dataPlates.getJSONObject("value").getJSONArray("Orders");
|
||||
System.err.println(dataPlates);
|
||||
if (ordersArray != null && !ordersArray.isEmpty()) {
|
||||
for (int i = 0; i < ordersArray.size(); i++) {
|
||||
JSONObject order = ordersArray.getJSONObject(i);
|
||||
|
||||
+4
-15
@@ -189,18 +189,12 @@
|
||||
o.dealer_phone_number,
|
||||
o.salesman,
|
||||
o.splitter,
|
||||
o.remark,
|
||||
CONCAT(
|
||||
LPAD(FLOOR(TIMESTAMPDIFF(SECOND, #{today}, o.delivery_date ) / (24 * 60 * 60)), 2, '0'), '天 ',
|
||||
LPAD(FLOOR(MOD(TIMESTAMPDIFF(SECOND, #{today}, o.delivery_date), (24 * 60 * 60)) / (60 * 60)), 2, '0'), ':',
|
||||
LPAD(FLOOR(MOD(MOD(TIMESTAMPDIFF(SECOND, #{today}, o.delivery_date), (24 * 60 * 60)), (60 * 60)) / 60), 2, '0'), ':',
|
||||
LPAD(MOD(MOD(TIMESTAMPDIFF(SECOND, #{today}, o.delivery_date), (24 * 60 * 60)), (60 * 60)) % 60, 2, '0')
|
||||
) AS becomeDue
|
||||
o.remark
|
||||
from orders o
|
||||
where o.organ_id = #{organId}
|
||||
and o.deleted = 0
|
||||
and o.status != 4
|
||||
and o.delivery_date between #{today} and #{orderDate}
|
||||
and o.delivery_date = #{orderDate}
|
||||
</select>
|
||||
|
||||
<select id="selectOrderOverdue" resultType="com.cf.imes.module.executor.controller.admin.order.vo.order.OrderOverdueRespVO">
|
||||
@@ -224,17 +218,12 @@
|
||||
o.salesman,
|
||||
o.splitter,
|
||||
o.remark,
|
||||
CONCAT(
|
||||
LPAD(FLOOR(TIMESTAMPDIFF(SECOND, o.delivery_date, #{today}) / (24 * 60 * 60)), 2, '0'), '天 ',
|
||||
LPAD(FLOOR(MOD(TIMESTAMPDIFF(SECOND, o.delivery_date, #{today}), (24 * 60 * 60)) / (60 * 60)), 2, '0'), ':',
|
||||
LPAD(FLOOR(MOD(MOD(TIMESTAMPDIFF(SECOND, o.delivery_date, #{today}), (24 * 60 * 60)), (60 * 60)) / 60), 2, '0'), ':',
|
||||
LPAD(MOD(MOD(TIMESTAMPDIFF(SECOND, o.delivery_date, #{today}), (24 * 60 * 60)), (60 * 60)) % 60, 2, '0')
|
||||
) AS beOverdue
|
||||
LPAD(FLOOR(TIMESTAMPDIFF(DAY, o.delivery_date, #{today})), 2, '0') AS beOverdue
|
||||
from orders o
|
||||
where o.organ_id = #{organId}
|
||||
and o.deleted = 0
|
||||
and o.status != 4
|
||||
and #{today} > DATE(o.delivery_date)
|
||||
and #{today} >= DATE(o.delivery_date)
|
||||
</select>
|
||||
|
||||
<select id="selectOrderCountProducePeriod" resultType="com.cf.imes.module.executor.controller.admin.order.vo.order.OrderCountProducePeriodRespVO">
|
||||
|
||||
+12
-5
@@ -69,10 +69,13 @@
|
||||
<update id="updateDeletedById">
|
||||
UPDATE order_parts
|
||||
SET deleted = #{deleted}
|
||||
WHERE id IN
|
||||
<foreach collection="partsIds" item="partsId" open="(" separator="," close=")">
|
||||
#{partsId}
|
||||
</foreach>AND organ_id = #{organId}
|
||||
WHERE
|
||||
id IN
|
||||
<foreach collection="partsIds" item="partsId" open="(" separator="," close=")">
|
||||
#{partsId}
|
||||
</foreach>
|
||||
AND
|
||||
organ_id = #{organId}
|
||||
</update>
|
||||
<delete id="deletedById">
|
||||
DELETE FROM order_parts
|
||||
@@ -112,7 +115,11 @@
|
||||
|
||||
<select id="selectPartsIdListByBodyId" resultType="java.lang.Long">
|
||||
SELECT parts_id FROM order_item
|
||||
WHERE body_id = #{bodyId} AND organ_id = #{organId}
|
||||
WHERE body_id IN
|
||||
<foreach item="bodyId" collection="bodyIds" open="(" separator="," close=")">
|
||||
#{bodyId}
|
||||
</foreach>
|
||||
AND organ_id = #{organId} and order_id = #{orderId}
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
+10
-17
@@ -401,10 +401,12 @@
|
||||
UPDATE order_plate
|
||||
SET deleted = #{deleted}
|
||||
WHERE id IN
|
||||
<foreach item="plateId" collection="plateIds" open="(" separator="," close=")">
|
||||
#{plateId}
|
||||
</foreach>
|
||||
AND organ_id = #{organId}
|
||||
<if test="plateIds != null and plateIds.size() > 0">
|
||||
<foreach item="plateId" collection="plateIds" open="(" separator="," close=")">
|
||||
#{plateId}
|
||||
</foreach>
|
||||
</if>
|
||||
AND organ_id = #{organId} and order_id = #{orderId}
|
||||
</update>
|
||||
|
||||
<delete id="deletedById">
|
||||
@@ -685,23 +687,14 @@
|
||||
<select id="selectPlateTypeByRoomId" resultType="java.lang.Long">
|
||||
SELECT p.id
|
||||
FROM order_plate p
|
||||
LEFT JOIN order_item i ON p.id = i.plate_id
|
||||
LEFT JOIN order_item i ON p.id = i.plate_id
|
||||
WHERE i.organ_id = #{organId} AND i.order_id = #{orderId} AND p.deleted = #{deleted}
|
||||
<if test="roomId != null and roomId.size() > 0">
|
||||
AND i.room_id IN
|
||||
<foreach item="roomIdItem" collection="roomId" open="(" separator="," close=")">
|
||||
<if test="bodyIds != null and bodyIds.size() > 0">
|
||||
AND i.body_id IN
|
||||
<foreach item="roomIdItem" collection="bodyIds" open="(" separator="," close=")">
|
||||
#{roomIdItem}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="bodyId != null">
|
||||
AND i.body_id = #{bodyId}
|
||||
</if>
|
||||
GROUP BY
|
||||
g.goods_id
|
||||
HAVING
|
||||
SUM(a.area) > 0
|
||||
ORDER BY
|
||||
orderArea DESC;
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user