|
|
@@ -15,6 +15,7 @@ import org.apache.log4j.Logger;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
+import java.util.Date;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
@@ -98,7 +99,7 @@ public class UserOrderDetailServiceImpl implements UserOrderDetailService {
|
|
|
try {
|
|
|
int updates = userOrderDetailMapper.insertSelective(record);
|
|
|
if (updates > 0) {
|
|
|
- return true;
|
|
|
+ return true;
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
logger.error("createUserOrderDetail", e);
|
|
|
@@ -112,10 +113,10 @@ public class UserOrderDetailServiceImpl implements UserOrderDetailService {
|
|
|
try {
|
|
|
int updates = userOrderDetailMapper.delete(record);
|
|
|
if (updates > 0) {
|
|
|
- return true;
|
|
|
+ return true;
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
- logger.error("deleteUserOrderDetail", e);
|
|
|
+ logger.error("deleteUserOrderDetail", e);
|
|
|
}
|
|
|
return false;
|
|
|
}
|
|
|
@@ -126,10 +127,10 @@ public class UserOrderDetailServiceImpl implements UserOrderDetailService {
|
|
|
try {
|
|
|
int updates = userOrderDetailMapper.updateByPrimaryKeySelective(record);
|
|
|
if (updates > 0) {
|
|
|
- return true;
|
|
|
+ return true;
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
- logger.error("updateUserOrderDetail", e);
|
|
|
+ logger.error("updateUserOrderDetail", e);
|
|
|
}
|
|
|
return false;
|
|
|
}
|
|
|
@@ -260,5 +261,88 @@ public class UserOrderDetailServiceImpl implements UserOrderDetailService {
|
|
|
}
|
|
|
return new Result(false, "updateImageAndAlbumRepair失败");
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public Result confirm(UserOrderDetail record) {
|
|
|
+
|
|
|
+ logger.info("confirm:确认完成订单");
|
|
|
+ try {
|
|
|
+ UserOrderDetail userOrder = userOrderDetailMapper.selectByPrimaryKey(record.getId());
|
|
|
+ if (userOrder != null) {
|
|
|
+
|
|
|
+ boolean confirmFlag = false;
|
|
|
+
|
|
|
+
|
|
|
+ if (AppConstant.OrderAlbumStatus.WAIT_ACCEPT == userOrder.getAlbumStatus() ||
|
|
|
+ AppConstant.OrderAlbumStatus.REWORK_ACCEPT == userOrder.getAlbumStatus()) {//修图完成
|
|
|
+
|
|
|
+ confirmFlag = true;
|
|
|
+ record.setAlbumStatus(AppConstant.OrderAlbumStatus.FINISH);
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ if (confirmFlag) {
|
|
|
+
|
|
|
+ userOrderDetailMapper.updateByPrimaryKeySelective(record);
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return new Result(true, "confirm:确认完成成功");
|
|
|
+
|
|
|
+ } catch (Exception e) {
|
|
|
+ logger.error("confirm:确认完成异常", e);
|
|
|
+ }
|
|
|
+ return new Result(false, "confirm:确认完成失败");
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 返修
|
|
|
+ *
|
|
|
+ * @param record
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public boolean repair(UserOrderDetail record) {
|
|
|
+
|
|
|
+ logger.info("repair");
|
|
|
+ try {
|
|
|
+
|
|
|
+ if (record.getId() != null && record.getId() > 0) {
|
|
|
+ if ("order_image".equals(record.getAcceptType()) || "image_album".equals(record.getAcceptType())) {
|
|
|
+
|
|
|
+ record.setAlbumStatus(AppConstant.OrderAlbumStatus.REWORK);
|
|
|
+ OrderRepair orderRepair = new OrderRepair();
|
|
|
+ orderRepair.setOrderId(record.getId() + "");
|
|
|
+ orderRepairMapper.repairByOrderId(orderRepair);
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ if ("order_album".equals(record.getAcceptType()) || "image_album".equals(record.getAcceptType())) {
|
|
|
+
|
|
|
+ record.setAlbumStatus(AppConstant.OrderAlbumStatus.REWORK);
|
|
|
+ OrderAlbumRepair orderAlbumRepair = new OrderAlbumRepair();
|
|
|
+ orderAlbumRepair.setOrderId(record.getId() + "");
|
|
|
+ orderAlbumRepairMapper.repairByOrderId(orderAlbumRepair);
|
|
|
+ }
|
|
|
+
|
|
|
+ int updates = userOrderDetailMapper.updateByPrimaryKeySelective(record);
|
|
|
+
|
|
|
+
|
|
|
+ if (updates > 0) {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ } catch (Exception e) {
|
|
|
+ logger.error("repair", e);
|
|
|
+ }
|
|
|
+
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|