提交修改
This commit is contained in:
commit
c55cb71302
@ -64,6 +64,8 @@ public class ShiroConfig {
|
||||
filterMap.put("/swagger-resources/**", "anon");
|
||||
filterMap.put("/captcha.jpg", "anon");
|
||||
filterMap.put("/aaa.txt", "anon");
|
||||
filterMap.put("/oneCode/update/prints", "anon");
|
||||
filterMap.put("/oneCode/no/prints", "anon");
|
||||
filterMap.put("/dtlg/login", "anon");
|
||||
filterMap.put("/dtlg/luck", "anon");
|
||||
filterMap.put("/dtlg/look", "anon");
|
||||
|
||||
@ -6,6 +6,7 @@ import com.lz.common.utils.StringUtil;
|
||||
import com.lz.modules.app.annotation.Login;
|
||||
import com.lz.modules.app.entity.StaffEntity;
|
||||
import com.lz.modules.app.service.StaffService;
|
||||
import com.lz.modules.equipment.dao.TCountMapper;
|
||||
import com.lz.modules.equipment.entity.*;
|
||||
import com.lz.modules.equipment.entity.model.*;
|
||||
import com.lz.modules.equipment.service.*;
|
||||
@ -55,6 +56,8 @@ public class EquipmentController extends AbstractController {
|
||||
private EquipmentQrService equipmentQrService;
|
||||
@Autowired
|
||||
private SpecialApplyInfoService specialApplyInfoService;
|
||||
@Autowired
|
||||
private TCountMapper tCountMapper;
|
||||
|
||||
@GetMapping("findEquipmentById")
|
||||
@RequiresPermissions("user:device:pandian")
|
||||
@ -85,7 +88,14 @@ public class EquipmentController extends AbstractController {
|
||||
model.setSpecId(equipmentSpecs1.getId());
|
||||
}
|
||||
});*/
|
||||
int i = tCountMapper.selectMaxNum();
|
||||
if(equipmentInfo.getCount()<i){
|
||||
logger.info("第" + i + "次盘点" + code);
|
||||
equipmentInfo.setCount(i);
|
||||
iEquipmentInfoService.insertEquipmentInfo(equipmentInfo);
|
||||
}
|
||||
addRecord(equipmentInfo);
|
||||
model.setId(equipmentInfo.getId());
|
||||
return R.ok().put("data", model);
|
||||
|
||||
}
|
||||
@ -232,4 +242,5 @@ public class EquipmentController extends AbstractController {
|
||||
iEquipmentFlowRecordService.insertEquipmentFlowRecord(record);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -40,4 +40,6 @@ public interface TCountMapper extends BaseMapper<TCount> {
|
||||
List<TCount> selectListLimit(@Param("limit") int limit);
|
||||
|
||||
List selectByReq(@Param("page") IPage page, @Param("req") TCountReq req);
|
||||
|
||||
int selectMaxNum();
|
||||
}
|
||||
@ -68,6 +68,9 @@ public class EquipmentInfoReq implements java.io.Serializable {
|
||||
|
||||
private Long brandId;
|
||||
|
||||
//规格id
|
||||
private Long specsId;
|
||||
|
||||
private String gmtInStartTime;
|
||||
|
||||
private String gmtInEndTime;
|
||||
|
||||
@ -118,13 +118,17 @@ public class EquipmentInfoServiceImpl extends ServiceImpl<EquipmentInfoMapper, E
|
||||
}
|
||||
|
||||
EquipmentInfo info = equipmentInfoMapper.selectEquipmentInfoById(dto.getId());
|
||||
if(info==null){
|
||||
int i = tCountMapper.selectMaxNum();
|
||||
|
||||
if(info==null || (info!=null && info.getCount()<i)){
|
||||
log.info("change 第" + i + "次盘点");
|
||||
EquipmentInfo insert = new EquipmentInfo();
|
||||
BeanUtils.copyProperties(dto,insert);
|
||||
insert.setType(equipmentType.getType());
|
||||
insert.setBrandName(equipmentBrand.getBrand());
|
||||
insert.setSpecType(equipmentSpecs.getSpecs());
|
||||
insert.setEquipmentState(dto.getState());
|
||||
BeanUtils.copyProperties(dto,insert);
|
||||
insert.setSpecsId(dto.getSpecId());
|
||||
if(dto.isEmployee()){
|
||||
StaffEntity employeesInfo = staffService.selectStaffById(dto.getUserId());
|
||||
if(employeesInfo==null){
|
||||
@ -132,6 +136,7 @@ public class EquipmentInfoServiceImpl extends ServiceImpl<EquipmentInfoMapper, E
|
||||
}
|
||||
insert.setUser(employeesInfo.getName());
|
||||
insert.setUserId(employeesInfo.getId());
|
||||
insert.setSaiId(null);
|
||||
}else {
|
||||
SpecialApplyInfo specialApplyInfo = specialApplyInfoMapper.selectSpecialApplyInfoById(dto.getUserId());
|
||||
if(specialApplyInfo==null){
|
||||
@ -139,7 +144,9 @@ public class EquipmentInfoServiceImpl extends ServiceImpl<EquipmentInfoMapper, E
|
||||
}
|
||||
insert.setUser(specialApplyInfo.getTypeDesc());
|
||||
insert.setSaiId(specialApplyInfo.getId());
|
||||
insert.setUserId(null);
|
||||
}
|
||||
insert.setCount(i);
|
||||
equipmentInfoMapper.insert(insert);
|
||||
addRecord(insert,infoDto);
|
||||
|
||||
@ -152,6 +159,7 @@ public class EquipmentInfoServiceImpl extends ServiceImpl<EquipmentInfoMapper, E
|
||||
}
|
||||
info.setUser(employeesInfo.getName());
|
||||
info.setUserId(employeesInfo.getId());
|
||||
info.setSaiId(null);
|
||||
}else {
|
||||
SpecialApplyInfo specialApplyInfo = specialApplyInfoMapper.selectSpecialApplyInfoById(dto.getUserId());
|
||||
if(specialApplyInfo==null){
|
||||
@ -159,15 +167,13 @@ public class EquipmentInfoServiceImpl extends ServiceImpl<EquipmentInfoMapper, E
|
||||
}
|
||||
info.setUser(specialApplyInfo.getTypeDesc());
|
||||
info.setSaiId(specialApplyInfo.getId());
|
||||
}
|
||||
//根据是否员工重置其他id
|
||||
if(dto.isEmployee()){
|
||||
info.setSaiId(null);
|
||||
}else {
|
||||
info.setUserId(null);
|
||||
}
|
||||
info.setType(equipmentType.getType());
|
||||
info.setBrandName(equipmentBrand.getBrand());
|
||||
info.setSpecsId(dto.getSpecId());
|
||||
info.setBrandId(dto.getBrandId());
|
||||
info.setTypeId(dto.getTypeId());
|
||||
info.setSpecType(equipmentSpecs.getSpecs());
|
||||
info.setQr(dto.getQr());
|
||||
info.setCode(dto.getCode());
|
||||
|
||||
@ -49,7 +49,7 @@ public class ScheduleJobServiceImpl extends ServiceImpl<ScheduleJobDao, Schedule
|
||||
CronTrigger cronTrigger = ScheduleUtils.getCronTrigger(scheduler, scheduleJob.getJobId());
|
||||
//如果不存在,则创建
|
||||
if(cronTrigger == null) {
|
||||
//ScheduleUtils.createScheduleJob(scheduler, scheduleJob);
|
||||
ScheduleUtils.createScheduleJob(scheduler, scheduleJob);
|
||||
}else {
|
||||
ScheduleUtils.updateScheduleJob(scheduler, scheduleJob);
|
||||
}
|
||||
|
||||
@ -32,6 +32,7 @@ import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@ -418,5 +419,4 @@ public class ExportController {
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -508,9 +508,6 @@
|
||||
</foreach>
|
||||
)
|
||||
</if>
|
||||
<if test="req.flowProcess !=null">
|
||||
and r.flow_process = #{req.flowProcess}
|
||||
</if>
|
||||
<if test="req.staffName !=null and req.staffName!=''">
|
||||
and r.staff_name LIKE CONCAT('%',#{req.staffName},'%')
|
||||
</if>
|
||||
@ -545,9 +542,6 @@
|
||||
</foreach>
|
||||
)
|
||||
</if>
|
||||
<if test="req.flowProcess !=null">
|
||||
and r.flow_process = #{req.flowProcess}
|
||||
</if>
|
||||
<if test="req.staffName !=null and req.staffName!=''">
|
||||
and r.staff_name LIKE CONCAT('%',#{req.staffName},'%')
|
||||
</if>
|
||||
|
||||
@ -30,7 +30,7 @@
|
||||
<result column="count" property="count"/>
|
||||
<result column="type_id" property="typeId"/>
|
||||
<result column="brand_id" property="brandId"/>
|
||||
<result column="specs_di" property="specsId"/>
|
||||
<result column="specs_id" property="specsId"/>
|
||||
</resultMap>
|
||||
|
||||
|
||||
@ -97,7 +97,7 @@
|
||||
<if test="saiId != null">#{ saiId}, </if>
|
||||
<if test="typeId != null">#{typeId}, </if>
|
||||
<if test="brandId != null">#{brandId}, </if>
|
||||
<if test="specsId != null">#{specsId]}, </if>
|
||||
<if test="specsId != null">#{specsId}, </if>
|
||||
<if test="count != null">#{ count}, </if>
|
||||
0,
|
||||
now(),
|
||||
@ -133,7 +133,7 @@
|
||||
<if test="saiId != null">sai_id = #{saiId},</if>
|
||||
<if test="typeId != null">type_id=#{typeId}, </if>
|
||||
<if test="brandId != null">brand_id=#{brandId}, </if>
|
||||
<if test="specsId != null">specs_id=#{specsId]}, </if>
|
||||
<if test="specsId != null">specs_id=#{specsId}, </if>
|
||||
<if test="count != null">count = #{count}</if>
|
||||
</trim>
|
||||
,gmt_modified = now()
|
||||
@ -181,7 +181,7 @@
|
||||
|
||||
|
||||
<select id="selectEquipmentInfoByCode" resultType="EquipmentInfo">
|
||||
select * from equipment_info where code=#{code} and is_delete = 0 limit 1
|
||||
select * from equipment_info where code=#{code} and is_delete = 0 order by count desc limit 1
|
||||
</select>
|
||||
|
||||
<select id="selectByCondition" resultType="com.lz.modules.equipment.entity.EquipmentInfo">
|
||||
|
||||
@ -80,5 +80,8 @@
|
||||
select * from equipment_t_count where is_delete = 0 order by id desc
|
||||
</select>
|
||||
|
||||
<select id="selectMaxNum" resultType="int">
|
||||
select num from equipment_t_count where is_delete = 0 order by num desc limit 1
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user