app
This commit is contained in:
parent
2d36aaa573
commit
0d77fdb454
|
|
@ -4,11 +4,14 @@ import com.bonus.aqgqj.annotation.DecryptAndVerify;
|
|||
import com.bonus.aqgqj.annotation.LogAnnotation;
|
||||
import com.bonus.aqgqj.app.entity.ExperimentalAppVo;
|
||||
import com.bonus.aqgqj.app.entity.ExperimentalDetailAppVo;
|
||||
import com.bonus.aqgqj.app.entity.SamplesManageAppVo;
|
||||
import com.bonus.aqgqj.app.entity.TestAppVo;
|
||||
import com.bonus.aqgqj.app.entity.dto.ParamsAppDto;
|
||||
import com.bonus.aqgqj.app.service.ExperimentalAppService;
|
||||
import com.bonus.aqgqj.system.vo.EncryptedReq;
|
||||
import com.bonus.aqgqj.utils.ServerResponse;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
|
@ -35,13 +38,15 @@ public class ExperimentalAppController {
|
|||
@LogAnnotation(operModul = "app试验管理", operation = "查询列表", operDesc = "业务级事件", operType = "查询")
|
||||
// @PreAuthorize("@pms.hasPermission('sys:experimental:query')" )
|
||||
public ServerResponse getList(EncryptedReq<ParamsAppDto> data) {
|
||||
PageHelper.startPage(data.getData().getPage(), data.getData().getLimit());
|
||||
try {
|
||||
List<ExperimentalAppVo> list = service.getList(data.getData());
|
||||
return ServerResponse.createSuccess(list);
|
||||
PageInfo<ExperimentalAppVo> pageInfo = new PageInfo<>(list);
|
||||
return ServerResponse.createSuccessPage(pageInfo,data.getData().getPage(),data.getData().getLimit());
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(),e);
|
||||
}
|
||||
return ServerResponse.createErroe("操作失败");
|
||||
return ServerResponse.createErrorPage(data.getData().getPage(),data.getData().getLimit());
|
||||
}
|
||||
|
||||
@PostMapping(value = "getDetailList")
|
||||
|
|
@ -49,13 +54,15 @@ public class ExperimentalAppController {
|
|||
@LogAnnotation(operModul = "试验详情管理", operation = "查询试验详情列表", operDesc = "业务级事件", operType = "查询")
|
||||
// @PreAuthorize("@pms.hasPermission('sys:experimentalTest:query')")
|
||||
public ServerResponse getDetailList(EncryptedReq<ParamsAppDto> data) {
|
||||
PageHelper.startPage(data.getData().getPage(), data.getData().getLimit());
|
||||
try {
|
||||
List<ExperimentalDetailAppVo> list = service.getDetailList(data.getData());
|
||||
return ServerResponse.createSuccess(list);
|
||||
PageInfo<ExperimentalDetailAppVo> pageInfo = new PageInfo<>(list);
|
||||
return ServerResponse.createSuccessPage(pageInfo,data.getData().getPage(),data.getData().getLimit());
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(),e);
|
||||
}
|
||||
return ServerResponse.createErroe("操作失败");
|
||||
return ServerResponse.createErrorPage(data.getData().getPage(),data.getData().getLimit());
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1,7 +1,11 @@
|
|||
package com.bonus.aqgqj.app.controller;
|
||||
|
||||
import com.bonus.aqgqj.annotation.DecryptAndVerify;
|
||||
import com.bonus.aqgqj.app.entity.HomeAppVo;
|
||||
import com.bonus.aqgqj.app.entity.dto.ParamsAppDto;
|
||||
import com.bonus.aqgqj.app.service.HomeAppService;
|
||||
import com.bonus.aqgqj.basis.entity.dto.ParamsDto;
|
||||
import com.bonus.aqgqj.system.vo.EncryptedReq;
|
||||
import io.swagger.annotations.Api;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
|
@ -30,16 +34,17 @@ public class HomeAppController {
|
|||
* app首页--代办任务统计
|
||||
*/
|
||||
@PostMapping(value = "getApprovalNum")
|
||||
public Map<String, Object> getApprovalNum(HomeAppVo vo) {
|
||||
return service.getApprovalNum(vo);
|
||||
public Map<String, Object> getApprovalNum() {
|
||||
return service.getApprovalNum();
|
||||
}
|
||||
|
||||
/**
|
||||
* 班组工作情况统计
|
||||
*/
|
||||
@PostMapping(value = "getATeamNumForEcharts")
|
||||
public Map<String,Object> getATeamNumForEcharts(HomeAppVo vo) {
|
||||
return service.getATeamNumForEcharts(vo);
|
||||
@DecryptAndVerify(decryptedClass = HomeAppVo.class)
|
||||
public Map<String,Object> getATeamNumForEcharts(EncryptedReq<HomeAppVo> data) {
|
||||
return service.getATeamNumForEcharts(data.getData());
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -0,0 +1,84 @@
|
|||
package com.bonus.aqgqj.app.controller;
|
||||
|
||||
import com.bonus.aqgqj.annotation.DecryptAndVerify;
|
||||
import com.bonus.aqgqj.annotation.LogAnnotation;
|
||||
import com.bonus.aqgqj.app.entity.ExperimentalAppVo;
|
||||
import com.bonus.aqgqj.app.entity.ExperimentalDetailAppVo;
|
||||
import com.bonus.aqgqj.app.entity.SamplesManageAppVo;
|
||||
import com.bonus.aqgqj.app.entity.dto.ParamsAppDto;
|
||||
import com.bonus.aqgqj.app.service.PrimaryDataAppService;
|
||||
import com.bonus.aqgqj.basis.entity.dto.ParamsDto;
|
||||
import com.bonus.aqgqj.basis.entity.vo.ExperimentalDetailVo;
|
||||
import com.bonus.aqgqj.basis.entity.vo.ExperimentalVo;
|
||||
import com.bonus.aqgqj.primaryData.dao.PrimaryDataDao;
|
||||
import com.bonus.aqgqj.primaryData.service.PrimaryDataService;
|
||||
import com.bonus.aqgqj.system.vo.EncryptedReq;
|
||||
import com.bonus.aqgqj.utils.ServerResponse;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import io.swagger.annotations.Api;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @description app 原始记录
|
||||
* @author hay
|
||||
* @date 2024/8/8 13:30
|
||||
*/
|
||||
@Api(tags = "原始记录")
|
||||
@RestController
|
||||
@RequestMapping("/app/primaryDatas/")
|
||||
public class PrimaryDataAppController {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger("adminLogger");
|
||||
|
||||
@Autowired
|
||||
private PrimaryDataAppService primaryDataAppService;
|
||||
|
||||
/**
|
||||
* 根据关键词获取实验设备列表
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "getList")
|
||||
@DecryptAndVerify(decryptedClass = ParamsAppDto.class)
|
||||
@LogAnnotation(operModul = "原始数据管理-原始数据管理", operation = "查询原始数据列表", operDesc = "系统级事件",operType="查询")
|
||||
// @PreAuthorize("@pms.hasPermission('primaryData:primary:query')" )
|
||||
public ServerResponse listPrimaryDatas(EncryptedReq<ParamsAppDto> data) {
|
||||
PageHelper.startPage(data.getData().getPage(), data.getData().getLimit());
|
||||
try {
|
||||
List<ExperimentalAppVo> list = primaryDataAppService.getList(data.getData());
|
||||
PageInfo<ExperimentalAppVo> pageInfo = new PageInfo<>(list);
|
||||
return ServerResponse.createSuccessPage(pageInfo,data.getData().getPage(),data.getData().getLimit());
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(),e);
|
||||
}
|
||||
return ServerResponse.createErrorPage(data.getData().getPage(),data.getData().getLimit());
|
||||
}
|
||||
|
||||
@PostMapping(value = "getDetailList")
|
||||
@DecryptAndVerify(decryptedClass = ParamsAppDto.class)
|
||||
@LogAnnotation(operModul = "试验详情管理", operation = "查询试验详情列表", operDesc = "系统级事件", operType = "查询")
|
||||
// @PreAuthorize("@pms.hasPermission('sys:experimentalTest:query')")
|
||||
public ServerResponse getDetailList(EncryptedReq<ParamsAppDto> data) {
|
||||
PageHelper.startPage(data.getData().getPage(), data.getData().getLimit());
|
||||
try {
|
||||
List<ExperimentalDetailAppVo> list = primaryDataAppService.getDetailList(data.getData());
|
||||
PageInfo<ExperimentalDetailAppVo> pageInfo = new PageInfo<>(list);
|
||||
return ServerResponse.createSuccessPage(pageInfo, data.getData().getPage(), data.getData().getLimit());
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(), e);
|
||||
}
|
||||
return ServerResponse.createErrorPage(data.getData().getPage(), data.getData().getLimit());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,47 @@
|
|||
package com.bonus.aqgqj.app.controller;
|
||||
|
||||
import com.bonus.aqgqj.annotation.DecryptAndVerify;
|
||||
import com.bonus.aqgqj.annotation.LogAnnotation;
|
||||
import com.bonus.aqgqj.app.entity.SamplesManageAppVo;
|
||||
import com.bonus.aqgqj.app.service.QrCodeService;
|
||||
import com.bonus.aqgqj.app.service.SelectAppService;
|
||||
import com.bonus.aqgqj.system.vo.EncryptedReq;
|
||||
import com.bonus.aqgqj.system.vo.dto.SelectDto;
|
||||
import com.bonus.aqgqj.utils.ServerResponse;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @description 二维码扫描
|
||||
* @author hay
|
||||
* @date 2024/8/12 10:34
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/app/qrCode/")
|
||||
@Slf4j
|
||||
public class QrCodeController {
|
||||
|
||||
@Resource(name = "QrCodeService")
|
||||
private QrCodeService service;
|
||||
|
||||
|
||||
|
||||
@PostMapping(value = "getSampleLabelByQrCode")
|
||||
@DecryptAndVerify(decryptedClass = SamplesManageAppVo.class)
|
||||
@LogAnnotation(operModul = "收样标签", operation = "扫描二维码获取数据", operDesc = "业务级事件",operType="查询")
|
||||
public ServerResponse getSampleLabelByQrCode(EncryptedReq<SamplesManageAppVo> data) {
|
||||
try {
|
||||
SamplesManageAppVo bean = service.getSampleLabelByQrCode(data.getData());
|
||||
return ServerResponse.createSuccess(bean);
|
||||
}catch (Exception e){
|
||||
log.error(e.toString(),e);
|
||||
}
|
||||
return ServerResponse.createErroe("操作失败");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -4,8 +4,11 @@ import com.bonus.aqgqj.annotation.DecryptAndVerify;
|
|||
import com.bonus.aqgqj.annotation.LogAnnotation;
|
||||
import com.bonus.aqgqj.app.entity.SamplesManageAppVo;
|
||||
import com.bonus.aqgqj.app.service.SamplesManageAppService;
|
||||
import com.bonus.aqgqj.basis.entity.dto.SamplesManageDto;
|
||||
import com.bonus.aqgqj.system.vo.EncryptedReq;
|
||||
import com.bonus.aqgqj.utils.ServerResponse;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import io.swagger.annotations.Api;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
|
@ -36,13 +39,63 @@ public class SamplesManageAppController {
|
|||
@LogAnnotation(operModul = "app收样管理", operation = "查询列表", operDesc = "业务级事件",operType="查询")
|
||||
// @PreAuthorize("@pms.hasPermission('sys:samples:query')" )
|
||||
public ServerResponse getList(EncryptedReq<SamplesManageAppVo> data) {
|
||||
PageHelper.startPage(data.getData().getPage(), data.getData().getLimit());
|
||||
try {
|
||||
List<SamplesManageAppVo> list = samplesManageAppService.list(data.getData());
|
||||
return ServerResponse.createSuccess(list);
|
||||
PageInfo<SamplesManageAppVo> pageInfo = new PageInfo<>(list);
|
||||
return ServerResponse.createSuccessPage(pageInfo,data.getData().getPage(),data.getData().getLimit());
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(),e);
|
||||
}
|
||||
return ServerResponse.createErroe("操作失败");
|
||||
return ServerResponse.createErrorPage(data.getData().getPage(),data.getData().getLimit());
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 删除收样列表数据
|
||||
*/
|
||||
@PostMapping("delSamplesList")
|
||||
@DecryptAndVerify(decryptedClass = SamplesManageAppVo.class)
|
||||
@LogAnnotation(operModul = "收样管理", operation = "删除收样列表数据", operDesc = "业务级事件", operType = "删除")
|
||||
// @PreAuthorize("@pms.hasPermission('sys:samples:add')")
|
||||
public ServerResponse delSamplesList(EncryptedReq<SamplesManageAppVo> vo) {
|
||||
try {
|
||||
return samplesManageAppService.delSamplesList(vo.getData());
|
||||
}catch (Exception e){
|
||||
log.error(e.toString(),e);
|
||||
return ServerResponse.createErroe("操作失败");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 删除收样详情数据
|
||||
*/
|
||||
@PostMapping("delSamplesDetails")
|
||||
@DecryptAndVerify(decryptedClass = SamplesManageAppVo.class)
|
||||
@LogAnnotation(operModul = "收样管理", operation = "删除收样详情数据", operDesc = "业务级事件", operType = "删除")
|
||||
// @PreAuthorize("@pms.hasPermission('sys:samples:add')")
|
||||
public ServerResponse delSamplesDetails(EncryptedReq<SamplesManageAppVo> vo) {
|
||||
try {
|
||||
return samplesManageAppService.delSamplesDetails(vo.getData());
|
||||
}catch (Exception e){
|
||||
log.error(e.toString(),e);
|
||||
return ServerResponse.createErroe("操作失败");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 修改收样信息
|
||||
*/
|
||||
@PostMapping("updateSamplesList")
|
||||
@DecryptAndVerify(decryptedClass = SamplesManageAppVo.class)
|
||||
@LogAnnotation(operModul = "收样管理", operation = "修改收样信息", operDesc = "业务级事件", operType = "删除")
|
||||
// @PreAuthorize("@pms.hasPermission('sys:samples:add')")
|
||||
public ServerResponse updateSamplesList(EncryptedReq<SamplesManageAppVo> vo) {
|
||||
try {
|
||||
return samplesManageAppService.updateSamplesList(vo.getData());
|
||||
}catch (Exception e){
|
||||
log.error(e.toString(),e);
|
||||
return ServerResponse.createErroe("操作失败");
|
||||
}
|
||||
}
|
||||
|
||||
@PostMapping(value = "getDetailsList")
|
||||
|
|
@ -50,13 +103,15 @@ public class SamplesManageAppController {
|
|||
@LogAnnotation(operModul = "app收样管理", operation = "收样管理详情", operDesc = "业务级事件",operType="查询")
|
||||
// @PreAuthorize("@pms.hasPermission('sys:samples:query')" )
|
||||
public ServerResponse getDetailsList(EncryptedReq<SamplesManageAppVo> data) {
|
||||
PageHelper.startPage(data.getData().getPage(), data.getData().getLimit());
|
||||
try {
|
||||
List<SamplesManageAppVo> list = samplesManageAppService.getDetailsList(data.getData());
|
||||
return ServerResponse.createSuccess(list);
|
||||
PageInfo<SamplesManageAppVo> pageInfo = new PageInfo<>(list);
|
||||
return ServerResponse.createSuccessPage(pageInfo,data.getData().getPage(),data.getData().getLimit());
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(),e);
|
||||
}
|
||||
return ServerResponse.createErroe("操作失败");
|
||||
return ServerResponse.createErrorPage(data.getData().getPage(),data.getData().getLimit());
|
||||
}
|
||||
|
||||
@PostMapping(value = "getSampleLabelData")
|
||||
|
|
@ -119,17 +174,4 @@ public class SamplesManageAppController {
|
|||
return ServerResponse.createErroe("操作失败");
|
||||
}
|
||||
|
||||
@PostMapping(value = "getSampleLabelByQrCode")
|
||||
@DecryptAndVerify(decryptedClass = SamplesManageAppVo.class)
|
||||
@LogAnnotation(operModul = "收样标签", operation = "扫描二维码获取收样标签", operDesc = "业务级事件",operType="查询")
|
||||
// @PreAuthorize("@pms.hasPermission('sys:samples:query')" )
|
||||
public ServerResponse getSampleLabelByQrCode(EncryptedReq<SamplesManageAppVo> data) {
|
||||
try {
|
||||
SamplesManageAppVo bean = samplesManageAppService.getSampleLabelByQrCode(data.getData());
|
||||
return ServerResponse.createSuccess(bean);
|
||||
}catch (Exception e){
|
||||
log.error(e.toString(),e);
|
||||
}
|
||||
return ServerResponse.createErroe("操作失败");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,9 +34,10 @@ public class SelectAppController {
|
|||
* 查询所有工器具
|
||||
*/
|
||||
@PostMapping(value = "getToolsSelect")
|
||||
public ServerResponse getToolsSelect() {
|
||||
@DecryptAndVerify(decryptedClass = SamplesManageAppVo.class)
|
||||
public ServerResponse getToolsSelect(EncryptedReq<SamplesManageAppVo> data) {
|
||||
try {
|
||||
List<SamplesManageAppVo> list = service.getToolsSelect();
|
||||
List<SamplesManageAppVo> list = service.getToolsSelect(data.getData());
|
||||
return ServerResponse.createSuccess(list);
|
||||
}catch (Exception e){
|
||||
log.error(e.toString(),e);
|
||||
|
|
|
|||
|
|
@ -14,10 +14,9 @@ import java.util.List;
|
|||
public interface HomeAppDao {
|
||||
/**
|
||||
* 获取代办任务
|
||||
* @param vo
|
||||
* @return
|
||||
*/
|
||||
List<HomeAppVo> getApprovalNum(HomeAppVo vo);
|
||||
List<HomeAppVo> getApprovalNum();
|
||||
|
||||
/**
|
||||
* 获取班组
|
||||
|
|
|
|||
|
|
@ -0,0 +1,51 @@
|
|||
package com.bonus.aqgqj.app.dao;
|
||||
|
||||
import com.bonus.aqgqj.app.entity.ExperimentalAppVo;
|
||||
import com.bonus.aqgqj.app.entity.ExperimentalDetailAppVo;
|
||||
import com.bonus.aqgqj.app.entity.dto.ParamsAppDto;
|
||||
import com.bonus.aqgqj.basis.entity.dto.ParamsDto;
|
||||
import com.bonus.aqgqj.basis.entity.vo.ExperimentalDetailVo;
|
||||
import com.bonus.aqgqj.basis.entity.vo.ExperimentalVo;
|
||||
import org.apache.ibatis.annotations.MapKey;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @description app原始记录
|
||||
* @author hay
|
||||
* @date 2024/8/8 13:46
|
||||
*/
|
||||
@Mapper
|
||||
public interface PrimaryDataAppDao {
|
||||
|
||||
/**
|
||||
* 原始数据列表
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
List<ExperimentalAppVo> getList(ParamsAppDto data);
|
||||
|
||||
/**
|
||||
* 试验详情列表
|
||||
*
|
||||
* @param dto
|
||||
* @return List<ExperimentalDetailAppVo>
|
||||
* @author cwchen
|
||||
* @date 2024/7/20 13:27
|
||||
*/
|
||||
List<ExperimentalDetailAppVo> getDetailList(ParamsAppDto dto);
|
||||
|
||||
/**
|
||||
* 查询试验设备数量
|
||||
*
|
||||
* @param experId
|
||||
* @return List<Sample>
|
||||
* @author cwchen
|
||||
* @date 2024/7/22 10:58
|
||||
*/
|
||||
@MapKey("id")
|
||||
List<Map<String, String>> getExperDevItemsNum(Long experId);
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
package com.bonus.aqgqj.app.dao;
|
||||
|
||||
import com.bonus.aqgqj.app.entity.ExperDeviceAppVo;
|
||||
import com.bonus.aqgqj.app.entity.SamplesManageAppVo;
|
||||
import com.bonus.aqgqj.base.entity.SelectEntity;
|
||||
import com.bonus.aqgqj.basis.entity.vo.ConfigItemsVo;
|
||||
import com.bonus.aqgqj.system.vo.dto.SelectDto;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @description 二维码扫描
|
||||
* @author hay
|
||||
* @date 2024/8/1 17:30
|
||||
*/
|
||||
@Repository("QrCodeDao")
|
||||
public interface QrCodeDao {
|
||||
|
||||
/**
|
||||
* 获取收样标签数据
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
SamplesManageAppVo getSampleLabelByQrCode(SamplesManageAppVo data);
|
||||
|
||||
/**
|
||||
* 获取实验项
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
List<ConfigItemsVo> getTestItemList(SamplesManageAppVo dto);
|
||||
|
||||
}
|
||||
|
|
@ -98,9 +98,31 @@ public interface SamplesManageAppDao {
|
|||
Integer getIdByBatchCode(String batchCode);
|
||||
|
||||
/**
|
||||
* 获取收样标签数据
|
||||
* 删除收样数据 tb_samples_device
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
SamplesManageAppVo getSampleLabelByQrCode(SamplesManageAppVo data);
|
||||
int delSamplesDetails(SamplesManageAppVo data);
|
||||
|
||||
/**
|
||||
* 删除收样数据 tb_samples
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
int delSamplesList(SamplesManageAppVo data);
|
||||
|
||||
/**
|
||||
* 修改收样数据 tb_samples
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
int updateSamplesList(SamplesManageAppVo data);
|
||||
|
||||
/**
|
||||
* 删除收样数据 tb_samples_device
|
||||
* 根据详情id
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
int delSamplesDetailsList(SamplesManageAppVo data);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,9 +18,10 @@ import java.util.List;
|
|||
public interface SelectAppDao {
|
||||
/**
|
||||
* 工器具下拉选
|
||||
* @param data
|
||||
* @return List<SamplesManageAppVo>
|
||||
*/
|
||||
List<SamplesManageAppVo> getToolsSelect();
|
||||
List<SamplesManageAppVo> getToolsSelect(SamplesManageAppVo data);
|
||||
|
||||
/**
|
||||
* 获取所有试验班组
|
||||
|
|
|
|||
|
|
@ -29,6 +29,11 @@ public class ParamsAppDto extends PageEntity {
|
|||
*/
|
||||
private String devTypeCode;
|
||||
|
||||
/**
|
||||
* 设备类型
|
||||
*/
|
||||
private String sampleDev;
|
||||
|
||||
/**
|
||||
* 送样日期
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -13,10 +13,9 @@ public interface HomeAppService {
|
|||
|
||||
/**
|
||||
* 代办任务数量
|
||||
* @param vo
|
||||
* @return
|
||||
*/
|
||||
Map<String, Object> getApprovalNum(HomeAppVo vo);
|
||||
Map<String, Object> getApprovalNum();
|
||||
|
||||
/**
|
||||
* 班组工作情况统计
|
||||
|
|
|
|||
|
|
@ -0,0 +1,36 @@
|
|||
package com.bonus.aqgqj.app.service;
|
||||
|
||||
import com.bonus.aqgqj.app.entity.ExperimentalAppVo;
|
||||
import com.bonus.aqgqj.app.entity.ExperimentalDetailAppVo;
|
||||
import com.bonus.aqgqj.app.entity.dto.ParamsAppDto;
|
||||
import com.bonus.aqgqj.basis.entity.dto.ParamsDto;
|
||||
import com.bonus.aqgqj.basis.entity.vo.ExperimentalDetailVo;
|
||||
import com.bonus.aqgqj.basis.entity.vo.ExperimentalVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @description App原始记录
|
||||
* @author hay
|
||||
* @date 2024/8/8 13:47
|
||||
*/
|
||||
public interface PrimaryDataAppService {
|
||||
|
||||
/**
|
||||
* 原始数据列表
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
List<ExperimentalAppVo> getList(ParamsAppDto data);
|
||||
|
||||
/**
|
||||
* 试验详情列表
|
||||
*
|
||||
* @param data
|
||||
* @return List<ExperimentalDetailVo>
|
||||
* @author cwchen
|
||||
* @date 2024/7/20 13:26
|
||||
*/
|
||||
List<ExperimentalDetailAppVo> getDetailList(ParamsAppDto data);
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
package com.bonus.aqgqj.app.service;
|
||||
|
||||
|
||||
import com.bonus.aqgqj.app.entity.SamplesManageAppVo;
|
||||
import com.bonus.aqgqj.system.vo.dto.SelectDto;
|
||||
import com.bonus.aqgqj.utils.ServerResponse;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author hay
|
||||
* 二维码扫描
|
||||
*/
|
||||
public interface QrCodeService {
|
||||
|
||||
/**
|
||||
* 收样标签 信息获取
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
SamplesManageAppVo getSampleLabelByQrCode(SamplesManageAppVo data);
|
||||
|
||||
}
|
||||
|
|
@ -53,9 +53,23 @@ public interface SamplesManageAppService {
|
|||
SamplesManageAppVo getSampleLabelData(SamplesManageAppVo data);
|
||||
|
||||
/**
|
||||
* 收样标签 信息获取
|
||||
* 删除收样列表数据
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
SamplesManageAppVo getSampleLabelByQrCode(SamplesManageAppVo data);
|
||||
ServerResponse delSamplesList(SamplesManageAppVo data);
|
||||
|
||||
/**
|
||||
* 修改收样列表数据
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
ServerResponse updateSamplesList(SamplesManageAppVo data);
|
||||
|
||||
/**
|
||||
* 删除收样详情数据
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
ServerResponse delSamplesDetails(SamplesManageAppVo data);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,10 +16,10 @@ public interface SelectAppService {
|
|||
|
||||
/**
|
||||
* 获取工器具下拉选
|
||||
* @param
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
List<SamplesManageAppVo> getToolsSelect();
|
||||
List<SamplesManageAppVo> getToolsSelect(SamplesManageAppVo data);
|
||||
|
||||
/**
|
||||
* 获取试验班组下拉选
|
||||
|
|
|
|||
|
|
@ -31,10 +31,10 @@ public class HomeAppServiceImpl implements HomeAppService {
|
|||
* 获取代办任务数量
|
||||
*/
|
||||
@Override
|
||||
public Map<String, Object> getApprovalNum(HomeAppVo vo) {
|
||||
public Map<String, Object> getApprovalNum() {
|
||||
Map<String, Object> map=new HashMap<>();
|
||||
try{
|
||||
List<HomeAppVo> list=dao.getApprovalNum(vo);
|
||||
List<HomeAppVo> list=dao.getApprovalNum();
|
||||
HomeAppVo hvo=list.get(0);
|
||||
map.put("data",hvo);
|
||||
map.put("code","200");
|
||||
|
|
|
|||
|
|
@ -0,0 +1,76 @@
|
|||
package com.bonus.aqgqj.app.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.bonus.aqgqj.app.dao.PrimaryDataAppDao;
|
||||
import com.bonus.aqgqj.app.entity.ExperimentalAppVo;
|
||||
import com.bonus.aqgqj.app.entity.ExperimentalDetailAppVo;
|
||||
import com.bonus.aqgqj.app.entity.dto.ParamsAppDto;
|
||||
import com.bonus.aqgqj.app.service.PrimaryDataAppService;
|
||||
import com.bonus.aqgqj.basis.entity.dto.ParamsDto;
|
||||
import com.bonus.aqgqj.basis.entity.vo.ExperimentalDetailVo;
|
||||
import com.bonus.aqgqj.basis.entity.vo.ExperimentalVo;
|
||||
import com.bonus.aqgqj.primaryData.dao.PrimaryDataDao;
|
||||
import com.bonus.aqgqj.primaryData.service.PrimaryDataService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @description App原始记录
|
||||
* @author hay
|
||||
* @date 2024/8/8 13:47
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class PrimaryDataAppServiceImpl implements PrimaryDataAppService {
|
||||
|
||||
|
||||
@Resource
|
||||
private PrimaryDataAppDao primaryDataAppDao;
|
||||
|
||||
|
||||
/**
|
||||
* 获取列表
|
||||
*/
|
||||
@Override
|
||||
public List<ExperimentalAppVo> getList(ParamsAppDto dto) {
|
||||
List<ExperimentalAppVo> list = new ArrayList<>();
|
||||
try {
|
||||
list = primaryDataAppDao.getList(dto);
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(), e);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ExperimentalDetailAppVo> getDetailList(ParamsAppDto dto) {
|
||||
List<ExperimentalDetailAppVo> list = new ArrayList<>();
|
||||
try {
|
||||
list = primaryDataAppDao.getDetailList(dto);
|
||||
if (CollectionUtils.isNotEmpty(list)) {
|
||||
for (ExperimentalDetailAppVo detailVo : list) {
|
||||
// 样品试验结果、样品数量、送样总数
|
||||
List<ExperimentalDetailAppVo.Sample> sampleList = new ArrayList<>();
|
||||
if (detailVo.getExperId() != null) {
|
||||
List<Map<String, String>> mapList = primaryDataAppDao.getExperDevItemsNum(detailVo.getExperId());
|
||||
JSONArray jsonArray = new JSONArray();
|
||||
jsonArray.addAll(mapList);
|
||||
sampleList = jsonArray.toJavaList(ExperimentalDetailAppVo.Sample.class);
|
||||
}
|
||||
detailVo.setSampleList(sampleList);
|
||||
detailVo.setSampleQuantity(sampleList.size());
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(), e);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,71 @@
|
|||
package com.bonus.aqgqj.app.service.impl;
|
||||
|
||||
import com.bonus.aqgqj.app.dao.QrCodeDao;
|
||||
import com.bonus.aqgqj.app.dao.SelectAppDao;
|
||||
import com.bonus.aqgqj.app.entity.ExperDeviceAppVo;
|
||||
import com.bonus.aqgqj.app.entity.SamplesManageAppVo;
|
||||
import com.bonus.aqgqj.app.service.QrCodeService;
|
||||
import com.bonus.aqgqj.app.service.SelectAppService;
|
||||
import com.bonus.aqgqj.base.entity.SelectEntity;
|
||||
import com.bonus.aqgqj.basis.entity.vo.ConfigItemsVo;
|
||||
import com.bonus.aqgqj.system.vo.dto.SelectDto;
|
||||
import com.bonus.aqgqj.utils.ServerResponse;
|
||||
import com.bonus.aqgqj.utils.StringHelper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author hay
|
||||
* 二维码扫描
|
||||
*/
|
||||
@Service("QrCodeService")
|
||||
@Slf4j
|
||||
public class QrCodeImpl implements QrCodeService {
|
||||
|
||||
@Resource(name = "QrCodeDao")
|
||||
private QrCodeDao dao;
|
||||
|
||||
|
||||
/**
|
||||
* 获取收样标签数据
|
||||
*/
|
||||
@Override
|
||||
public SamplesManageAppVo getSampleLabelByQrCode(SamplesManageAppVo data) {
|
||||
SamplesManageAppVo dto = new SamplesManageAppVo();
|
||||
//先判断customerCode是否为空
|
||||
if (StringHelper.isNotEmpty(data.getCustomerCode())){
|
||||
//将customerCode用/分割
|
||||
String[] customerCode = data.getCustomerCode().split("/");
|
||||
if ("sybq".equals(customerCode[0])){
|
||||
//收样标签
|
||||
data.setCustomerCode(customerCode[1]);
|
||||
dto = getSampleLabelData(data);
|
||||
}
|
||||
}else {
|
||||
throw new RuntimeException("customerCode不能为空");
|
||||
}
|
||||
return dto;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取收样标签数据
|
||||
*/
|
||||
private SamplesManageAppVo getSampleLabelData(SamplesManageAppVo data) {
|
||||
//查询详情数据
|
||||
SamplesManageAppVo dto = dao.getSampleLabelByQrCode(data);
|
||||
if (dto!=null){
|
||||
//查询试验项目
|
||||
data.setId(dto.getId());
|
||||
List<ConfigItemsVo> itemList = dao.getTestItemList(data);
|
||||
if (itemList.size()>0){
|
||||
dto.setConfigItemsVos(itemList);
|
||||
}
|
||||
}
|
||||
return dto;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -156,21 +156,69 @@ public class SamplesManageAppServiceImpl implements SamplesManageAppService {
|
|||
}
|
||||
|
||||
/**
|
||||
* 获取收样标签数据
|
||||
* 删除收样数据
|
||||
*/
|
||||
@Override
|
||||
public SamplesManageAppVo getSampleLabelByQrCode(SamplesManageAppVo data) {
|
||||
//查询详情数据
|
||||
SamplesManageAppVo dto = samplesManageAppDao.getSampleLabelByQrCode(data);
|
||||
if (dto!=null){
|
||||
//查询试验项目
|
||||
data.setId(dto.getId());
|
||||
List<ConfigItemsVo> itemList = samplesManageAppDao.getTestItemList(data);
|
||||
if (itemList.size()>0){
|
||||
dto.setConfigItemsVos(itemList);
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public ServerResponse delSamplesList(SamplesManageAppVo data) {
|
||||
//先判断id是否为空
|
||||
if (data.getId() != null){
|
||||
//获取登录人id
|
||||
Integer userId = Integer.parseInt(UserUtil.getLoginUser().getId().toString());
|
||||
data.setUpdateBy(userId);
|
||||
//先删除详情
|
||||
int res = samplesManageAppDao.delSamplesDetails(data);
|
||||
if (res>0){
|
||||
//再删除列表
|
||||
int res2 = samplesManageAppDao.delSamplesList(data);
|
||||
if (res2>0){
|
||||
return ServerResponse.createBySuccessMsg("删除成功");
|
||||
}else {
|
||||
throw new RuntimeException("收样单位信息表删除失败");
|
||||
}
|
||||
}else {
|
||||
throw new RuntimeException("收样设备信息表删除失败");
|
||||
}
|
||||
}else {
|
||||
throw new RuntimeException("未获取到数据");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改收样单位等信息
|
||||
*/
|
||||
@Override
|
||||
public ServerResponse updateSamplesList(SamplesManageAppVo data) {
|
||||
Integer userId = Integer.parseInt(UserUtil.getLoginUser().getId().toString());
|
||||
data.setUpdateBy(userId);
|
||||
int res = samplesManageAppDao.updateSamplesList(data);
|
||||
if (res>0){
|
||||
return ServerResponse.createBySuccessMsg("修改成功");
|
||||
}else {
|
||||
throw new RuntimeException("修改失败");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除收样设备信息 tb_sample_device
|
||||
*/
|
||||
@Override
|
||||
public ServerResponse delSamplesDetails(SamplesManageAppVo data) {
|
||||
//先判断id是否为空
|
||||
if (data.getId() != null) {
|
||||
//获取登录人id
|
||||
Integer userId = Integer.parseInt(UserUtil.getLoginUser().getId().toString());
|
||||
data.setUpdateBy(userId);
|
||||
//删除详情
|
||||
int res = samplesManageAppDao.delSamplesDetailsList(data);
|
||||
if (res > 0) {
|
||||
return ServerResponse.createBySuccessMsg("删除成功");
|
||||
} else {
|
||||
throw new RuntimeException("收样设备信息表删除失败");
|
||||
}
|
||||
} else {
|
||||
throw new RuntimeException("未获取到数据");
|
||||
}
|
||||
return dto;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -35,8 +35,8 @@ public class SelectServiceAppImpl implements SelectAppService {
|
|||
* 获取工器具下拉选
|
||||
*/
|
||||
@Override
|
||||
public List<SamplesManageAppVo> getToolsSelect() {
|
||||
return mapper.getToolsSelect();
|
||||
public List<SamplesManageAppVo> getToolsSelect(SamplesManageAppVo data) {
|
||||
return mapper.getToolsSelect(data);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.bonus.aqgqj.config;
|
||||
|
||||
import com.bonus.aqgqj.filter.OptionsRequestFilter;
|
||||
import com.bonus.aqgqj.filter.TokenFilter;
|
||||
import com.bonus.aqgqj.system.service.impl.UserDetailsServiceImpl;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
|
@ -39,6 +40,8 @@ public class BnsSecurityConfig extends WebSecurityConfigurerAdapter {
|
|||
private UserDetailsServiceImpl userDetailsService;
|
||||
@Autowired
|
||||
private TokenFilter tokenFilter;
|
||||
// @Autowired
|
||||
// private OptionsRequestFilter optionsRequestFilter;
|
||||
|
||||
@Bean
|
||||
public BCryptPasswordEncoder bCryptPasswordEncoder() {
|
||||
|
|
@ -52,7 +55,7 @@ public class BnsSecurityConfig extends WebSecurityConfigurerAdapter {
|
|||
http.sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS);
|
||||
http.authorizeRequests()
|
||||
.antMatchers("/", "/*.html", "/favicon.ico", "/css/**", "/js/**", "/fonts/**", "/layui/**", "/img/**"
|
||||
, "/webjars/**", "/pages/**",
|
||||
, "/webjars/**", "/pages/**","/login",
|
||||
"/statics/**","/websocketServer/**")
|
||||
.permitAll().anyRequest().authenticated();
|
||||
http.formLogin().loginProcessingUrl("/login")
|
||||
|
|
@ -62,6 +65,7 @@ public class BnsSecurityConfig extends WebSecurityConfigurerAdapter {
|
|||
// 解决不允许显示在iframe的问题
|
||||
http.headers().frameOptions().disable();
|
||||
http.headers().cacheControl();
|
||||
// http.addFilter(optionsRequestFilter);
|
||||
http.addFilterBefore(tokenFilter, UsernamePasswordAuthenticationFilter.class);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -27,7 +27,12 @@ public class WebMvcConfig implements WebMvcConfigurer {
|
|||
return new WebMvcConfigurer() {
|
||||
@Override
|
||||
public void addCorsMappings(CorsRegistry registry) {
|
||||
registry.addMapping("/**").allowedMethods("*");
|
||||
registry.addMapping("/**").allowedMethods("*");
|
||||
// registry.addMapping("/**")
|
||||
// .allowedOrigins("http://example.com")
|
||||
// .allowedMethods("GET", "POST", "PUT", "DELETE", "OPTIONS")
|
||||
// .allowedHeaders("*")
|
||||
// .allowCredentials(true);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,41 @@
|
|||
package com.bonus.aqgqj.filter;
|
||||
|
||||
import org.springframework.core.annotation.Order;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.servlet.*;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* @author 16043
|
||||
*/
|
||||
@Component
|
||||
@Order(1)
|
||||
public class OptionsRequestFilter implements Filter {
|
||||
|
||||
@Override
|
||||
public void init(FilterConfig filterConfig) throws ServletException {
|
||||
// TODO Auto-generated method stub
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void doFilter(ServletRequest req, ServletResponse res,
|
||||
FilterChain chain) throws IOException, ServletException {
|
||||
HttpServletResponse response = (HttpServletResponse) res;
|
||||
response.setHeader("Access-Control-Allow-Origin", "*");
|
||||
response.setHeader("Access-Control-Allow-Methods",
|
||||
"POST, GET, OPTIONS, DELETE");
|
||||
response.setHeader("Access-Control-Max-Age", "3600");
|
||||
response.setHeader("Access-Control-Allow-Headers",
|
||||
"Content-Type, x-requested-with, X-Custom-Header, Token,Authorization");
|
||||
chain.doFilter(req, res);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void destroy() {
|
||||
// TODO Auto-generated method stub
|
||||
}
|
||||
}
|
||||
|
|
@ -1,8 +1,7 @@
|
|||
package com.bonus.aqgqj.filter;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import java.util.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.FilterChain;
|
||||
|
|
@ -19,6 +18,7 @@ import lombok.extern.slf4j.Slf4j;
|
|||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.core.annotation.Order;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
|
||||
import org.springframework.security.core.context.SecurityContextHolder;
|
||||
|
|
@ -37,7 +37,7 @@ public class TokenFilter extends OncePerRequestFilter {
|
|||
|
||||
public static final String TOKEN_KEY = "token";
|
||||
|
||||
|
||||
public static final String HEAD_KEY = "Token";
|
||||
public static Boolean aqEnable;
|
||||
/**
|
||||
* 拦截的文件后缀
|
||||
|
|
@ -74,11 +74,23 @@ public class TokenFilter extends OncePerRequestFilter {
|
|||
@Override
|
||||
protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain)
|
||||
throws ServletException, IOException {
|
||||
String method= request.getMethod();
|
||||
if("options".equals(method.toLowerCase())){
|
||||
response.setHeader("Access-Control-Allow-Origin", "*");
|
||||
response.setHeader("Access-Control-Allow-Methods", "POST, GET, OPTIONS, DELETE");
|
||||
response.setHeader("Access-Control-Max-Age", "3600");
|
||||
response.setHeader("Access-Control-Allow-Headers", "Content-Type, x-requested-with, X-Custom-Header, Token,Authorization");
|
||||
UsernamePasswordAuthenticationToken authentication = new UsernamePasswordAuthenticationToken(new LoginUser(),
|
||||
null, null);
|
||||
SecurityContextHolder.getContext().setAuthentication(authentication);
|
||||
filterChain.doFilter(request, response);
|
||||
}else{
|
||||
Enumeration<String> headerNames= request.getHeaderNames();
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
String uri=request.getRequestURI();
|
||||
String token = getToken(request);
|
||||
Boolean isYq=setErrorSpore(response,token,uri,request);//页面越权校验
|
||||
|
||||
Boolean isConfig= setSystemConfig(response,request);//系统配置验证
|
||||
Boolean isYq=setErrorSpore(response,token,uri,request);
|
||||
Boolean isConfig= setSystemConfig(response,request);
|
||||
if(isConfig){
|
||||
System.err.println("越权了");
|
||||
log.info("配置校验{}",isConfig);
|
||||
|
|
@ -103,7 +115,7 @@ public class TokenFilter extends OncePerRequestFilter {
|
|||
}
|
||||
filterChain.doFilter(request, response);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -164,7 +176,12 @@ public class TokenFilter extends OncePerRequestFilter {
|
|||
return false;
|
||||
}
|
||||
}
|
||||
if(StringHelper.isNotEmpty(token)){//包含token
|
||||
|
||||
//包含token
|
||||
if(StringHelper.isNotEmpty(token)){
|
||||
if(url.contains("/app/")){
|
||||
return false;
|
||||
}
|
||||
String roid=JwtHelper.getRoleId(token);
|
||||
List<SysMenuVo> menus=menuService.getUserMenuList( "1",roid,url);
|
||||
for (SysMenuVo menu:menus) {
|
||||
|
|
@ -307,8 +324,8 @@ public class TokenFilter extends OncePerRequestFilter {
|
|||
*/
|
||||
public static String getToken(HttpServletRequest request) {
|
||||
String token = request.getParameter(TOKEN_KEY);
|
||||
if (StringUtils.isBlank(token)) {
|
||||
token = request.getHeader(TOKEN_KEY);
|
||||
if (StringUtils.isEmpty(token)) {
|
||||
token = request.getHeader(HEAD_KEY);
|
||||
}
|
||||
|
||||
return token;
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ public class TokenServiceImpl implements TokenService {
|
|||
// 登陆日志
|
||||
// logService.save(loginUser.getId(), "登陆", true, null);
|
||||
|
||||
return new Token(token, loginUser.getLoginTime());
|
||||
return new Token(token, loginUser.getLoginTime(),200);
|
||||
}
|
||||
|
||||
private void cacheLoginUser(LoginUser loginUser) {
|
||||
|
|
|
|||
|
|
@ -17,10 +17,13 @@ public class Token implements Serializable {
|
|||
/** 登陆时间戳(毫秒) */
|
||||
private Long loginTime;
|
||||
|
||||
public Token(String token, Long loginTime) {
|
||||
private Integer code;
|
||||
|
||||
public Token(String token, Long loginTime, Integer code) {
|
||||
super();
|
||||
this.token = token;
|
||||
this.loginTime = loginTime;
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public String getToken() {
|
||||
|
|
@ -39,4 +42,11 @@ public class Token implements Serializable {
|
|||
this.loginTime = loginTime;
|
||||
}
|
||||
|
||||
public Integer getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public void setCode(Integer code) {
|
||||
this.code = code;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ public class ResponseUtil {
|
|||
public static void responseJson(HttpServletResponse response, int status, Object data) {
|
||||
try {
|
||||
response.setHeader("Access-Control-Allow-Origin", "*");
|
||||
response.setHeader("Access-Control-Allow-Methods", "*");
|
||||
response.setHeader("Access-Control-Allow-Methods", "POST, GET, OPTIONS");
|
||||
response.setContentType("application/json;charset=UTF-8");
|
||||
response.setStatus(status);
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,82 @@
|
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.bonus.aqgqj.app.dao.PrimaryDataAppDao">
|
||||
|
||||
<select id="getList" resultType="com.bonus.aqgqj.app.entity.ExperimentalAppVo">
|
||||
SELECT ts.id,
|
||||
tc.custom_name AS customName,
|
||||
IFNULL(tsd.num,0) AS customNum,
|
||||
tsd.sampleDev,
|
||||
su.user_name AS sampleUserName,
|
||||
tt.team_name AS teamName,
|
||||
te.exper_time AS experTime
|
||||
FROM tb_sample ts
|
||||
LEFT JOIN tb_custom tc ON ts.custom_id = tc.id
|
||||
LEFT JOIN sys_user su ON ts.create_user = su.id AND su.del_flag = 0
|
||||
LEFT JOIN sys_user su2 ON ts.update_user = su2.id AND su2.del_flag = 0
|
||||
LEFT JOIN tb_team tt ON ts.team_id = tt.id AND tt.del_flag = 0
|
||||
LEFT JOIN tb_exper te on ts.id = te.sample_id AND te.del_flag = 0
|
||||
LEFT JOIN (
|
||||
SELECT sample_id,COUNT(sample_id) AS num,ANY_VALUE(GROUP_CONCAT(DISTINCT dev_type_name)) AS sampleDev,ANY_VALUE(GROUP_CONCAT(DISTINCT dev_type_code)) AS sampleDevCode
|
||||
FROM tb_sample_device
|
||||
WHERE del_falg = 0
|
||||
GROUP BY sample_id
|
||||
) tsd ON tsd.sample_id = ts.id
|
||||
WHERE ts.del_flag = 0 and ts.process_status = 4 and ts.audti_status = 1
|
||||
<if test="keyWord != null and keyWord!=''">
|
||||
AND (
|
||||
tc.custom_name LIKE CONCAT('%',#{keyWord},'%') OR
|
||||
tt.team_name LIKE CONCAT('%',#{keyWord},'%')
|
||||
)
|
||||
</if>
|
||||
<if test="sampleDev != null and sampleDev!=''">
|
||||
AND tsd.sampleDev like CONCAT('%',#{sampleDev},'%')
|
||||
</if>
|
||||
<if test="startTime != null and endTime!=''">
|
||||
AND DATE_FORMAT(te.exper_time, '%Y-%m-%d') BETWEEN #{startTime} AND #{endTime}
|
||||
</if>
|
||||
<if test="roleCode != 'administrators'">
|
||||
<if test="roleCode == 'experimentalTeamMember' and teamId != null">
|
||||
AND ts.team_id = #{teamId}
|
||||
</if>
|
||||
<if test="(roleCode != 'experimentalTeamMember') or (roleCode == 'experimentalTeamMember' and teamId == null)">
|
||||
AND ts.team_id = -1
|
||||
</if>
|
||||
</if>
|
||||
ORDER BY dispatch_time ASC
|
||||
</select>
|
||||
|
||||
<!--试验详情列表-->
|
||||
<select id="getDetailList" resultType="com.bonus.aqgqj.app.entity.ExperimentalDetailAppVo">
|
||||
SELECT * FROM (
|
||||
SELECT ANY_VALUE(tsd.sample_id) AS sampleId,
|
||||
ANY_VALUE(tsd.dev_type_name) AS devTypeName,
|
||||
tsd.dev_type_code AS devTypeCode,
|
||||
GROUP_CONCAT(DISTINCT tsd.dev_module SEPARATOR '、' ) as devModule,
|
||||
ANY_VALUE(te.id) AS experId,
|
||||
COUNT(tsd.dev_type_code) AS sampleNum,
|
||||
ANY_VALUE(te.audit_remakr) AS causeOfRejection,
|
||||
ANY_VALUE(su2.user_name) AS experimenter,
|
||||
ANY_VALUE(DATE_FORMAT(te.update_time, '%Y-%m-%d')) AS testTime
|
||||
FROM tb_sample_device tsd
|
||||
LEFT JOIN tb_exper te ON tsd.sample_id = te.sample_id AND tsd.dev_type_code = te.dev_type_code AND te.del_flag = 0
|
||||
LEFT JOIN sys_user su2 ON te.update_user = su2.id AND su2.del_flag = 0
|
||||
WHERE tsd.sample_id = #{id} AND tsd.del_falg = 0 and te.`status` = 4 and te.audit_status = 1
|
||||
<if test="devTypeCode != null and devTypeCode!=''">
|
||||
AND INSTR(tsd.dev_type_code,#{devTypeCode})
|
||||
</if>
|
||||
GROUP BY tsd.dev_type_code
|
||||
)a
|
||||
ORDER BY a.testTime DESC
|
||||
</select>
|
||||
|
||||
<!--查询试验设备数量-->
|
||||
<select id="getExperDevItemsNum" resultType="java.util.Map">
|
||||
SELECT dev_code AS devCode,
|
||||
case is_hg WHEN '1' THEN '不合格'
|
||||
WHEN '0' THEN '合格'
|
||||
ELSE '不合格' END AS testResult
|
||||
FROM tb_exper_dev
|
||||
WHERE exper_id = #{experId}
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,47 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.bonus.aqgqj.app.dao.QrCodeDao">
|
||||
|
||||
<select id="getTestItemList" resultType="com.bonus.aqgqj.basis.entity.vo.ConfigItemsVo">
|
||||
SELECT
|
||||
tei.id,
|
||||
tei.exper_type_name AS experTypeName,
|
||||
tei.amount
|
||||
FROM
|
||||
tb_exper_items tei
|
||||
LEFT JOIN tb_exper te on te.id=tei.exper_id and te.del_flag=0
|
||||
LEFT JOIN tb_sample ts on ts.id=te.sample_id and ts.del_flag=0
|
||||
LEFT JOIN tb_sample_device tsd on tsd.sample_id=ts.id and tsd.del_falg=0
|
||||
WHERE
|
||||
tsd.id=#{id}
|
||||
</select>
|
||||
|
||||
<select id="getSampleLabelByQrCode" resultType="com.bonus.aqgqj.app.entity.SamplesManageAppVo">
|
||||
SELECT
|
||||
tsd.id,
|
||||
ts.sample_user as sampleUser,
|
||||
ts.sample_time as sampleTime,
|
||||
tsd.department_id as departmentId,
|
||||
tcs.custom_name as sampleDepartment,
|
||||
te.submit_location as submitLocation,
|
||||
sd.id as sampleToolsId,
|
||||
tsd.dev_type_name as sampleTools,
|
||||
tsd.dev_module as devModule,
|
||||
tsd.dev_code as devCode,
|
||||
ts.process_status as processStatus,
|
||||
ts.custom_id as customId,
|
||||
tc.custom_name as customName
|
||||
FROM
|
||||
tb_sample_device tsd
|
||||
LEFT JOIN tb_sample ts on ts.id=tsd.sample_id and ts.del_flag=0
|
||||
LEFT JOIN tb_custom tc on tc.id=ts.custom_id and tc.del_flag=0
|
||||
LEFT JOIN tb_exper te on te.sample_id=ts.id and te.del_flag=0
|
||||
left join tb_custom tcs on tcs.id=tsd.department_id and tcs.del_flag=0
|
||||
left join sys_distinct sd on sd.dict_name=tsd.dev_type_name and sd.del_flag=0
|
||||
WHERE
|
||||
tsd.customer_code=#{customerCode}
|
||||
and tsd.del_falg=0
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
|
@ -50,11 +50,44 @@
|
|||
update_user=#{updateBy}
|
||||
WHERE id = #{id}
|
||||
</update>
|
||||
<update id="delSamplesDetails">
|
||||
UPDATE tb_sample_device
|
||||
SET del_falg = '1',
|
||||
update_time = NOW(),
|
||||
update_user = #{updateBy}
|
||||
WHERE sample_id = #{id}
|
||||
</update>
|
||||
<update id="delSamplesList">
|
||||
UPDATE tb_sample
|
||||
SET del_flag = '1',
|
||||
update_time = NOW(),
|
||||
update_user = #{updateBy}
|
||||
WHERE id = #{id}
|
||||
</update>
|
||||
<update id="updateSamplesList">
|
||||
UPDATE tb_sample
|
||||
SET custom_id = #{customId},
|
||||
custom_name = #{customName},
|
||||
sample_user = #{sampleUser},
|
||||
sample_time = #{sampleTime},
|
||||
update_time = NOW(),
|
||||
update_user = #{updateBy}
|
||||
WHERE id = #{id}
|
||||
</update>
|
||||
<delete id="delSamplesDetailsList">
|
||||
UPDATE tb_sample_device
|
||||
SET del_falg = '1',
|
||||
update_time = NOW(),
|
||||
update_user = #{updateBy}
|
||||
WHERE id = #{id}
|
||||
</delete>
|
||||
|
||||
<select id="list" resultType="com.bonus.aqgqj.app.entity.SamplesManageAppVo">
|
||||
select
|
||||
ts.id,
|
||||
ts.custom_id AS customId,
|
||||
tc.custom_name AS customName,
|
||||
ts.sample_user as sampleUser,
|
||||
ts.sample_time AS sampleTime,
|
||||
ts.batch_code AS batchCode,
|
||||
tt.team_name AS teamName,
|
||||
|
|
@ -182,22 +215,4 @@
|
|||
WHERE batch_code = #{batchCode}
|
||||
and del_flag = 0
|
||||
</select>
|
||||
<select id="getSampleLabelByQrCode" resultType="com.bonus.aqgqj.app.entity.SamplesManageAppVo">
|
||||
SELECT
|
||||
tsd.id,
|
||||
te.submit_location as submitLocation,
|
||||
tsd.dev_type_name as sampleTools,
|
||||
tsd.dev_module as devModule,
|
||||
tsd.dev_code as devCode,
|
||||
ts.process_status as processStatus,
|
||||
tc.custom_name as customName
|
||||
FROM
|
||||
tb_sample_device tsd
|
||||
LEFT JOIN tb_sample ts on ts.id=tsd.sample_id and ts.del_flag=0
|
||||
LEFT JOIN tb_custom tc on tc.id=ts.custom_id and tc.del_flag=0
|
||||
LEFT JOIN tb_exper te on te.sample_id=ts.id and te.del_flag=0
|
||||
WHERE
|
||||
tsd.customer_code=#{customerCode}
|
||||
and tsd.del_falg=0
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
@ -11,6 +11,9 @@
|
|||
where
|
||||
p_id = 92
|
||||
and del_flag = 0
|
||||
<if test="keyWord != null and keyWord!=''">
|
||||
and dict_name like concat('%',#{keyWord},'%')
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="getTestTeamSelected" resultType="com.bonus.aqgqj.app.entity.SamplesManageAppVo">
|
||||
|
|
|
|||
Loading…
Reference in New Issue