Browse Source

盘库,巡检接口修改

master
hanlinghao 3 years ago
parent
commit
8850b9ba89
  1. 6
      anrui-portal/anrui-portal-biz/src/main/java/com/yxt/anrui/portal/biz/sysstaffinfo/SysStaffinfoService.java
  2. 2
      anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmvehicleinventory/AppScmVehicleCarInventoryListPageQuery.java
  3. 4
      anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmvehiclepatrolinspection/AppScmVehiclePatrolinspectionPageVo.java
  4. 2
      anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmvehiclepatrolinspectionsheet/AppScmVehiclePatrolinspectionsheetInfoVo.java
  5. 5
      anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmvehiclestayinventory/AppScmVehicleStayInventoryListPageVo.java
  6. 2
      anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmvehiclestaypatrolinspection/AppScmVehicleStayPatrolinspectionPageQuery.java
  7. 3
      anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmvehiclestaypatrolinspection/AppScmVehicleStayPatrolinspectionPageVo.java
  8. 5
      anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmvehiclegression/ScmVehicleGressionService.java
  9. 8
      anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmvehicleinventory/ScmVehicleInventoryMapper.java
  10. 4
      anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmvehicleinventory/ScmVehicleInventoryMapper.xml
  11. 10
      anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmvehicleinventory/ScmVehicleInventoryService.java
  12. 4
      anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmvehiclepatrolinspection/ScmVehiclePatrolinspectionMapper.xml
  13. 3
      anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmvehiclepatrolinspectionsheet/ScmVehiclePatrolinspectionsheetMapper.xml
  14. 38
      anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmvehiclepatrolinspectionsheet/ScmVehiclePatrolinspectionsheetService.java
  15. 2
      anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmvehiclestayinventory/ScmVehicleStayInventoryMapper.java
  16. 14
      anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmvehiclestayinventory/ScmVehicleStayInventoryMapper.xml
  17. 21
      anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmvehiclestayinventory/ScmVehicleStayInventoryService.java
  18. 10
      anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmvehiclestaypatrolinspection/ScmVehicleStayPatrolinspectionMapper.java
  19. 23
      anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmvehiclestaypatrolinspection/ScmVehicleStayPatrolinspectionMapper.xml
  20. 18
      anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmvehiclestaypatrolinspection/ScmVehicleStayPatrolinspectionService.java
  21. 4
      anrui-terminal/anrui-terminal-api/src/main/java/com/yxt/anrui/terminal/api/supplychain/inspection/PatrolinspectionDto.java
  22. 2
      anrui-terminal/anrui-terminal-api/src/main/java/com/yxt/anrui/terminal/api/supplychain/inspection/StayPatrolinspectionPageQuery.java
  23. 2
      anrui-terminal/anrui-terminal-api/src/main/java/com/yxt/anrui/terminal/api/supplychain/inventory/CarInventoryListPageQuery.java

6
anrui-portal/anrui-portal-biz/src/main/java/com/yxt/anrui/portal/biz/sysstaffinfo/SysStaffinfoService.java

@ -210,7 +210,7 @@ public class SysStaffinfoService extends MybatisBaseService<SysStaffinfoMapper,
public ResultBean saveStaffInfo(SysStaffinfoDto dto) {
ResultBean rb = ResultBean.fireFail();
SysRoleVo sysRoleVo = sysRoleService.fetchByName("试用期员工");
if (sysRoleVo == null){
if (sysRoleVo == null) {
return rb.setMsg("缺少默认试用期员工角色");
}
//员工类型
@ -251,7 +251,7 @@ public class SysStaffinfoService extends MybatisBaseService<SysStaffinfoMapper,
return rb.setMsg("员工岗位信息不能为空");
}
Date joinCompnyDate = dto.getJoinCompnyDate();
if (joinCompnyDate == null){
if (joinCompnyDate == null) {
return rb.setMsg("员工入职日期不能为空");
}
//添加员工基础信息
@ -606,7 +606,7 @@ public class SysStaffinfoService extends MybatisBaseService<SysStaffinfoMapper,
}
}
if (StringUtils.isNotBlank(params.getName())) {
qw.like("si.name", params.getName());
}
}
IPage<AppSysStaffVo> pagging = baseMapper.getUserList(page, qw, orgSid);

