|
|
|
@ -1,37 +1,37 @@
|
|
|
|
|
package jnpf.service.impl;
|
|
|
|
|
|
|
|
|
|
import jnpf.entity.*;
|
|
|
|
|
import jnpf.mapper.RecycleDeliveryOrderMapper;
|
|
|
|
|
import jnpf.service.*;
|
|
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
|
|
import jnpf.model.recycledeliveryorder.*;
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
|
|
|
import jnpf.permission.model.authorize.AuthorizeConditionModel;
|
|
|
|
|
import jnpf.util.GeneraterSwapUtil;
|
|
|
|
|
import jnpf.database.model.superQuery.SuperQueryJsonModel;
|
|
|
|
|
import jnpf.database.model.superQuery.ConditionJsonModel;
|
|
|
|
|
import jnpf.database.model.superQuery.SuperQueryConditionModel;
|
|
|
|
|
import java.lang.reflect.Field;
|
|
|
|
|
import com.baomidou.mybatisplus.annotation.TableField;
|
|
|
|
|
import java.util.regex.Pattern;
|
|
|
|
|
import jnpf.model.QueryModel;
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
import jnpf.base.model.ColumnDataModel;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
|
|
import jnpf.database.model.superQuery.SuperJsonModel;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
|
|
import java.text.SimpleDateFormat;
|
|
|
|
|
import jnpf.util.*;
|
|
|
|
|
import java.util.*;
|
|
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
|
|
import jnpf.base.UserInfo;
|
|
|
|
|
import jnpf.base.model.ColumnDataModel;
|
|
|
|
|
import jnpf.database.model.superQuery.SuperJsonModel;
|
|
|
|
|
import jnpf.entity.RecycleCleanOrderEntity;
|
|
|
|
|
import jnpf.entity.RecycleDeliveryOrderEntity;
|
|
|
|
|
import jnpf.mapper.RecycleDeliveryOrderMapper;
|
|
|
|
|
import jnpf.model.QueryModel;
|
|
|
|
|
import jnpf.model.recycledeliveryorder.*;
|
|
|
|
|
import jnpf.permission.entity.UserEntity;
|
|
|
|
|
import jnpf.service.RecycleDeliveryOrderService;
|
|
|
|
|
import jnpf.util.*;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
import java.lang.reflect.Field;
|
|
|
|
|
import java.time.LocalDateTime;
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.Arrays;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.regex.Pattern;
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
*
|
|
|
|
|
* 投递清单
|
|
|
|
|
* 版本: V3.5
|
|
|
|
|
* 版权: 引迈信息技术有限公司(https://www.jnpfsoft.com)
|
|
|
|
@ -39,462 +39,504 @@ import jnpf.permission.entity.UserEntity;
|
|
|
|
|
* 日期: 2024-06-18
|
|
|
|
|
*/
|
|
|
|
|
@Service
|
|
|
|
|
public class RecycleDeliveryOrderServiceImpl extends ServiceImpl<RecycleDeliveryOrderMapper, RecycleDeliveryOrderEntity> implements RecycleDeliveryOrderService{
|
|
|
|
|
public class RecycleDeliveryOrderServiceImpl extends ServiceImpl<RecycleDeliveryOrderMapper, RecycleDeliveryOrderEntity> implements RecycleDeliveryOrderService {
|
|
|
|
|
@Autowired
|
|
|
|
|
private GeneraterSwapUtil generaterSwapUtil;
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private UserProvider userProvider;
|
|
|
|
|
@Resource
|
|
|
|
|
private RecycleDeliveryOrderMapper deliveryOrderMapper;
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public List<RecycleDeliveryOrderEntity> getList(RecycleDeliveryOrderPagination recycleDeliveryOrderPagination){
|
|
|
|
|
return getTypeList(recycleDeliveryOrderPagination,recycleDeliveryOrderPagination.getDataType());
|
|
|
|
|
public List<RecycleDeliveryOrderEntity> getList(RecycleDeliveryOrderPagination recycleDeliveryOrderPagination) {
|
|
|
|
|
return getTypeList(recycleDeliveryOrderPagination, recycleDeliveryOrderPagination.getDataType());
|
|
|
|
|
}
|
|
|
|
|
/** 列表查询 */
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 列表查询
|
|
|
|
|
*/
|
|
|
|
|
@Override
|
|
|
|
|
public List<RecycleDeliveryOrderEntity> getTypeList(RecycleDeliveryOrderPagination recycleDeliveryOrderPagination,String dataType){
|
|
|
|
|
String userId=userProvider.get().getUserId();
|
|
|
|
|
List<String> AllIdList =new ArrayList();
|
|
|
|
|
List<List<String>> intersectionList =new ArrayList<>();
|
|
|
|
|
public List<RecycleDeliveryOrderEntity> getTypeList(RecycleDeliveryOrderPagination recycleDeliveryOrderPagination, String dataType) {
|
|
|
|
|
String userId = userProvider.get().getUserId();
|
|
|
|
|
List<String> AllIdList = new ArrayList();
|
|
|
|
|
List<List<String>> intersectionList = new ArrayList<>();
|
|
|
|
|
boolean isPc = ServletUtil.getHeader("jnpf-origin").equals("pc");
|
|
|
|
|
String columnData = !isPc ? RecycleDeliveryOrderConstant.getAppColumnData() : RecycleDeliveryOrderConstant.getColumnData();
|
|
|
|
|
ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(columnData, ColumnDataModel.class);
|
|
|
|
|
String ruleJson = !isPc ? JsonUtil.getObjectToString(columnDataModel.getRuleListApp()) : JsonUtil.getObjectToString(columnDataModel.getRuleList());
|
|
|
|
|
|
|
|
|
|
int total=0;
|
|
|
|
|
int recycleDeliveryOrderNum =0;
|
|
|
|
|
QueryWrapper<RecycleDeliveryOrderEntity> recycleDeliveryOrderQueryWrapper=new QueryWrapper<>();
|
|
|
|
|
int total = 0;
|
|
|
|
|
int recycleDeliveryOrderNum = 0;
|
|
|
|
|
QueryWrapper<RecycleDeliveryOrderEntity> recycleDeliveryOrderQueryWrapper = new QueryWrapper<>();
|
|
|
|
|
List<String> allSuperIDlist = new ArrayList<>();
|
|
|
|
|
String superOp ="";
|
|
|
|
|
if (ObjectUtil.isNotEmpty(recycleDeliveryOrderPagination.getSuperQueryJson())){
|
|
|
|
|
String superOp = "";
|
|
|
|
|
if (ObjectUtil.isNotEmpty(recycleDeliveryOrderPagination.getSuperQueryJson())) {
|
|
|
|
|
List<String> allSuperList = new ArrayList<>();
|
|
|
|
|
List<List<String>> intersectionSuperList = new ArrayList<>();
|
|
|
|
|
List<List<String>> intersectionSuperList = new ArrayList<>();
|
|
|
|
|
String queryJson = recycleDeliveryOrderPagination.getSuperQueryJson();
|
|
|
|
|
SuperJsonModel superJsonModel = JsonUtil.getJsonToBean(queryJson, SuperJsonModel.class);
|
|
|
|
|
int superNum = 0;
|
|
|
|
|
QueryWrapper<RecycleDeliveryOrderEntity> recycleDeliveryOrderSuperWrapper = new QueryWrapper<>();
|
|
|
|
|
recycleDeliveryOrderSuperWrapper = generaterSwapUtil.getCondition(new QueryModel(recycleDeliveryOrderSuperWrapper,RecycleDeliveryOrderEntity.class,queryJson,"0"));
|
|
|
|
|
recycleDeliveryOrderSuperWrapper = generaterSwapUtil.getCondition(new QueryModel(recycleDeliveryOrderSuperWrapper, RecycleDeliveryOrderEntity.class, queryJson, "0"));
|
|
|
|
|
int recycleDeliveryOrderNum1 = recycleDeliveryOrderSuperWrapper.getExpression().getNormal().size();
|
|
|
|
|
if (recycleDeliveryOrderNum1>0){
|
|
|
|
|
List<String> recycleDeliveryOrderList =this.list(recycleDeliveryOrderSuperWrapper).stream().map(RecycleDeliveryOrderEntity::getId).collect(Collectors.toList());
|
|
|
|
|
if (recycleDeliveryOrderNum1 > 0) {
|
|
|
|
|
List<String> recycleDeliveryOrderList = this.list(recycleDeliveryOrderSuperWrapper).stream().map(RecycleDeliveryOrderEntity::getId).collect(Collectors.toList());
|
|
|
|
|
allSuperList.addAll(recycleDeliveryOrderList);
|
|
|
|
|
intersectionSuperList.add(recycleDeliveryOrderList);
|
|
|
|
|
superNum++;
|
|
|
|
|
}
|
|
|
|
|
superOp = superNum > 0 ? superJsonModel.getMatchLogic() : "";
|
|
|
|
|
//and or
|
|
|
|
|
if(superOp.equalsIgnoreCase("and")){
|
|
|
|
|
if (superOp.equalsIgnoreCase("and")) {
|
|
|
|
|
allSuperIDlist = generaterSwapUtil.getIntersection(intersectionSuperList);
|
|
|
|
|
}else{
|
|
|
|
|
} else {
|
|
|
|
|
allSuperIDlist = allSuperList;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
List<String> allRuleIDlist = new ArrayList<>();
|
|
|
|
|
String ruleOp ="";
|
|
|
|
|
if (ObjectUtil.isNotEmpty(ruleJson)){
|
|
|
|
|
String ruleOp = "";
|
|
|
|
|
if (ObjectUtil.isNotEmpty(ruleJson)) {
|
|
|
|
|
List<String> allRuleList = new ArrayList<>();
|
|
|
|
|
List<List<String>> intersectionRuleList = new ArrayList<>();
|
|
|
|
|
List<List<String>> intersectionRuleList = new ArrayList<>();
|
|
|
|
|
SuperJsonModel ruleJsonModel = JsonUtil.getJsonToBean(ruleJson, SuperJsonModel.class);
|
|
|
|
|
int ruleNum = 0;
|
|
|
|
|
QueryWrapper<RecycleDeliveryOrderEntity> recycleDeliveryOrderSuperWrapper = new QueryWrapper<>();
|
|
|
|
|
recycleDeliveryOrderSuperWrapper = generaterSwapUtil.getCondition(new QueryModel(recycleDeliveryOrderSuperWrapper,RecycleDeliveryOrderEntity.class,ruleJson,"0"));
|
|
|
|
|
recycleDeliveryOrderSuperWrapper = generaterSwapUtil.getCondition(new QueryModel(recycleDeliveryOrderSuperWrapper, RecycleDeliveryOrderEntity.class, ruleJson, "0"));
|
|
|
|
|
int recycleDeliveryOrderNum1 = recycleDeliveryOrderSuperWrapper.getExpression().getNormal().size();
|
|
|
|
|
if (recycleDeliveryOrderNum1>0){
|
|
|
|
|
List<String> recycleDeliveryOrderList =this.list(recycleDeliveryOrderSuperWrapper).stream().map(RecycleDeliveryOrderEntity::getId).collect(Collectors.toList());
|
|
|
|
|
if (recycleDeliveryOrderNum1 > 0) {
|
|
|
|
|
List<String> recycleDeliveryOrderList = this.list(recycleDeliveryOrderSuperWrapper).stream().map(RecycleDeliveryOrderEntity::getId).collect(Collectors.toList());
|
|
|
|
|
allRuleList.addAll(recycleDeliveryOrderList);
|
|
|
|
|
intersectionRuleList.add(recycleDeliveryOrderList);
|
|
|
|
|
ruleNum++;
|
|
|
|
|
}
|
|
|
|
|
ruleOp = ruleNum > 0 ? ruleJsonModel.getMatchLogic() : "";
|
|
|
|
|
//and or
|
|
|
|
|
if(ruleOp.equalsIgnoreCase("and")){
|
|
|
|
|
if (ruleOp.equalsIgnoreCase("and")) {
|
|
|
|
|
allRuleIDlist = generaterSwapUtil.getIntersection(intersectionRuleList);
|
|
|
|
|
}else{
|
|
|
|
|
} else {
|
|
|
|
|
allRuleIDlist = allRuleList;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
boolean pcPermission = false;
|
|
|
|
|
boolean appPermission = false;
|
|
|
|
|
if(isPc && pcPermission){
|
|
|
|
|
if (!userProvider.get().getIsAdministrator()){
|
|
|
|
|
Object recycleDeliveryOrderObj=generaterSwapUtil.getAuthorizeCondition(new QueryModel(recycleDeliveryOrderQueryWrapper,RecycleDeliveryOrderEntity.class,recycleDeliveryOrderPagination.getMenuId(),"0"));
|
|
|
|
|
if (ObjectUtil.isEmpty(recycleDeliveryOrderObj)){
|
|
|
|
|
return new ArrayList<>();
|
|
|
|
|
} else {
|
|
|
|
|
recycleDeliveryOrderQueryWrapper = (QueryWrapper<RecycleDeliveryOrderEntity>)recycleDeliveryOrderObj;
|
|
|
|
|
if( recycleDeliveryOrderQueryWrapper.getExpression().getNormal().size()>0){
|
|
|
|
|
recycleDeliveryOrderNum++;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if(!isPc && appPermission){
|
|
|
|
|
if (!userProvider.get().getIsAdministrator()){
|
|
|
|
|
Object recycleDeliveryOrderObj=generaterSwapUtil.getAuthorizeCondition(new QueryModel(recycleDeliveryOrderQueryWrapper,RecycleDeliveryOrderEntity.class,recycleDeliveryOrderPagination.getMenuId(),"0"));
|
|
|
|
|
if (ObjectUtil.isEmpty(recycleDeliveryOrderObj)){
|
|
|
|
|
return new ArrayList<>();
|
|
|
|
|
} else {
|
|
|
|
|
recycleDeliveryOrderQueryWrapper = (QueryWrapper<RecycleDeliveryOrderEntity>)recycleDeliveryOrderObj;
|
|
|
|
|
if( recycleDeliveryOrderQueryWrapper.getExpression().getNormal().size()>0){
|
|
|
|
|
recycleDeliveryOrderNum++;
|
|
|
|
|
}
|
|
|
|
|
boolean pcPermission = false;
|
|
|
|
|
boolean appPermission = false;
|
|
|
|
|
if (isPc && pcPermission) {
|
|
|
|
|
if (!userProvider.get().getIsAdministrator()) {
|
|
|
|
|
Object recycleDeliveryOrderObj = generaterSwapUtil.getAuthorizeCondition(new QueryModel(recycleDeliveryOrderQueryWrapper, RecycleDeliveryOrderEntity.class, recycleDeliveryOrderPagination.getMenuId(), "0"));
|
|
|
|
|
if (ObjectUtil.isEmpty(recycleDeliveryOrderObj)) {
|
|
|
|
|
return new ArrayList<>();
|
|
|
|
|
} else {
|
|
|
|
|
recycleDeliveryOrderQueryWrapper = (QueryWrapper<RecycleDeliveryOrderEntity>) recycleDeliveryOrderObj;
|
|
|
|
|
if (recycleDeliveryOrderQueryWrapper.getExpression().getNormal().size() > 0) {
|
|
|
|
|
recycleDeliveryOrderNum++;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (!isPc && appPermission) {
|
|
|
|
|
if (!userProvider.get().getIsAdministrator()) {
|
|
|
|
|
Object recycleDeliveryOrderObj = generaterSwapUtil.getAuthorizeCondition(new QueryModel(recycleDeliveryOrderQueryWrapper, RecycleDeliveryOrderEntity.class, recycleDeliveryOrderPagination.getMenuId(), "0"));
|
|
|
|
|
if (ObjectUtil.isEmpty(recycleDeliveryOrderObj)) {
|
|
|
|
|
return new ArrayList<>();
|
|
|
|
|
} else {
|
|
|
|
|
recycleDeliveryOrderQueryWrapper = (QueryWrapper<RecycleDeliveryOrderEntity>) recycleDeliveryOrderObj;
|
|
|
|
|
if (recycleDeliveryOrderQueryWrapper.getExpression().getNormal().size() > 0) {
|
|
|
|
|
recycleDeliveryOrderNum++;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if(isPc){
|
|
|
|
|
if(ObjectUtil.isNotEmpty(recycleDeliveryOrderPagination.getOrderNo())){
|
|
|
|
|
recycleDeliveryOrderNum++;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (isPc) {
|
|
|
|
|
if (ObjectUtil.isNotEmpty(recycleDeliveryOrderPagination.getOrderNo())) {
|
|
|
|
|
recycleDeliveryOrderNum++;
|
|
|
|
|
|
|
|
|
|
String value = recycleDeliveryOrderPagination.getOrderNo() instanceof List ?
|
|
|
|
|
JsonUtil.getObjectToString(recycleDeliveryOrderPagination.getOrderNo()) :
|
|
|
|
|
String.valueOf(recycleDeliveryOrderPagination.getOrderNo());
|
|
|
|
|
recycleDeliveryOrderQueryWrapper.lambda().like(RecycleDeliveryOrderEntity::getOrderNo,value);
|
|
|
|
|
JsonUtil.getObjectToString(recycleDeliveryOrderPagination.getOrderNo()) :
|
|
|
|
|
String.valueOf(recycleDeliveryOrderPagination.getOrderNo());
|
|
|
|
|
recycleDeliveryOrderQueryWrapper.lambda().like(RecycleDeliveryOrderEntity::getOrderNo, value);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(ObjectUtil.isNotEmpty(recycleDeliveryOrderPagination.getAdjustStatus())){
|
|
|
|
|
recycleDeliveryOrderNum++;
|
|
|
|
|
if (ObjectUtil.isNotEmpty(recycleDeliveryOrderPagination.getAdjustStatus())) {
|
|
|
|
|
recycleDeliveryOrderNum++;
|
|
|
|
|
|
|
|
|
|
recycleDeliveryOrderQueryWrapper.lambda().eq(RecycleDeliveryOrderEntity::getAdjustStatus,recycleDeliveryOrderPagination.getAdjustStatus());
|
|
|
|
|
recycleDeliveryOrderQueryWrapper.lambda().eq(RecycleDeliveryOrderEntity::getAdjustStatus, recycleDeliveryOrderPagination.getAdjustStatus());
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(ObjectUtil.isNotEmpty(recycleDeliveryOrderPagination.getPhone())){
|
|
|
|
|
recycleDeliveryOrderNum++;
|
|
|
|
|
if (ObjectUtil.isNotEmpty(recycleDeliveryOrderPagination.getPhone())) {
|
|
|
|
|
recycleDeliveryOrderNum++;
|
|
|
|
|
|
|
|
|
|
String value = recycleDeliveryOrderPagination.getPhone() instanceof List ?
|
|
|
|
|
JsonUtil.getObjectToString(recycleDeliveryOrderPagination.getPhone()) :
|
|
|
|
|
String.valueOf(recycleDeliveryOrderPagination.getPhone());
|
|
|
|
|
recycleDeliveryOrderQueryWrapper.lambda().like(RecycleDeliveryOrderEntity::getPhone,value);
|
|
|
|
|
JsonUtil.getObjectToString(recycleDeliveryOrderPagination.getPhone()) :
|
|
|
|
|
String.valueOf(recycleDeliveryOrderPagination.getPhone());
|
|
|
|
|
recycleDeliveryOrderQueryWrapper.lambda().like(RecycleDeliveryOrderEntity::getPhone, value);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(ObjectUtil.isNotEmpty(recycleDeliveryOrderPagination.getDeviceCode())){
|
|
|
|
|
recycleDeliveryOrderNum++;
|
|
|
|
|
|
|
|
|
|
List<String> idList = new ArrayList<>();
|
|
|
|
|
try {
|
|
|
|
|
String[][] deviceCode = JsonUtil.getJsonToBean(recycleDeliveryOrderPagination.getDeviceCode(),String[][].class);
|
|
|
|
|
for(int i=0;i<deviceCode.length;i++){
|
|
|
|
|
if(deviceCode[i].length>0){
|
|
|
|
|
idList.add(JsonUtil.getObjectToString(Arrays.asList(deviceCode[i])));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}catch (Exception e1){
|
|
|
|
|
try {
|
|
|
|
|
List<String> deviceCode = JsonUtil.getJsonToList(recycleDeliveryOrderPagination.getDeviceCode(),String.class);
|
|
|
|
|
if(deviceCode.size()>0){
|
|
|
|
|
idList.addAll(deviceCode);
|
|
|
|
|
}
|
|
|
|
|
}catch (Exception e2){
|
|
|
|
|
idList.add(String.valueOf(recycleDeliveryOrderPagination.getDeviceCode()));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
recycleDeliveryOrderQueryWrapper.lambda().and(t->{
|
|
|
|
|
idList.forEach(tt->{
|
|
|
|
|
t.like(RecycleDeliveryOrderEntity::getDeviceCode, tt).or();
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
if (ObjectUtil.isNotEmpty(recycleDeliveryOrderPagination.getDeviceCode())) {
|
|
|
|
|
recycleDeliveryOrderNum++;
|
|
|
|
|
|
|
|
|
|
List<String> idList = new ArrayList<>();
|
|
|
|
|
try {
|
|
|
|
|
String[][] deviceCode = JsonUtil.getJsonToBean(recycleDeliveryOrderPagination.getDeviceCode(), String[][].class);
|
|
|
|
|
for (int i = 0; i < deviceCode.length; i++) {
|
|
|
|
|
if (deviceCode[i].length > 0) {
|
|
|
|
|
idList.add(JsonUtil.getObjectToString(Arrays.asList(deviceCode[i])));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} catch (Exception e1) {
|
|
|
|
|
try {
|
|
|
|
|
List<String> deviceCode = JsonUtil.getJsonToList(recycleDeliveryOrderPagination.getDeviceCode(), String.class);
|
|
|
|
|
if (deviceCode.size() > 0) {
|
|
|
|
|
idList.addAll(deviceCode);
|
|
|
|
|
}
|
|
|
|
|
} catch (Exception e2) {
|
|
|
|
|
idList.add(String.valueOf(recycleDeliveryOrderPagination.getDeviceCode()));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
recycleDeliveryOrderQueryWrapper.lambda().and(t -> {
|
|
|
|
|
idList.forEach(tt -> {
|
|
|
|
|
t.like(RecycleDeliveryOrderEntity::getDeviceCode, tt).or();
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(ObjectUtil.isNotEmpty(recycleDeliveryOrderPagination.getDoorNum())){
|
|
|
|
|
recycleDeliveryOrderNum++;
|
|
|
|
|
|
|
|
|
|
List<String> idList = new ArrayList<>();
|
|
|
|
|
try {
|
|
|
|
|
String[][] doorNum = JsonUtil.getJsonToBean(recycleDeliveryOrderPagination.getDoorNum(),String[][].class);
|
|
|
|
|
for(int i=0;i<doorNum.length;i++){
|
|
|
|
|
if(doorNum[i].length>0){
|
|
|
|
|
idList.add(JsonUtil.getObjectToString(Arrays.asList(doorNum[i])));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}catch (Exception e1){
|
|
|
|
|
try {
|
|
|
|
|
List<String> doorNum = JsonUtil.getJsonToList(recycleDeliveryOrderPagination.getDoorNum(),String.class);
|
|
|
|
|
if(doorNum.size()>0){
|
|
|
|
|
idList.addAll(doorNum);
|
|
|
|
|
}
|
|
|
|
|
}catch (Exception e2){
|
|
|
|
|
idList.add(String.valueOf(recycleDeliveryOrderPagination.getDoorNum()));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
recycleDeliveryOrderQueryWrapper.lambda().and(t->{
|
|
|
|
|
idList.forEach(tt->{
|
|
|
|
|
t.like(RecycleDeliveryOrderEntity::getDoorNum, tt).or();
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
if (ObjectUtil.isNotEmpty(recycleDeliveryOrderPagination.getDoorNum())) {
|
|
|
|
|
recycleDeliveryOrderNum++;
|
|
|
|
|
|
|
|
|
|
List<String> idList = new ArrayList<>();
|
|
|
|
|
try {
|
|
|
|
|
String[][] doorNum = JsonUtil.getJsonToBean(recycleDeliveryOrderPagination.getDoorNum(), String[][].class);
|
|
|
|
|
for (int i = 0; i < doorNum.length; i++) {
|
|
|
|
|
if (doorNum[i].length > 0) {
|
|
|
|
|
idList.add(JsonUtil.getObjectToString(Arrays.asList(doorNum[i])));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} catch (Exception e1) {
|
|
|
|
|
try {
|
|
|
|
|
List<String> doorNum = JsonUtil.getJsonToList(recycleDeliveryOrderPagination.getDoorNum(), String.class);
|
|
|
|
|
if (doorNum.size() > 0) {
|
|
|
|
|
idList.addAll(doorNum);
|
|
|
|
|
}
|
|
|
|
|
} catch (Exception e2) {
|
|
|
|
|
idList.add(String.valueOf(recycleDeliveryOrderPagination.getDoorNum()));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
recycleDeliveryOrderQueryWrapper.lambda().and(t -> {
|
|
|
|
|
idList.forEach(tt -> {
|
|
|
|
|
t.like(RecycleDeliveryOrderEntity::getDoorNum, tt).or();
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(ObjectUtil.isNotEmpty(recycleDeliveryOrderPagination.getBucketCode())){
|
|
|
|
|
recycleDeliveryOrderNum++;
|
|
|
|
|
|
|
|
|
|
List<String> idList = new ArrayList<>();
|
|
|
|
|
try {
|
|
|
|
|
String[][] bucketCode = JsonUtil.getJsonToBean(recycleDeliveryOrderPagination.getBucketCode(),String[][].class);
|
|
|
|
|
for(int i=0;i<bucketCode.length;i++){
|
|
|
|
|
if(bucketCode[i].length>0){
|
|
|
|
|
idList.add(JsonUtil.getObjectToString(Arrays.asList(bucketCode[i])));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}catch (Exception e1){
|
|
|
|
|
try {
|
|
|
|
|
List<String> bucketCode = JsonUtil.getJsonToList(recycleDeliveryOrderPagination.getBucketCode(),String.class);
|
|
|
|
|
if(bucketCode.size()>0){
|
|
|
|
|
idList.add(JsonUtil.getObjectToString(bucketCode));
|
|
|
|
|
}
|
|
|
|
|
}catch (Exception e2){
|
|
|
|
|
idList.add(String.valueOf(recycleDeliveryOrderPagination.getBucketCode()));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
recycleDeliveryOrderQueryWrapper.lambda().and(t->{
|
|
|
|
|
idList.forEach(tt->{
|
|
|
|
|
t.like(RecycleDeliveryOrderEntity::getBucketCode, tt).or();
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
if (ObjectUtil.isNotEmpty(recycleDeliveryOrderPagination.getBucketCode())) {
|
|
|
|
|
recycleDeliveryOrderNum++;
|
|
|
|
|
|
|
|
|
|
List<String> idList = new ArrayList<>();
|
|
|
|
|
try {
|
|
|
|
|
String[][] bucketCode = JsonUtil.getJsonToBean(recycleDeliveryOrderPagination.getBucketCode(), String[][].class);
|
|
|
|
|
for (int i = 0; i < bucketCode.length; i++) {
|
|
|
|
|
if (bucketCode[i].length > 0) {
|
|
|
|
|
idList.add(JsonUtil.getObjectToString(Arrays.asList(bucketCode[i])));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} catch (Exception e1) {
|
|
|
|
|
try {
|
|
|
|
|
List<String> bucketCode = JsonUtil.getJsonToList(recycleDeliveryOrderPagination.getBucketCode(), String.class);
|
|
|
|
|
if (bucketCode.size() > 0) {
|
|
|
|
|
idList.add(JsonUtil.getObjectToString(bucketCode));
|
|
|
|
|
}
|
|
|
|
|
} catch (Exception e2) {
|
|
|
|
|
idList.add(String.valueOf(recycleDeliveryOrderPagination.getBucketCode()));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
recycleDeliveryOrderQueryWrapper.lambda().and(t -> {
|
|
|
|
|
idList.forEach(tt -> {
|
|
|
|
|
t.like(RecycleDeliveryOrderEntity::getBucketCode, tt).or();
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(ObjectUtil.isNotEmpty(recycleDeliveryOrderPagination.getBagNo())){
|
|
|
|
|
recycleDeliveryOrderNum++;
|
|
|
|
|
if (ObjectUtil.isNotEmpty(recycleDeliveryOrderPagination.getBagNo())) {
|
|
|
|
|
recycleDeliveryOrderNum++;
|
|
|
|
|
|
|
|
|
|
String value = recycleDeliveryOrderPagination.getBagNo() instanceof List ?
|
|
|
|
|
JsonUtil.getObjectToString(recycleDeliveryOrderPagination.getBagNo()) :
|
|
|
|
|
String.valueOf(recycleDeliveryOrderPagination.getBagNo());
|
|
|
|
|
recycleDeliveryOrderQueryWrapper.lambda().like(RecycleDeliveryOrderEntity::getBagNo,value);
|
|
|
|
|
JsonUtil.getObjectToString(recycleDeliveryOrderPagination.getBagNo()) :
|
|
|
|
|
String.valueOf(recycleDeliveryOrderPagination.getBagNo());
|
|
|
|
|
recycleDeliveryOrderQueryWrapper.lambda().like(RecycleDeliveryOrderEntity::getBagNo, value);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(ObjectUtil.isNotEmpty(recycleDeliveryOrderPagination.getCompanyId())){
|
|
|
|
|
recycleDeliveryOrderNum++;
|
|
|
|
|
|
|
|
|
|
List<String> idList = new ArrayList<>();
|
|
|
|
|
try {
|
|
|
|
|
String[][] companyId = JsonUtil.getJsonToBean(recycleDeliveryOrderPagination.getCompanyId(),String[][].class);
|
|
|
|
|
for(int i=0;i<companyId.length;i++){
|
|
|
|
|
if(companyId[i].length>0){
|
|
|
|
|
idList.add(JsonUtil.getObjectToString(Arrays.asList(companyId[i])));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}catch (Exception e1){
|
|
|
|
|
try {
|
|
|
|
|
List<String> companyId = JsonUtil.getJsonToList(recycleDeliveryOrderPagination.getCompanyId(),String.class);
|
|
|
|
|
if(companyId.size()>0){
|
|
|
|
|
idList.add(companyId.get(companyId.size()-1));
|
|
|
|
|
}
|
|
|
|
|
}catch (Exception e2){
|
|
|
|
|
idList.add(String.valueOf(recycleDeliveryOrderPagination.getCompanyId()));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
recycleDeliveryOrderQueryWrapper.lambda().and(t->{
|
|
|
|
|
idList.forEach(tt->{
|
|
|
|
|
t.like(RecycleDeliveryOrderEntity::getCompanyId, tt).or();
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
if (ObjectUtil.isNotEmpty(recycleDeliveryOrderPagination.getCompanyId())) {
|
|
|
|
|
recycleDeliveryOrderNum++;
|
|
|
|
|
|
|
|
|
|
List<String> idList = new ArrayList<>();
|
|
|
|
|
try {
|
|
|
|
|
String[][] companyId = JsonUtil.getJsonToBean(recycleDeliveryOrderPagination.getCompanyId(), String[][].class);
|
|
|
|
|
for (int i = 0; i < companyId.length; i++) {
|
|
|
|
|
if (companyId[i].length > 0) {
|
|
|
|
|
idList.add(JsonUtil.getObjectToString(Arrays.asList(companyId[i])));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} catch (Exception e1) {
|
|
|
|
|
try {
|
|
|
|
|
List<String> companyId = JsonUtil.getJsonToList(recycleDeliveryOrderPagination.getCompanyId(), String.class);
|
|
|
|
|
if (companyId.size() > 0) {
|
|
|
|
|
idList.add(companyId.get(companyId.size() - 1));
|
|
|
|
|
}
|
|
|
|
|
} catch (Exception e2) {
|
|
|
|
|
idList.add(String.valueOf(recycleDeliveryOrderPagination.getCompanyId()));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
recycleDeliveryOrderQueryWrapper.lambda().and(t -> {
|
|
|
|
|
idList.forEach(tt -> {
|
|
|
|
|
t.like(RecycleDeliveryOrderEntity::getCompanyId, tt).or();
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(ObjectUtil.isNotEmpty(recycleDeliveryOrderPagination.getCleanerPhone())){
|
|
|
|
|
recycleDeliveryOrderNum++;
|
|
|
|
|
if (ObjectUtil.isNotEmpty(recycleDeliveryOrderPagination.getCleanerPhone())) {
|
|
|
|
|
recycleDeliveryOrderNum++;
|
|
|
|
|
|
|
|
|
|
String value = recycleDeliveryOrderPagination.getCleanerPhone() instanceof List ?
|
|
|
|
|
JsonUtil.getObjectToString(recycleDeliveryOrderPagination.getCleanerPhone()) :
|
|
|
|
|
String.valueOf(recycleDeliveryOrderPagination.getCleanerPhone());
|
|
|
|
|
recycleDeliveryOrderQueryWrapper.lambda().like(RecycleDeliveryOrderEntity::getCleanerPhone,value);
|
|
|
|
|
JsonUtil.getObjectToString(recycleDeliveryOrderPagination.getCleanerPhone()) :
|
|
|
|
|
String.valueOf(recycleDeliveryOrderPagination.getCleanerPhone());
|
|
|
|
|
recycleDeliveryOrderQueryWrapper.lambda().like(RecycleDeliveryOrderEntity::getCleanerPhone, value);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(ObjectUtil.isNotEmpty(recycleDeliveryOrderPagination.getCleanStatus())){
|
|
|
|
|
recycleDeliveryOrderNum++;
|
|
|
|
|
if (ObjectUtil.isNotEmpty(recycleDeliveryOrderPagination.getCleanStatus())) {
|
|
|
|
|
recycleDeliveryOrderNum++;
|
|
|
|
|
|
|
|
|
|
recycleDeliveryOrderQueryWrapper.lambda().eq(RecycleDeliveryOrderEntity::getCleanStatus,recycleDeliveryOrderPagination.getCleanStatus());
|
|
|
|
|
recycleDeliveryOrderQueryWrapper.lambda().eq(RecycleDeliveryOrderEntity::getCleanStatus, recycleDeliveryOrderPagination.getCleanStatus());
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(ObjectUtil.isNotEmpty(recycleDeliveryOrderPagination.getCleanNo())){
|
|
|
|
|
recycleDeliveryOrderNum++;
|
|
|
|
|
if (ObjectUtil.isNotEmpty(recycleDeliveryOrderPagination.getCleanNo())) {
|
|
|
|
|
recycleDeliveryOrderNum++;
|
|
|
|
|
|
|
|
|
|
String value = recycleDeliveryOrderPagination.getCleanNo() instanceof List ?
|
|
|
|
|
JsonUtil.getObjectToString(recycleDeliveryOrderPagination.getCleanNo()) :
|
|
|
|
|
String.valueOf(recycleDeliveryOrderPagination.getCleanNo());
|
|
|
|
|
recycleDeliveryOrderQueryWrapper.lambda().like(RecycleDeliveryOrderEntity::getCleanNo,value);
|
|
|
|
|
JsonUtil.getObjectToString(recycleDeliveryOrderPagination.getCleanNo()) :
|
|
|
|
|
String.valueOf(recycleDeliveryOrderPagination.getCleanNo());
|
|
|
|
|
recycleDeliveryOrderQueryWrapper.lambda().like(RecycleDeliveryOrderEntity::getCleanNo, value);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
List<String> intersection = generaterSwapUtil.getIntersection(intersectionList);
|
|
|
|
|
if (total>0){
|
|
|
|
|
if (intersection.size()==0){
|
|
|
|
|
if (total > 0) {
|
|
|
|
|
if (intersection.size() == 0) {
|
|
|
|
|
intersection.add("jnpfNullList");
|
|
|
|
|
}
|
|
|
|
|
recycleDeliveryOrderQueryWrapper.lambda().in(RecycleDeliveryOrderEntity::getId, intersection);
|
|
|
|
|
}
|
|
|
|
|
//是否有高级查询
|
|
|
|
|
if (StringUtil.isNotEmpty(superOp)){
|
|
|
|
|
if (allSuperIDlist.size()==0){
|
|
|
|
|
//是否有高级查询
|
|
|
|
|
if (StringUtil.isNotEmpty(superOp)) {
|
|
|
|
|
if (allSuperIDlist.size() == 0) {
|
|
|
|
|
allSuperIDlist.add("jnpfNullList");
|
|
|
|
|
}
|
|
|
|
|
List<String> finalAllSuperIDlist = allSuperIDlist;
|
|
|
|
|
recycleDeliveryOrderQueryWrapper.lambda().and(t->t.in(RecycleDeliveryOrderEntity::getId, finalAllSuperIDlist));
|
|
|
|
|
recycleDeliveryOrderQueryWrapper.lambda().and(t -> t.in(RecycleDeliveryOrderEntity::getId, finalAllSuperIDlist));
|
|
|
|
|
}
|
|
|
|
|
//是否有数据过滤查询
|
|
|
|
|
if (StringUtil.isNotEmpty(ruleOp)){
|
|
|
|
|
if (allRuleIDlist.size()==0){
|
|
|
|
|
//是否有数据过滤查询
|
|
|
|
|
if (StringUtil.isNotEmpty(ruleOp)) {
|
|
|
|
|
if (allRuleIDlist.size() == 0) {
|
|
|
|
|
allRuleIDlist.add("jnpfNullList");
|
|
|
|
|
}
|
|
|
|
|
List<String> finalAllRuleIDlist = allRuleIDlist;
|
|
|
|
|
recycleDeliveryOrderQueryWrapper.lambda().and(t->t.in(RecycleDeliveryOrderEntity::getId, finalAllRuleIDlist));
|
|
|
|
|
recycleDeliveryOrderQueryWrapper.lambda().and(t -> t.in(RecycleDeliveryOrderEntity::getId, finalAllRuleIDlist));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//排序
|
|
|
|
|
if(StringUtil.isEmpty(recycleDeliveryOrderPagination.getSidx())){
|
|
|
|
|
if (StringUtil.isEmpty(recycleDeliveryOrderPagination.getSidx())) {
|
|
|
|
|
recycleDeliveryOrderQueryWrapper.lambda().orderByDesc(RecycleDeliveryOrderEntity::getId);
|
|
|
|
|
}else{
|
|
|
|
|
} else {
|
|
|
|
|
try {
|
|
|
|
|
String sidx = recycleDeliveryOrderPagination.getSidx();
|
|
|
|
|
String[] strs= sidx.split("_name");
|
|
|
|
|
String[] strs = sidx.split("_name");
|
|
|
|
|
RecycleDeliveryOrderEntity recycleDeliveryOrderEntity = new RecycleDeliveryOrderEntity();
|
|
|
|
|
Field declaredField = recycleDeliveryOrderEntity.getClass().getDeclaredField(strs[0]);
|
|
|
|
|
declaredField.setAccessible(true);
|
|
|
|
|
String value = declaredField.getAnnotation(TableField.class).value();
|
|
|
|
|
recycleDeliveryOrderQueryWrapper="asc".equals(recycleDeliveryOrderPagination.getSort().toLowerCase())?recycleDeliveryOrderQueryWrapper.orderByAsc(value):recycleDeliveryOrderQueryWrapper.orderByDesc(value);
|
|
|
|
|
recycleDeliveryOrderQueryWrapper = "asc".equals(recycleDeliveryOrderPagination.getSort().toLowerCase()) ? recycleDeliveryOrderQueryWrapper.orderByAsc(value) : recycleDeliveryOrderQueryWrapper.orderByDesc(value);
|
|
|
|
|
} catch (NoSuchFieldException e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if("0".equals(dataType)){
|
|
|
|
|
if((total>0 && AllIdList.size()>0) || total==0){
|
|
|
|
|
Page<RecycleDeliveryOrderEntity> page=new Page<>(recycleDeliveryOrderPagination.getCurrentPage(), recycleDeliveryOrderPagination.getPageSize());
|
|
|
|
|
IPage<RecycleDeliveryOrderEntity> userIPage=this.page(page, recycleDeliveryOrderQueryWrapper);
|
|
|
|
|
return recycleDeliveryOrderPagination.setData(userIPage.getRecords(),userIPage.getTotal());
|
|
|
|
|
}else{
|
|
|
|
|
if ("0".equals(dataType)) {
|
|
|
|
|
if ((total > 0 && AllIdList.size() > 0) || total == 0) {
|
|
|
|
|
Page<RecycleDeliveryOrderEntity> page = new Page<>(recycleDeliveryOrderPagination.getCurrentPage(), recycleDeliveryOrderPagination.getPageSize());
|
|
|
|
|
IPage<RecycleDeliveryOrderEntity> userIPage = this.page(page, recycleDeliveryOrderQueryWrapper);
|
|
|
|
|
return recycleDeliveryOrderPagination.setData(userIPage.getRecords(), userIPage.getTotal());
|
|
|
|
|
} else {
|
|
|
|
|
List<RecycleDeliveryOrderEntity> list = new ArrayList();
|
|
|
|
|
return recycleDeliveryOrderPagination.setData(list, list.size());
|
|
|
|
|
}
|
|
|
|
|
}else{
|
|
|
|
|
} else {
|
|
|
|
|
return this.list(recycleDeliveryOrderQueryWrapper);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public RecycleDeliveryOrderEntity getInfo(String id){
|
|
|
|
|
QueryWrapper<RecycleDeliveryOrderEntity> queryWrapper=new QueryWrapper<>();
|
|
|
|
|
queryWrapper.lambda().eq(RecycleDeliveryOrderEntity::getId,id);
|
|
|
|
|
public RecycleDeliveryOrderEntity getInfo(String id) {
|
|
|
|
|
QueryWrapper<RecycleDeliveryOrderEntity> queryWrapper = new QueryWrapper<>();
|
|
|
|
|
queryWrapper.lambda().eq(RecycleDeliveryOrderEntity::getId, id);
|
|
|
|
|
return this.getOne(queryWrapper);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void create(RecycleDeliveryOrderEntity entity){
|
|
|
|
|
public void create(RecycleDeliveryOrderEntity entity) {
|
|
|
|
|
this.save(entity);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public boolean update(String id, RecycleDeliveryOrderEntity entity){
|
|
|
|
|
public boolean update(String id, RecycleDeliveryOrderEntity entity) {
|
|
|
|
|
return this.updateById(entity);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void delete(RecycleDeliveryOrderEntity entity){
|
|
|
|
|
if(entity!=null){
|
|
|
|
|
public void delete(RecycleDeliveryOrderEntity entity) {
|
|
|
|
|
if (entity != null) {
|
|
|
|
|
this.removeById(entity.getId());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
/** 验证表单唯一字段,正则,非空 i-0新增-1修改*/
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 验证表单唯一字段,正则,非空 i-0新增-1修改
|
|
|
|
|
*/
|
|
|
|
|
@Override
|
|
|
|
|
public String checkForm(RecycleDeliveryOrderForm form,int i) {
|
|
|
|
|
boolean isUp =StringUtil.isNotEmpty(form.getId()) && !form.getId().equals("0");
|
|
|
|
|
String id="";
|
|
|
|
|
public String checkForm(RecycleDeliveryOrderForm form, int i) {
|
|
|
|
|
boolean isUp = StringUtil.isNotEmpty(form.getId()) && !form.getId().equals("0");
|
|
|
|
|
String id = "";
|
|
|
|
|
String countRecover = "";
|
|
|
|
|
if (isUp){
|
|
|
|
|
if (isUp) {
|
|
|
|
|
id = form.getId();
|
|
|
|
|
}
|
|
|
|
|
//主表字段验证
|
|
|
|
|
if(StringUtil.isEmpty(form.getPhone())){
|
|
|
|
|
return "投递人手机不能为空";
|
|
|
|
|
}
|
|
|
|
|
if(StringUtil.isEmpty(form.getReportWeight())){
|
|
|
|
|
return "上报重量不能为空";
|
|
|
|
|
}
|
|
|
|
|
if(StringUtil.isEmpty(form.getPrice())){
|
|
|
|
|
return "单价不能为空";
|
|
|
|
|
}
|
|
|
|
|
if(StringUtil.isNotEmpty(form.getPrice())){
|
|
|
|
|
if(!Pattern.compile("^([1-9][\\d]*|0)(\\.[\\d]+)?$").matcher(String.valueOf(form.getPrice())).matches()){
|
|
|
|
|
return "请输入正确的金额";
|
|
|
|
|
if (StringUtil.isEmpty(form.getPhone())) {
|
|
|
|
|
return "投递人手机不能为空";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if(StringUtil.isEmpty(form.getTotalPrice())){
|
|
|
|
|
return "总价不能为空";
|
|
|
|
|
}
|
|
|
|
|
if(StringUtil.isNotEmpty(form.getTotalPrice())){
|
|
|
|
|
if(!Pattern.compile("^([1-9][\\d]*|0)(\\.[\\d]+)?$").matcher(String.valueOf(form.getTotalPrice())).matches()){
|
|
|
|
|
return "请输入正确的重量";
|
|
|
|
|
if (StringUtil.isEmpty(form.getReportWeight())) {
|
|
|
|
|
return "上报重量不能为空";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if(StringUtil.isEmpty(form.getOriginalWeight())){
|
|
|
|
|
return "桶内原重不能为空";
|
|
|
|
|
}
|
|
|
|
|
if(StringUtil.isNotEmpty(form.getAdjustWeight())){
|
|
|
|
|
if(!Pattern.compile("^([1-9][\\d]*|0)(\\.[\\d]+)?$").matcher(String.valueOf(form.getAdjustWeight())).matches()){
|
|
|
|
|
return "请输入正确的重量";
|
|
|
|
|
if (StringUtil.isEmpty(form.getPrice())) {
|
|
|
|
|
return "单价不能为空";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if(StringUtil.isEmpty(form.getAdjustPrice())){
|
|
|
|
|
return "审核总价不能为空";
|
|
|
|
|
}
|
|
|
|
|
if(StringUtil.isNotEmpty(form.getAdjustPrice())){
|
|
|
|
|
if(!Pattern.compile("^([1-9][\\d]*|0)(\\.[\\d]+)?$").matcher(String.valueOf(form.getAdjustPrice())).matches()){
|
|
|
|
|
return "请输入正确的重量";
|
|
|
|
|
if (StringUtil.isNotEmpty(form.getPrice())) {
|
|
|
|
|
if (!Pattern.compile("^([1-9][\\d]*|0)(\\.[\\d]+)?$").matcher(String.valueOf(form.getPrice())).matches()) {
|
|
|
|
|
return "请输入正确的金额";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if(StringUtil.isEmpty(form.getDeviceOrderNo())){
|
|
|
|
|
return "机柜单号不能为空";
|
|
|
|
|
}
|
|
|
|
|
if(StringUtil.isEmpty(form.getBagNo())){
|
|
|
|
|
return "垃圾袋编号不能为空";
|
|
|
|
|
}
|
|
|
|
|
if(StringUtil.isNotEmpty(form.getCleanerPhone())){
|
|
|
|
|
if(!Pattern.compile("^1[3456789]\\d{9}$").matcher(String.valueOf(form.getCleanerPhone())).matches()){
|
|
|
|
|
return "请输入正确的手机号码";
|
|
|
|
|
if (StringUtil.isEmpty(form.getTotalPrice())) {
|
|
|
|
|
return "总价不能为空";
|
|
|
|
|
}
|
|
|
|
|
if (StringUtil.isNotEmpty(form.getTotalPrice())) {
|
|
|
|
|
if (!Pattern.compile("^([1-9][\\d]*|0)(\\.[\\d]+)?$").matcher(String.valueOf(form.getTotalPrice())).matches()) {
|
|
|
|
|
return "请输入正确的重量";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (StringUtil.isEmpty(form.getOriginalWeight())) {
|
|
|
|
|
return "桶内原重不能为空";
|
|
|
|
|
}
|
|
|
|
|
if (StringUtil.isNotEmpty(form.getAdjustWeight())) {
|
|
|
|
|
if (!Pattern.compile("^([1-9][\\d]*|0)(\\.[\\d]+)?$").matcher(String.valueOf(form.getAdjustWeight())).matches()) {
|
|
|
|
|
return "请输入正确的重量";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (StringUtil.isEmpty(form.getAdjustPrice())) {
|
|
|
|
|
return "审核总价不能为空";
|
|
|
|
|
}
|
|
|
|
|
if (StringUtil.isNotEmpty(form.getAdjustPrice())) {
|
|
|
|
|
if (!Pattern.compile("^([1-9][\\d]*|0)(\\.[\\d]+)?$").matcher(String.valueOf(form.getAdjustPrice())).matches()) {
|
|
|
|
|
return "请输入正确的重量";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (StringUtil.isEmpty(form.getDeviceOrderNo())) {
|
|
|
|
|
return "机柜单号不能为空";
|
|
|
|
|
}
|
|
|
|
|
if (StringUtil.isEmpty(form.getBagNo())) {
|
|
|
|
|
return "垃圾袋编号不能为空";
|
|
|
|
|
}
|
|
|
|
|
if (StringUtil.isNotEmpty(form.getCleanerPhone())) {
|
|
|
|
|
if (!Pattern.compile("^1[3456789]\\d{9}$").matcher(String.valueOf(form.getCleanerPhone())).matches()) {
|
|
|
|
|
return "请输入正确的手机号码";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return countRecover;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 新增修改数据(事务回滚)
|
|
|
|
|
* @param id
|
|
|
|
|
* @param recycleDeliveryOrderForm
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
* 新增修改数据(事务回滚)
|
|
|
|
|
*
|
|
|
|
|
* @param id
|
|
|
|
|
* @param recycleDeliveryOrderForm
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
@Override
|
|
|
|
|
@Transactional
|
|
|
|
|
public void saveOrUpdate(RecycleDeliveryOrderForm recycleDeliveryOrderForm,String id, boolean isSave) throws Exception{
|
|
|
|
|
UserInfo userInfo=userProvider.get();
|
|
|
|
|
public void saveOrUpdate(RecycleDeliveryOrderForm recycleDeliveryOrderForm, String id, boolean isSave) throws Exception {
|
|
|
|
|
UserInfo userInfo = userProvider.get();
|
|
|
|
|
UserEntity userEntity = generaterSwapUtil.getUser(userInfo.getUserId());
|
|
|
|
|
recycleDeliveryOrderForm = JsonUtil.getJsonToBean(
|
|
|
|
|
generaterSwapUtil.swapDatetime(RecycleDeliveryOrderConstant.getFormData(),recycleDeliveryOrderForm),RecycleDeliveryOrderForm.class);
|
|
|
|
|
generaterSwapUtil.swapDatetime(RecycleDeliveryOrderConstant.getFormData(), recycleDeliveryOrderForm), RecycleDeliveryOrderForm.class);
|
|
|
|
|
RecycleDeliveryOrderEntity entity = JsonUtil.getJsonToBean(recycleDeliveryOrderForm, RecycleDeliveryOrderEntity.class);
|
|
|
|
|
|
|
|
|
|
if(isSave){
|
|
|
|
|
String mainId = RandomUtil.uuId() ;
|
|
|
|
|
entity.setOrderNo(generaterSwapUtil.getBillNumber("deliveryOrderCode", false));
|
|
|
|
|
entity.setCompanyId(generaterSwapUtil.getCurrentOrgIds(userInfo.getOrganizeId(),"all"));
|
|
|
|
|
entity.setLastModifyTime(null);
|
|
|
|
|
entity.setLastModifyUserId(null);
|
|
|
|
|
entity.setOrganizeJsonId(generaterSwapUtil.getCurrentOrgIds(userInfo.getOrganizeId(),"all"));
|
|
|
|
|
entity.setCreatorTime(DateUtil.getNowDate());
|
|
|
|
|
entity.setCreatorUserId(userInfo.getUserId());
|
|
|
|
|
if (isSave) {
|
|
|
|
|
String mainId = RandomUtil.uuId();
|
|
|
|
|
entity.setOrderNo(generaterSwapUtil.getBillNumber("deliveryOrderCode", false));
|
|
|
|
|
entity.setCompanyId(generaterSwapUtil.getCurrentOrgIds(userInfo.getOrganizeId(), "all"));
|
|
|
|
|
entity.setLastModifyTime(null);
|
|
|
|
|
entity.setLastModifyUserId(null);
|
|
|
|
|
entity.setOrganizeJsonId(generaterSwapUtil.getCurrentOrgIds(userInfo.getOrganizeId(), "all"));
|
|
|
|
|
entity.setCreatorTime(DateUtil.getNowDate());
|
|
|
|
|
entity.setCreatorUserId(userInfo.getUserId());
|
|
|
|
|
entity.setId(mainId);
|
|
|
|
|
}else{
|
|
|
|
|
entity.setOrderNo(generaterSwapUtil.getBillNumber("deliveryOrderCode", false));
|
|
|
|
|
entity.setCompanyId(generaterSwapUtil.getCurrentOrgIds(userInfo.getOrganizeId(),"all"));
|
|
|
|
|
entity.setLastModifyTime(null);
|
|
|
|
|
entity.setLastModifyUserId(null);
|
|
|
|
|
entity.setOrganizeJsonId(generaterSwapUtil.getCurrentOrgIds(userInfo.getOrganizeId(),"all"));
|
|
|
|
|
entity.setCreatorTime(DateUtil.getNowDate());
|
|
|
|
|
entity.setCreatorUserId(userInfo.getUserId());
|
|
|
|
|
} else {
|
|
|
|
|
entity.setOrderNo(generaterSwapUtil.getBillNumber("deliveryOrderCode", false));
|
|
|
|
|
entity.setCompanyId(generaterSwapUtil.getCurrentOrgIds(userInfo.getOrganizeId(), "all"));
|
|
|
|
|
entity.setLastModifyTime(null);
|
|
|
|
|
entity.setLastModifyUserId(null);
|
|
|
|
|
entity.setOrganizeJsonId(generaterSwapUtil.getCurrentOrgIds(userInfo.getOrganizeId(), "all"));
|
|
|
|
|
entity.setCreatorTime(DateUtil.getNowDate());
|
|
|
|
|
entity.setCreatorUserId(userInfo.getUserId());
|
|
|
|
|
}
|
|
|
|
|
this.saveOrUpdate(entity);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
@Transactional
|
|
|
|
|
public boolean audit(DeliveryAuditForm form) {
|
|
|
|
|
UserInfo userInfo = userProvider.get();
|
|
|
|
|
form.setLastModifyUserId(userInfo.getUserId());
|
|
|
|
|
form.setLastModifyTime(LocalDateTime.now());
|
|
|
|
|
UpdateWrapper<RecycleDeliveryOrderEntity> wrapper = new UpdateWrapper<>();
|
|
|
|
|
wrapper.lambda()
|
|
|
|
|
.set(RecycleDeliveryOrderEntity::getAdjustStatus, form.getAdjustStatus())
|
|
|
|
|
.set(RecycleDeliveryOrderEntity::getAdjustWeight, form.getAdjustWeight())
|
|
|
|
|
.set(RecycleDeliveryOrderEntity::getAdjustPrice, form.getAdjustPrice())
|
|
|
|
|
.set(RecycleDeliveryOrderEntity::getAdjustComm, form.getAdjustComm())
|
|
|
|
|
.set(RecycleDeliveryOrderEntity::getLastModifyUserId, form.getLastModifyUserId())
|
|
|
|
|
.set(RecycleDeliveryOrderEntity::getLastModifyTime, form.getLastModifyTime())
|
|
|
|
|
.eq(RecycleDeliveryOrderEntity::getId, form.getId());
|
|
|
|
|
return this.update(wrapper);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
@Transactional
|
|
|
|
|
public int batchAudit(DeliveryAuditBatch batch) {
|
|
|
|
|
UserInfo userInfo = userProvider.get();
|
|
|
|
|
batch.setLastModifyUserId(userInfo.getUserId());
|
|
|
|
|
batch.setLastModifyTime(LocalDateTime.now());
|
|
|
|
|
int update = deliveryOrderMapper.auditBatch(batch);
|
|
|
|
|
return update;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|