|
|
|
@ -5,7 +5,10 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
|
|
import com.github.pagehelper.PageHelper;
|
|
|
|
|
import com.glxp.api.req.inout.IoCodeLostRequest;
|
|
|
|
|
import com.glxp.api.res.collect.RelCodeDetailResponse;
|
|
|
|
|
import com.glxp.api.res.inout.IoCodeLostResponse;
|
|
|
|
|
import com.glxp.api.service.collect.RelCodeDetailService;
|
|
|
|
|
import com.glxp.api.util.MsDateUtil;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
@ -38,16 +41,31 @@ public class IoCodeLostServiceImpl extends ServiceImpl<IoCodeLostMapper, IoCodeL
|
|
|
|
|
return codeLostEntityMapper.selectLost(ioCodeLostRequest);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
RelCodeDetailService relCodeDetailService;
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public IoCodeLostEntity findByCode(String code) {
|
|
|
|
|
|
|
|
|
|
List<IoCodeLostEntity> codeLostEntities = codeLostEntityMapper.selectList(new QueryWrapper<IoCodeLostEntity>().eq("code", code).last("limit 1"));
|
|
|
|
|
RelCodeDetailResponse codeRelEntity = relCodeDetailService.findByCode(code);
|
|
|
|
|
if (codeRelEntity != null) {
|
|
|
|
|
IoCodeLostEntity udiEntity = new IoCodeLostEntity();
|
|
|
|
|
udiEntity.setBatchNo(codeRelEntity.getBatchNo());
|
|
|
|
|
udiEntity.setCode(code);
|
|
|
|
|
udiEntity.setProduceDate(MsDateUtil.formatDate(codeRelEntity.getMadeDate(), "yyMMdd"));
|
|
|
|
|
udiEntity.setExpireDate(MsDateUtil.formatDate(codeRelEntity.getValidateDate(), "yyMMdd"));
|
|
|
|
|
return udiEntity;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
List<IoCodeLostEntity> codeLostEntities = codeLostEntityMapper.selectList(new QueryWrapper<IoCodeLostEntity>().like("code", code).last("limit 1"));
|
|
|
|
|
if (CollUtil.isNotEmpty(codeLostEntities)) {
|
|
|
|
|
return codeLostEntities.get(0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public int insert(IoCodeLostEntity ioCodeLostEntity) {
|
|
|
|
|
|
|
|
|
|