2
anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmvehicleinventory/AppScmVehicleCarInventoryListPageQuery.java

@ -12,7 +12,7 @@ public class AppScmVehicleCarInventoryListPageQuery implements Query {
private String userSid;
@ApiModelProperty("优先匹配车架号 盘库人员")
private String names;
private String name;
@ApiModelProperty("时间段 示例 2020-02-01至2022-03-31")
private String date;

4
anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmvehiclepatrolinspection/AppScmVehiclePatrolinspectionPageVo.java

@ -14,10 +14,10 @@ public class AppScmVehiclePatrolinspectionPageVo implements Vo {
@ApiModelProperty("车架号")
private String vin;
@ApiModelProperty("上次巡检日期")
@ApiModelProperty("最新巡检日期")
private String newInspectionDate;
@ApiModelProperty("上次巡检人员")
@ApiModelProperty("最新巡检人员")
private String newInspectionName;
@ApiModelProperty("存放地点")

2
anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmvehiclepatrolinspectionsheet/AppScmVehiclePatrolinspectionsheetInfoVo.java

@ -9,6 +9,8 @@ import java.util.List;
@Data
public class AppScmVehiclePatrolinspectionsheetInfoVo implements Vo {
private String sid;
@ApiModelProperty("记录sid")
private String recordSid;

5
anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmvehiclestayinventory/AppScmVehicleStayInventoryListPageVo.java

@ -4,9 +4,14 @@ import com.yxt.common.core.vo.Vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
@Data
public class AppScmVehicleStayInventoryListPageVo implements Vo {
@ApiModelProperty("id")
private String id;
@ApiModelProperty("sid")
private String sid;

2
anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmvehiclestaypatrolinspection/AppScmVehicleStayPatrolinspectionPageQuery.java

@ -11,7 +11,7 @@ public class AppScmVehicleStayPatrolinspectionPageQuery implements Query {
private String userSid;
@ApiModelProperty("优先匹配车架号 存放地点 巡检人员")
private String names;
private String name;
@ApiModelProperty("存放地点 “”/null 全部 有值时只查询当前存放地点的记录")
private String warehouseSid;

3
anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmvehiclestaypatrolinspection/AppScmVehicleStayPatrolinspectionPageVo.java

@ -7,6 +7,9 @@ import lombok.Data;
@Data
public class AppScmVehicleStayPatrolinspectionPageVo implements Vo {
@ApiModelProperty("id")
private String id;
@ApiModelProperty("sid")
private String sid;

5
anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmvehiclegression/ScmVehicleGressionService.java

@ -265,6 +265,9 @@ public class ScmVehicleGressionService extends MybatisBaseService<ScmVehicleGres
if (StringUtils.isBlank(dto.getVinNo())) {
return rb.setMsg("请选择车架号!");
}
if (dto.getLocationSid().equals(dto.getTargetLocationSid())) {
return rb.setMsg("目标存放地点不能与先存放地点重复!");
}
String s1 = "";
String type = "04";
String userSid = dto.getUserSid();
@ -301,6 +304,8 @@ public class ScmVehicleGressionService extends MybatisBaseService<ScmVehicleGres
scmFile.setLinkSid(scmVehicleGression.getSid());
scmFileService.save(scmFile);
}
} else {
scmFileService.deleteByLinkSidAndType(scmVehicleGression.getSid(), type);
}
} else {
scmVehicleGression = fetchBySid(dto.getSid());

8
anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmvehicleinventory/ScmVehicleInventoryMapper.java

@ -70,10 +70,10 @@ public interface ScmVehicleInventoryMapper extends BaseMapper<ScmVehicleInventor
*
* @param page
* @param qw
* @param names
* @param name
* @return
*/
IPage<AppScmVehicleCarInventoryListPageVo> getCarInventoryList(IPage<AppScmVehicleCarInventoryListPageQuery> page, @Param(Constants.WRAPPER) QueryWrapper<AppScmVehicleCarInventoryListPageVo> qw, @Param("names") String names);
IPage<AppScmVehicleCarInventoryListPageVo> getCarInventoryList(IPage<AppScmVehicleCarInventoryListPageQuery> page, @Param(Constants.WRAPPER) QueryWrapper<AppScmVehicleCarInventoryListPageVo> qw, @Param("name") String name);
/**
* 手机端-初始化盘库操作
@ -92,7 +92,7 @@ public interface ScmVehicleInventoryMapper extends BaseMapper<ScmVehicleInventor
AppScmVehicleStayInventoryDetailedsVo getInventoryInfo(@Param("recordSid") String recordSid);
@Update("update scm_vehicle_inventory set InventoryStateKey = #{inventoryStateKey},InventoryState = #{inventoryState},certificateKey = #{certificateKey},certificate = #{certificate},remarks = #{remarks} where sid = #{sid}")
void updateState(@Param("sid") String sid, @Param("inventoryStateKey") String inventoryStateKey, @Param("inventoryState") String inventoryState,@Param("certificateKey") String certificateKey,@Param("certificate") String certificate,@Param("remarks") String remarks);
void updateState(@Param("sid") String sid, @Param("inventoryStateKey") String inventoryStateKey, @Param("inventoryState") String inventoryState, @Param("certificateKey") String certificateKey, @Param("certificate") String certificate, @Param("remarks") String remarks);
List<ScmVehicleInventory> getByVinLastInFo(@Param("vin") String vin,@Param("id") String id);
List<ScmVehicleInventory> getByVinLastInFo(@Param("vin") String vin, @Param("id") String id);
}

4
anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmvehicleinventory/ScmVehicleInventoryMapper.xml

@ -30,8 +30,8 @@
scm_vehicle_inventory svi
<where>
${ew.sqlSegment}
<if test="names != '' and names != null ">
and concat(svi.mainSid,svi.InventoryName) LIKE concat('%', #{names}, '%')
<if test="name != '' and name != null ">
and concat(svi.mainSid,svi.InventoryName) LIKE concat('%', #{name}, '%')
</if>
</where>
ORDER BY id DESC

10
anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmvehicleinventory/ScmVehicleInventoryService.java

@ -154,7 +154,13 @@ public class ScmVehicleInventoryService extends MybatisBaseService<ScmVehicleInv
}
QueryWrapper<AppScmVehicleCarInventoryListPageVo> qw = appCarQueryWrapper(pagerQuery.getParams());
AppScmVehicleCarInventoryListPageQuery params = pagerQuery.getParams();
IPage<AppScmVehicleCarInventoryListPageVo> iPage = baseMapper.getCarInventoryList(page, qw, params.getNames());
IPage<AppScmVehicleCarInventoryListPageVo> iPage = baseMapper.getCarInventoryList(page, qw, params.getName());
List<AppScmVehicleCarInventoryListPageVo> records = iPage.getRecords();
for (AppScmVehicleCarInventoryListPageVo record : records) {
if ("2".equals(record.getState())) {
record.setShowUpdataBtn(true);
}
}
return iPage;
}
@ -170,7 +176,7 @@ public class ScmVehicleInventoryService extends MybatisBaseService<ScmVehicleInv
qw.eq("svi.createOrgSid", query.getUseOrgSid());
}
if (StringUtils.isNotBlank(query.getWarehouseSid())) {
qw.eq("svi.location", query.getWarehouseSid());
qw.eq("svi.locationSid", query.getWarehouseSid());
}
if (StringUtils.isNotBlank(query.getState())) {
qw.eq("svi.InventoryStateKey", query.getState());

4
anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmvehiclepatrolinspection/ScmVehiclePatrolinspectionMapper.xml

@ -20,7 +20,9 @@
SELECT
sid,
mainSid as vin,
location as warehouse
location as warehouse,
patrolInspectionDate as newInspectionDate,
patrolInspectionName as newInspectionName
FROM
scm_vehicle_patrolinspection svp
<where>

3
anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmvehiclepatrolinspectionsheet/ScmVehiclePatrolinspectionsheetMapper.xml

@ -17,7 +17,8 @@
<select id="getInspection"
resultType="com.yxt.anrui.scm.api.scmvehiclepatrolinspectionsheet.AppScmVehiclePatrolinspectionsheetInfoVo">
SELECT patrolInspectionSid as recordSid,
SELECT sid,
patrolInspectionSid as recordSid,
mainSid as vin,
model,
situationExplain as `explain`,

38
anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmvehiclepatrolinspectionsheet/ScmVehiclePatrolinspectionsheetService.java

@ -28,7 +28,9 @@ package com.yxt.anrui.scm.biz.scmvehiclepatrolinspectionsheet;
import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yxt.anrui.portal.api.sysstafforg.SysStaffOrg;
import com.yxt.anrui.portal.api.sysstafforg.SysStaffOrgFeign;
import com.yxt.anrui.portal.api.sysuser.SysUserFeign;
import com.yxt.anrui.scm.api.scmfile.ScmFile;
import com.yxt.anrui.scm.api.scmvehiclepatrolinspection.ScmVehiclePatrolinspection;
import com.yxt.anrui.scm.api.scmvehiclepatrolinspectionsheet.*;
@ -80,6 +82,8 @@ public class ScmVehiclePatrolinspectionsheetService extends MybatisBaseService<S
ScmVehicleStayPatrolinspectionService scmVehicleStayPatrolinspectionService;
@Autowired
SysStaffOrgFeign sysStaffOrgFeign;
@Autowired
SysUserFeign sysUserFeign;
private QueryWrapper<ScmVehiclePatrolinspectionsheet> createQueryWrapper(ScmVehiclePatrolinspectionsheetQuery query) {
// todo: 这里根据具体业务调整查询条件
@ -143,13 +147,19 @@ public class ScmVehiclePatrolinspectionsheetService extends MybatisBaseService<S
AppScmVehiclePatrolinspectionsheetInfoVo appScmVehiclePatrolinspectionsheetInfoVo = new AppScmVehiclePatrolinspectionsheetInfoVo();
List<String> stringList = new ArrayList<>();
appScmVehiclePatrolinspectionsheetInfoVo.setImages(stringList);
appScmVehiclePatrolinspectionsheetInfoVo.setRecordSid(recordSid);
return appScmVehiclePatrolinspectionsheetInfoVo;
}
List<ScmFile> scmFiles1 = scmFileService.selectByLinkSid(recordSid, type1);
for (ScmFile scmFile : scmFiles1) {
images.add(fileUploadComponent.getUrlPrefix() + scmFile.getFilePath());
List<ScmFile> scmFiles1 = scmFileService.selectByLinkSid(vo.getSid(), type1);
if (scmFiles1.size() > 0) {
for (ScmFile scmFile : scmFiles1) {
images.add(fileUploadComponent.getUrlPrefix() + scmFile.getFilePath());
}
vo.setImages(images);
} else {
vo.setImages(images);
}
vo.setImages(images);
vo.setRecordSid(recordSid);
return vo;
}
@ -164,11 +174,15 @@ public class ScmVehiclePatrolinspectionsheetService extends MybatisBaseService<S
ResultBean rb = ResultBean.fireFail();
String s1 = "";
String type1 = "06"; //巡检相关照片
ScmVehiclePatrolinspectionsheet scmVehiclePatrolinspectionsheet = new ScmVehiclePatrolinspectionsheet();
String patrolInspectionSid = dto.getPatrolInspectionSid();
ScmVehiclePatrolinspectionsheetDetailsVo pcInspection = baseMapper.getPCInspection(patrolInspectionSid);
BeanUtil.copyProperties(dto, scmVehiclePatrolinspectionsheet, "sid");
ScmVehiclePatrolinspectionsheetDetailsVo pcInspection = baseMapper.getPCInspection(dto.getPatrolInspectionSid());
String sid = scmVehiclePatrolinspectionsheet.getSid();
String useOrgSid = sysStaffOrgFeign.getPathSidByUserSid(dto.getUserSid()).getData();
if (pcInspection != null) {
dto.setCreateOrgSid(useOrgSid);
int i = updateBySid(dto, dto.getSid());
@ -190,7 +204,6 @@ public class ScmVehiclePatrolinspectionsheetService extends MybatisBaseService<S
}
return rb.success().setMsg("操作成功");
}
BeanUtil.copyProperties(dto, scmVehiclePatrolinspectionsheet);
scmVehiclePatrolinspectionsheet.setCreateOrgSid(useOrgSid);
scmVehiclePatrolinspectionsheet.setSid(sid);
scmFileService.deleteByLinkSidAndType(scmVehiclePatrolinspectionsheet.getSid(), type1);
@ -222,8 +235,11 @@ public class ScmVehiclePatrolinspectionsheetService extends MybatisBaseService<S
String s1 = "";
String type1 = "06"; //巡检相关照片
String patrolInspectionSid = dto.getPatrolInspectionSid();
String newTime = new SimpleDateFormat("yyyy-MM-dd").format(new Date());
ScmVehiclePatrolinspectionsheetDetailsVo pcInspection = baseMapper.getPCInspection(patrolInspectionSid);
String useOrgSid = sysStaffOrgFeign.getPathSidByUserSid(dto.getUserSid()).getData();
String staffSid = sysUserFeign.getUserOrgInfoByUserSid(dto.getUserSid()).getData().getStaffSid();
SysStaffOrg data = sysStaffOrgFeign.getOrgByStaffSid(staffSid).getData();
if (pcInspection != null) {
dto.setCreateOrgSid(useOrgSid);
int i = updateBySid(dto, dto.getSid());
@ -244,7 +260,7 @@ public class ScmVehiclePatrolinspectionsheetService extends MybatisBaseService<S
scmFileService.save(scmFile1);
}
ScmVehicleStayPatrolinspection scmVehicleStayPatrolinspection = scmVehicleStayPatrolinspectionService.fetchBySid(patrolInspectionSid);
scmVehicleStayPatrolinspectionService.updateByStaySid(patrolInspectionSid);
scmVehicleStayPatrolinspectionService.updateByStaySid(patrolInspectionSid,newTime,dto.getUserName());
ScmVehiclePatrolinspection scmVehiclePatrolinspection = new ScmVehiclePatrolinspection();
scmVehiclePatrolinspection.setMainSid(scmVehicleStayPatrolinspection.getMainSid());
scmVehiclePatrolinspection.setPatrolInspectionState("1");
@ -252,6 +268,7 @@ public class ScmVehiclePatrolinspectionsheetService extends MybatisBaseService<S
scmVehiclePatrolinspection.setLocationSid(scmVehicleStayPatrolinspection.getLocationSid());
scmVehiclePatrolinspection.setPatrolInspectionDate(new SimpleDateFormat("yyyy-MM-dd").format(new Date()));
scmVehiclePatrolinspection.setPatrolInspectionName(dto.getUserName());
scmVehiclePatrolinspection.setUseOrgName(data.getOrgName());
scmVehiclePatrolinspection.setCreateOrgSid(dto.getCreateOrgSid());
scmVehiclePatrolinspectionService.save(scmVehiclePatrolinspection);
baseMapper.updatePatSid(dto.getSid(), scmVehiclePatrolinspection.getSid());
@ -276,15 +293,16 @@ public class ScmVehiclePatrolinspectionsheetService extends MybatisBaseService<S
scmFileService.save(scmFile1);
}
ScmVehicleStayPatrolinspection scmVehicleStayPatrolinspection = scmVehicleStayPatrolinspectionService.fetchBySid(patrolInspectionSid);
scmVehicleStayPatrolinspectionService.updateByStaySid(patrolInspectionSid);
scmVehicleStayPatrolinspectionService.updateByStaySid(patrolInspectionSid,newTime,dto.getUserName());
ScmVehiclePatrolinspection scmVehiclePatrolinspection = new ScmVehiclePatrolinspection();
scmVehiclePatrolinspection.setMainSid(scmVehicleStayPatrolinspection.getMainSid());
scmVehiclePatrolinspection.setPatrolInspectionState("1");
scmVehiclePatrolinspection.setLocation(scmVehicleStayPatrolinspection.getLocation());
scmVehiclePatrolinspection.setLocationSid(scmVehicleStayPatrolinspection.getLocationSid());
scmVehiclePatrolinspection.setPatrolInspectionDate(new SimpleDateFormat("yyyy-MM-dd").format(new Date()));
scmVehiclePatrolinspection.setPatrolInspectionDate(newTime);
scmVehiclePatrolinspection.setPatrolInspectionName(dto.getUserName());
scmVehiclePatrolinspection.setCreateOrgSid(useOrgSid);
scmVehiclePatrolinspection.setUseOrgName(data.getOrgName());
scmVehiclePatrolinspectionService.save(scmVehiclePatrolinspection);
scmVehiclePatrolinspectionsheet.setPatrolInspectionSid(scmVehiclePatrolinspection.getSid());
save(scmVehiclePatrolinspectionsheet);

2
anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmvehiclestayinventory/ScmVehicleStayInventoryMapper.java

@ -79,6 +79,8 @@ public interface ScmVehicleStayInventoryMapper extends BaseMapper<ScmVehicleStay
*/
IPage<AppScmVehicleStayInventoryListPageVo> getInventoryList(IPage<AppScmVehicleStayInventoryListPageQuery> page, @Param(Constants.WRAPPER) QueryWrapper<AppScmVehicleStayInventoryListPageVo> qw, @Param("names") String names);
List<ScmVehicleStayInventoryVo> selInventory(@Param("vin") String vin ,@Param("id") String id);
@Update("update scm_vehicle_stay_inventory set isDelete = 1,InventoryDate = CURRENT_TIMESTAMP,InventoryName = #{inventoryName} where sid = #{sid}")
void delBySid(@Param("sid") String sid,@Param("inventoryName") String inventoryName);
}

14
anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmvehiclestayinventory/ScmVehicleStayInventoryMapper.xml

@ -33,11 +33,10 @@
<select id="getInventoryList"
resultType="com.yxt.anrui.scm.api.scmvehiclestayinventory.AppScmVehicleStayInventoryListPageVo">
SELECT
id,
sid,
mainSid AS vin,
location AS warehouse,
InventoryDate,
InventoryName
location AS warehouse
FROM
scm_vehicle_stay_inventory svsi
<where>
@ -48,5 +47,14 @@
</where>
ORDER BY id DESC
</select>
<select id="selInventory"
resultType="com.yxt.anrui.scm.api.scmvehiclestayinventory.ScmVehicleStayInventoryVo">
select InventoryDate as lastDate,
InventoryName as lastName
from scm_vehicle_stay_inventory svsi
where svsi.mainSid = #{vin}
and svsi.id &lt; #{id}
ORDER BY id DESC
</select>
</mapper>

21
anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmvehiclestayinventory/ScmVehicleStayInventoryService.java

@ -49,6 +49,8 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.List;
/**
@ -148,6 +150,8 @@ public class ScmVehicleStayInventoryService extends MybatisBaseService<ScmVehicl
scmVehicleStayInventory.setMainSid(appScmInventoryRecordsVo.getVin());
scmVehicleStayInventory.setLocationSid(appScmInventoryRecordsVo.getWarehouseSid());
scmVehicleStayInventory.setLocation(appScmInventoryRecordsVo.getWarehouse());
scmVehicleStayInventory.setInventoryName("");
scmVehicleStayInventory.setInventoryDate("");
scmVehicleStayInventory.setCreateOrgSid(orgSid);
save(scmVehicleStayInventory);
}
@ -161,6 +165,7 @@ public class ScmVehicleStayInventoryService extends MybatisBaseService<ScmVehicl
* @return
*/
public IPage<AppScmVehicleStayInventoryListPageVo> getInventoryList(PagerQuery<AppScmVehicleStayInventoryListPageQuery> pagerQuery) {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
IPage<AppScmVehicleStayInventoryListPageQuery> page = PagerUtil.queryToPage(pagerQuery);
String useOrgSid = sysStaffOrgFeign.getPathSidByUserSid(pagerQuery.getParams().getUserSid()).getData();
pagerQuery.getParams().setUseOrgSid(useOrgSid);
@ -169,11 +174,20 @@ public class ScmVehicleStayInventoryService extends MybatisBaseService<ScmVehicl
IPage<AppScmVehicleStayInventoryListPageVo> iPage = baseMapper.getInventoryList(page, qw, params.getNames());
List<AppScmVehicleStayInventoryListPageVo> records = iPage.getRecords();
for (AppScmVehicleStayInventoryListPageVo record : records) {
if (StringUtils.isBlank(record.getInventoryDate())) {
// 查询上一次的盘库人,盘库时间
List<ScmVehicleStayInventoryVo> scmVehicleStayInventoryVos = baseMapper.selInventory(record.getVin(), record.getId());
if (scmVehicleStayInventoryVos.size() <= 0) {
record.setInventoryDate("无");
} else {
ScmVehicleStayInventoryVo scmVehicleStayInventoryVo = scmVehicleStayInventoryVos.get(0);
record.setInventoryDate(simpleDateFormat.format(scmVehicleStayInventoryVo.getLastDate()));
}
if (StringUtils.isBlank(record.getInventoryName())) {
if (scmVehicleStayInventoryVos.size() <= 0) {
record.setInventoryName("无");
} else {
ScmVehicleStayInventoryVo scmVehicleStayInventoryVo = scmVehicleStayInventoryVos.get(0);
record.setInventoryName(scmVehicleStayInventoryVo.getLastName());
}
}
return iPage;
@ -191,6 +205,9 @@ public class ScmVehicleStayInventoryService extends MybatisBaseService<ScmVehicl
if (StringUtils.isNotBlank(query.getUseOrgSid())) {
qw.eq("svsi.createOrgSid", query.getUseOrgSid());
}
if (StringUtils.isNotBlank(query.getWarehouseSid())) {
qw.eq("svsi.locationSid", query.getWarehouseSid());
}
return qw;
}

10
anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmvehiclestaypatrolinspection/ScmVehicleStayPatrolinspectionMapper.java

@ -73,11 +73,13 @@ public interface ScmVehicleStayPatrolinspectionMapper extends BaseMapper<ScmVehi
*
* @param page
* @param qw
* @param names
* @param name
* @return
*/
IPage<AppScmVehicleStayPatrolinspectionPageVo> getInventoryList(IPage<AppScmVehicleStayPatrolinspectionPageQuery> page, @Param(Constants.WRAPPER) QueryWrapper<AppScmVehicleStayPatrolinspectionPageVo> qw, @Param("names") String names);
IPage<AppScmVehicleStayPatrolinspectionPageVo> getInventoryList(IPage<AppScmVehicleStayPatrolinspectionPageQuery> page, @Param(Constants.WRAPPER) QueryWrapper<AppScmVehicleStayPatrolinspectionPageVo> qw, @Param("name") String name);
@Update("update scm_vehicle_stay_patrolinspection set isDelete = 1 where sid = #{patrolInspectionSid}")
void updateByStaySid(String patrolInspectionSid);
void updateByStaySid(@Param("patrolInspectionSid") String patrolInspectionSid, @Param("newTime") String newTime, @Param("userName") String userName);
List<ScmVehicleStayPatrolinspectionVo> selPatrolinspection(@Param("vin") String vin, @Param("id") String id);
}

23
anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmvehiclestaypatrolinspection/ScmVehicleStayPatrolinspectionMapper.xml

@ -37,6 +37,7 @@
<select id="getInventoryList"
resultType="com.yxt.anrui.scm.api.scmvehiclestaypatrolinspection.AppScmVehicleStayPatrolinspectionPageVo">
SELECT
id,
sid,
mainSid AS vin,
location AS warehouse,
@ -47,10 +48,28 @@
scm_vehicle_stay_patrolinspection svsp
<where>
${ew.sqlSegment}
<if test="names != '' and names != null ">
and concat(svsp.mainSid,svsp.patrolInspectionName) LIKE concat('%', #{names}, '%')
<if test="name != '' and name != null ">
and concat(svsp.mainSid,svsp.patrolInspectionName) LIKE concat('%', #{name}, '%')
</if>
</where>
ORDER BY id DESC
</select>
<select id="selPatrolinspection"
resultType="com.yxt.anrui.scm.api.scmvehiclestaypatrolinspection.ScmVehicleStayPatrolinspectionVo">
select patrolInspectionDate,
patrolInspectionName
from scm_vehicle_stay_patrolinspection svsp
where svsp.mainSid = #{vin}
and svsp.id &lt; #{id}
ORDER BY id DESC
</select>
<update id="updateByStaySid">
update scm_vehicle_stay_patrolinspection
set isDelete = 1,
patrolInspectionName = #{userName},
patrolInspectionDate = #{newTime}
where sid = #{patrolInspectionSid}
</update>
</mapper>

18
anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmvehiclestaypatrolinspection/ScmVehicleStayPatrolinspectionService.java

@ -169,14 +169,22 @@ public class ScmVehicleStayPatrolinspectionService extends MybatisBaseService<Sc
pagerQuery.getParams().setUseOrgSid(useOrgSid);
QueryWrapper<AppScmVehicleStayPatrolinspectionPageVo> qw = appQueryWrapper(pagerQuery.getParams());
AppScmVehicleStayPatrolinspectionPageQuery params = pagerQuery.getParams();
IPage<AppScmVehicleStayPatrolinspectionPageVo> iPage = baseMapper.getInventoryList(page, qw, params.getNames());
IPage<AppScmVehicleStayPatrolinspectionPageVo> iPage = baseMapper.getInventoryList(page, qw, params.getName());
List<AppScmVehicleStayPatrolinspectionPageVo> records = iPage.getRecords();
for (AppScmVehicleStayPatrolinspectionPageVo record : records) {
if (StringUtils.isBlank(record.getInspectionDate())) {
List<ScmVehicleStayPatrolinspectionVo> scmVehicleStayPatrolinspectionVos = baseMapper.selPatrolinspection(record.getVin(), record.getId());
if (scmVehicleStayPatrolinspectionVos.size() <= 0) {
record.setInspectionDate("无");
} else {
ScmVehicleStayPatrolinspectionVo scmVehicleStayPatrolinspectionVo = scmVehicleStayPatrolinspectionVos.get(0);
record.setInspectionDate(scmVehicleStayPatrolinspectionVo.getPatrolInspectionDate());
}
if (StringUtils.isBlank(record.getInspectionName())) {
if (scmVehicleStayPatrolinspectionVos.size() <= 0) {
record.setInspectionName("无");
} else {
ScmVehicleStayPatrolinspectionVo scmVehicleStayPatrolinspectionVo = scmVehicleStayPatrolinspectionVos.get(0);
record.setInspectionName(scmVehicleStayPatrolinspectionVo.getPatrolInspectionName());
}
}
return iPage;
@ -200,7 +208,7 @@ public class ScmVehicleStayPatrolinspectionService extends MybatisBaseService<Sc
return qw;
}
public void updateByStaySid(String patrolInspectionSid) {
baseMapper.updateByStaySid(patrolInspectionSid);
public void updateByStaySid(String patrolInspectionSid, String newTime, String userName) {
baseMapper.updateByStaySid(patrolInspectionSid, newTime, userName);
}
}

4
anrui-terminal/anrui-terminal-api/src/main/java/com/yxt/anrui/terminal/api/supplychain/inspection/PatrolinspectionDto.java

@ -94,4 +94,8 @@ public class PatrolinspectionDto implements Dto {
@JsonProperty("userSid")
private String userSid;
@ApiModelProperty("用户名称")
@JsonProperty("userName")
private String userName;
}

2
anrui-terminal/anrui-terminal-api/src/main/java/com/yxt/anrui/terminal/api/supplychain/inspection/StayPatrolinspectionPageQuery.java

@ -11,7 +11,7 @@ public class StayPatrolinspectionPageQuery implements Query {
private String userSid;
@ApiModelProperty("优先匹配车架号 存放地点 巡检人员")
private String names;
private String name;
@ApiModelProperty("存放地点 “”/null 全部 有值时只查询当前存放地点的记录")
private String warehouseSid;

2
anrui-terminal/anrui-terminal-api/src/main/java/com/yxt/anrui/terminal/api/supplychain/inventory/CarInventoryListPageQuery.java

@ -11,7 +11,7 @@ public class CarInventoryListPageQuery implements Query {
private String userSid;
@ApiModelProperty("优先匹配车架号 盘库人员")
private String names;
private String name;
@ApiModelProperty("时间段 示例 2020-02-01至2022-03-31")
private String date;

Loading…
Cancel
Save