|
|
|
@ -30,6 +30,9 @@ import jnpf.util.*;
|
|
|
|
|
import java.util.*;
|
|
|
|
|
import jnpf.base.UserInfo;
|
|
|
|
|
import jnpf.permission.entity.UserEntity;
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
*
|
|
|
|
|
* warehousingReturn
|
|
|
|
@ -41,14 +44,14 @@ import jnpf.permission.entity.UserEntity;
|
|
|
|
|
@Service
|
|
|
|
|
public class WarehousingReturnServiceImpl extends ServiceImpl<WarehousingReturnMapper, WarehousingReturnEntity> implements WarehousingReturnService{
|
|
|
|
|
@Autowired
|
|
|
|
|
private GeneraterSwapUtil generaterSwapUtil;
|
|
|
|
|
private GeneraterSwapUtil2 generaterSwapUtil;
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private UserProvider userProvider;
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private WarehousingReturnProductService warehousingReturnProductService;
|
|
|
|
|
@Autowired
|
|
|
|
|
@Resource
|
|
|
|
|
private WarehousingReturnMapper warehousingReturnMapper;
|
|
|
|
|
@Override
|
|
|
|
|
public List<WarehousingReturnEntity> getList(WarehousingReturnPagination warehousingReturnPagination){
|
|
|
|
@ -194,8 +197,8 @@ public class WarehousingReturnServiceImpl extends ServiceImpl<WarehousingReturnM
|
|
|
|
|
Long fir = Long.valueOf(String.valueOf(CreatorTimeList.get(0)));
|
|
|
|
|
Long sec = Long.valueOf(String.valueOf(CreatorTimeList.get(1)));
|
|
|
|
|
|
|
|
|
|
warehousingReturnQueryWrapper.lambda().ge(WarehousingReturnEntity::getCreatorTime, new Date(fir))
|
|
|
|
|
.le(WarehousingReturnEntity::getCreatorTime, DateUtil.stringToDate(DateUtil.daFormatYmd(sec) + " 23:59:59"));
|
|
|
|
|
warehousingReturnQueryWrapper.ge("a.F_CREATOR_TIME", new Date(fir))
|
|
|
|
|
.le("a.F_CREATOR_TIME", DateUtil.stringToDate(DateUtil.daFormatYmd(sec) + " 23:59:59"));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
@ -203,7 +206,8 @@ public class WarehousingReturnServiceImpl extends ServiceImpl<WarehousingReturnM
|
|
|
|
|
if(ObjectUtil.isNotEmpty(warehousingReturnPagination.getCreatorUserId())){
|
|
|
|
|
warehousingReturnNum++;
|
|
|
|
|
|
|
|
|
|
warehousingReturnQueryWrapper.lambda().eq(WarehousingReturnEntity::getCreatorUserId,warehousingReturnPagination.getCreatorUserId());
|
|
|
|
|
// warehousingReturnQueryWrapper.lambda().eq(WarehousingReturnEntity::getCreatorUserId,warehousingReturnPagination.getCreatorUserId());
|
|
|
|
|
warehousingReturnQueryWrapper.eq("a.CREATOR_USER_ID",warehousingReturnPagination.getCreatorUserId());
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -213,8 +217,7 @@ public class WarehousingReturnServiceImpl extends ServiceImpl<WarehousingReturnM
|
|
|
|
|
String value = warehousingReturnPagination.getReturnCode() instanceof List ?
|
|
|
|
|
JsonUtil.getObjectToString(warehousingReturnPagination.getReturnCode()) :
|
|
|
|
|
String.valueOf(warehousingReturnPagination.getReturnCode());
|
|
|
|
|
warehousingReturnQueryWrapper.lambda().like(WarehousingReturnEntity::getReturnCode,value);
|
|
|
|
|
|
|
|
|
|
warehousingReturnQueryWrapper.like( "a.RETURN_CODE",value);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(ObjectUtil.isNotEmpty(warehousingReturnPagination.getReturnTime())){
|
|
|
|
@ -224,10 +227,8 @@ public class WarehousingReturnServiceImpl extends ServiceImpl<WarehousingReturnM
|
|
|
|
|
Long fir = Long.valueOf(String.valueOf(ReturnTimeList.get(0)));
|
|
|
|
|
Long sec = Long.valueOf(String.valueOf(ReturnTimeList.get(1)));
|
|
|
|
|
|
|
|
|
|
warehousingReturnQueryWrapper.lambda().ge(WarehousingReturnEntity::getReturnTime, new Date(fir))
|
|
|
|
|
.le(WarehousingReturnEntity::getReturnTime, DateUtil.stringToDate(DateUtil.daFormatYmd(sec) + " 23:59:59"));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
warehousingReturnQueryWrapper.ge("a.RETURN_TIME", new Date(fir))
|
|
|
|
|
.le("a.RETURN_TIME", DateUtil.stringToDate(DateUtil.daFormatYmd(sec) + " 23:59:59"));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(ObjectUtil.isNotEmpty(warehousingReturnPagination.getReturnReason())){
|
|
|
|
@ -251,9 +252,9 @@ public class WarehousingReturnServiceImpl extends ServiceImpl<WarehousingReturnM
|
|
|
|
|
idList.add(String.valueOf(warehousingReturnPagination.getReturnReason()));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
warehousingReturnQueryWrapper.lambda().and(t->{
|
|
|
|
|
warehousingReturnQueryWrapper.and(t->{
|
|
|
|
|
idList.forEach(tt->{
|
|
|
|
|
t.like(WarehousingReturnEntity::getReturnReason, tt).or();
|
|
|
|
|
t.like("a.RETURN_REASON", tt).or();
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
@ -274,30 +275,31 @@ public class WarehousingReturnServiceImpl extends ServiceImpl<WarehousingReturnM
|
|
|
|
|
if (intersection.size()==0){
|
|
|
|
|
intersection.add("jnpfNullList");
|
|
|
|
|
}
|
|
|
|
|
warehousingReturnQueryWrapper.lambda().in(WarehousingReturnEntity::getId, intersection);
|
|
|
|
|
}
|
|
|
|
|
warehousingReturnQueryWrapper.in("a.id", intersection); }
|
|
|
|
|
//是否有高级查询
|
|
|
|
|
if (StringUtil.isNotEmpty(superOp)){
|
|
|
|
|
if (allSuperIDlist.size()==0){
|
|
|
|
|
allSuperIDlist.add("jnpfNullList");
|
|
|
|
|
}
|
|
|
|
|
List<String> finalAllSuperIDlist = allSuperIDlist;
|
|
|
|
|
warehousingReturnQueryWrapper.lambda().and(t->t.in(WarehousingReturnEntity::getId, finalAllSuperIDlist));
|
|
|
|
|
}
|
|
|
|
|
warehousingReturnQueryWrapper.and(t->t.in("a.id", finalAllSuperIDlist)); }
|
|
|
|
|
//是否有数据过滤查询
|
|
|
|
|
if (StringUtil.isNotEmpty(ruleOp)){
|
|
|
|
|
if (allRuleIDlist.size()==0){
|
|
|
|
|
allRuleIDlist.add("jnpfNullList");
|
|
|
|
|
}
|
|
|
|
|
List<String> finalAllRuleIDlist = allRuleIDlist;
|
|
|
|
|
warehousingReturnQueryWrapper.lambda().and(t->t.in(WarehousingReturnEntity::getId, finalAllRuleIDlist));
|
|
|
|
|
warehousingReturnQueryWrapper.and(t->t.in("a.id", finalAllRuleIDlist));
|
|
|
|
|
}
|
|
|
|
|
//假删除标志
|
|
|
|
|
warehousingReturnQueryWrapper.lambda().isNull(WarehousingReturnEntity::getDeleteMark);
|
|
|
|
|
// warehousingReturnQueryWrapper.lambda().isNull(WarehousingReturnEntity::getDeleteMark);
|
|
|
|
|
warehousingReturnQueryWrapper.isNull("a.f_delete_mark");
|
|
|
|
|
|
|
|
|
|
//排序
|
|
|
|
|
if(StringUtil.isEmpty(warehousingReturnPagination.getSidx())){
|
|
|
|
|
warehousingReturnQueryWrapper.lambda().orderByDesc(WarehousingReturnEntity::getId);
|
|
|
|
|
// warehousingReturnQueryWrapper.lambda().orderByDesc(WarehousingReturnEntity::getId);
|
|
|
|
|
warehousingReturnPagination.setSidx("a.f_creator_time");
|
|
|
|
|
warehousingReturnPagination.setSort("DESC");
|
|
|
|
|
}else{
|
|
|
|
|
try {
|
|
|
|
|
String sidx = warehousingReturnPagination.getSidx();
|
|
|
|
@ -306,7 +308,8 @@ public class WarehousingReturnServiceImpl extends ServiceImpl<WarehousingReturnM
|
|
|
|
|
Field declaredField = warehousingReturnEntity.getClass().getDeclaredField(strs[0]);
|
|
|
|
|
declaredField.setAccessible(true);
|
|
|
|
|
String value = declaredField.getAnnotation(TableField.class).value();
|
|
|
|
|
warehousingReturnQueryWrapper="asc".equals(warehousingReturnPagination.getSort().toLowerCase())?warehousingReturnQueryWrapper.orderByAsc(value):warehousingReturnQueryWrapper.orderByDesc(value);
|
|
|
|
|
// warehousingReturnQueryWrapper="asc".equals(warehousingReturnPagination.getSort().toLowerCase())?warehousingReturnQueryWrapper.orderByAsc(value):warehousingReturnQueryWrapper.orderByDesc(value);
|
|
|
|
|
warehousingReturnPagination.setSidx("a." + value);
|
|
|
|
|
} catch (NoSuchFieldException e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}
|
|
|
|
@ -315,8 +318,10 @@ public class WarehousingReturnServiceImpl extends ServiceImpl<WarehousingReturnM
|
|
|
|
|
if("0".equals(dataType)){
|
|
|
|
|
if((total>0 && AllIdList.size()>0) || total==0){
|
|
|
|
|
Page<WarehousingReturnEntity> page=new Page<>(warehousingReturnPagination.getCurrentPage(), warehousingReturnPagination.getPageSize());
|
|
|
|
|
IPage<WarehousingReturnEntity> userIPage=this.page(page, warehousingReturnQueryWrapper);
|
|
|
|
|
// IPage<WarehousingReturnEntity> userIPage=this.page(page, warehousingReturnQueryWrapper);
|
|
|
|
|
IPage<WarehousingReturnEntity> userIPage =warehousingReturnMapper.queryWarehousingReturnList(page,warehousingReturnPagination,warehousingReturnQueryWrapper);
|
|
|
|
|
return warehousingReturnPagination.setData(userIPage.getRecords(),userIPage.getTotal());
|
|
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
List<WarehousingReturnEntity> list = new ArrayList();
|
|
|
|
|
return warehousingReturnPagination.setData(list, list.size());
|
|
|
|
|