This commit is contained in:
parent
add7904eb9
commit
5e5ae0d5a6
|
|
@ -120,6 +120,8 @@ public class BackApplyInfoController extends BaseController {
|
|||
if (!result.isSuccess()) {
|
||||
return AjaxResult.error("SysFile文件服务上传失败:" + result.get("msg"));
|
||||
}
|
||||
//电子档案工程同步,第一次执行时间较长
|
||||
syncProject();
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
Map<String, Object> jsonObject = (Map<String, Object>) result.get("data");
|
||||
|
|
@ -559,6 +561,7 @@ public class BackApplyInfoController extends BaseController {
|
|||
} catch (Exception e) {
|
||||
return AjaxResult.success(ListPagingUtil.paging(pageIndex, pageSize, new ArrayList<>()));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -573,4 +576,27 @@ public class BackApplyInfoController extends BaseController {
|
|||
}
|
||||
|
||||
/** -------出门证结束------- */
|
||||
|
||||
|
||||
/**
|
||||
* 电子档案工程同步
|
||||
*/
|
||||
public void syncProject() {
|
||||
//1、查询未同步的工程信息
|
||||
List<BackApplyInfo> list = backApplyInfoService.selectNotSyncProject();
|
||||
if (list.size()>0){
|
||||
for (BackApplyInfo backApplyInfo : list){
|
||||
//2、将所有工程信息插入archives_record_info,并返回id
|
||||
backApplyInfoService.syncProject(backApplyInfo);
|
||||
if (backApplyInfo.getId()!=null){
|
||||
//3、将返回的每个id插入archives_record_details
|
||||
backApplyInfoService.syncProjectDetails(backApplyInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -507,4 +507,10 @@ public interface BackApplyInfoMapper {
|
|||
* @return
|
||||
*/
|
||||
int delHandlingOrder(HandlingOrder bean);
|
||||
|
||||
List<BackApplyInfo> selectNotSyncProject();
|
||||
|
||||
int syncProject(BackApplyInfo backApplyInfo);
|
||||
|
||||
int syncProjectDetails(BackApplyInfo backApplyInfo2);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -242,5 +242,12 @@ public interface IBackApplyInfoService {
|
|||
* @return
|
||||
*/
|
||||
AjaxResult delHandlingOrder(HandlingOrder bean);
|
||||
|
||||
|
||||
List<BackApplyInfo> selectNotSyncProject();
|
||||
|
||||
int syncProject(BackApplyInfo backApplyInfo);
|
||||
|
||||
int syncProjectDetails(BackApplyInfo backApplyInfo);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2294,6 +2294,29 @@ public class BackApplyInfoServiceImpl implements IBackApplyInfoService {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BackApplyInfo> selectNotSyncProject() {
|
||||
return backApplyInfoMapper.selectNotSyncProject();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int syncProject(BackApplyInfo backApplyInfo) {
|
||||
return backApplyInfoMapper.syncProject(backApplyInfo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int syncProjectDetails(BackApplyInfo backApplyInfo) {
|
||||
BackApplyInfo backApplyInfo2 = new BackApplyInfo();
|
||||
backApplyInfo2.setId(backApplyInfo.getId());
|
||||
backApplyInfo2.setTypeName("领料单");
|
||||
backApplyInfoMapper.syncProjectDetails(backApplyInfo2);
|
||||
backApplyInfo2.setTypeName("退料单");
|
||||
backApplyInfoMapper.syncProjectDetails(backApplyInfo2);
|
||||
backApplyInfo2.setTypeName("业务联系单");
|
||||
backApplyInfoMapper.syncProjectDetails(backApplyInfo2);
|
||||
return 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理班组退料结算协议
|
||||
* @param record
|
||||
|
|
|
|||
|
|
@ -172,11 +172,7 @@ public class MachineController extends BaseController {
|
|||
@ApiOperation(value = "电子标签查询")
|
||||
@GetMapping("/getElectronicLabel")
|
||||
public AjaxResult getElectronicLabel(Machine machine) {
|
||||
try {
|
||||
return success(machineService.getElectronicLabel(machine));
|
||||
} catch (Exception e) {
|
||||
return error("系统错误, " + e.getMessage());
|
||||
}
|
||||
return machineService.getElectronicLabel(machine);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@ public interface IMachineService
|
|||
* @param machine
|
||||
* @return
|
||||
*/
|
||||
List<Machine> getElectronicLabel(Machine machine);
|
||||
AjaxResult getElectronicLabel(Machine machine);
|
||||
|
||||
/**
|
||||
* 根据标签信息查询出库单
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
package com.bonus.material.ma.service.impl;
|
||||
|
||||
import java.time.ZoneId;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
|
@ -207,8 +209,9 @@ public class MachineServiceImpl implements IMachineService
|
|||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<Machine> getElectronicLabel(Machine machine) {
|
||||
public AjaxResult getElectronicLabel(Machine machine) {
|
||||
List<Machine> list = new ArrayList<>();
|
||||
int type = 0;
|
||||
try {
|
||||
if (machine.getDevType()==1){
|
||||
//查询ws_ma_info,工器具
|
||||
|
|
@ -217,6 +220,18 @@ public class MachineServiceImpl implements IMachineService
|
|||
//查询ma_machine表,安全工器具
|
||||
list = machineMapper.getElectronicLabel(machine);
|
||||
}
|
||||
for (Machine dto : list){
|
||||
Date nextCheckTime = dto.getNextCheckTime();
|
||||
Date todayStart = new Date(); // 获取当前时间
|
||||
// 将 todayStart 设置为当天的开始时间(00:00:00)
|
||||
todayStart = Date.from(todayStart.toInstant().atZone(ZoneId.systemDefault())
|
||||
.withHour(0).withMinute(0).withSecond(0).withNano(0)
|
||||
.toInstant());
|
||||
if (nextCheckTime != null && nextCheckTime.before(todayStart)) {
|
||||
type=1;
|
||||
throw new RuntimeException("该工器具已临近下次检验时间,请及时退还至机具(物流)分公司!");
|
||||
}
|
||||
}
|
||||
|
||||
if (CollectionUtils.isNotEmpty(list)) {
|
||||
for (Machine dto : list) {
|
||||
|
|
@ -237,9 +252,13 @@ public class MachineServiceImpl implements IMachineService
|
|||
}
|
||||
}
|
||||
}
|
||||
return list;
|
||||
return AjaxResult.success(list);
|
||||
} catch (Exception e){
|
||||
return new ArrayList<>();
|
||||
if (type==1){
|
||||
return AjaxResult.error("该工器具已临近下次检验时间,请及时退还至机具(物流)分公司!");
|
||||
} else {
|
||||
return AjaxResult.success(new ArrayList<>());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -796,6 +796,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
insert into bm_exit_permit (material,name,car_code,add_date,create_by,create_time)
|
||||
values (#{material}, #{name}, #{carCode}, #{addDate}, #{createBy}, now())
|
||||
</insert>
|
||||
<insert id="syncProject" useGeneratedKeys="true" keyProperty="id">
|
||||
INSERT INTO archives_record_info
|
||||
(
|
||||
parent_id,`level`,archives_value,archives_name,del_flag,create_time
|
||||
) VALUES (
|
||||
'22','2',#{proId},#{proName},'0',NOW()
|
||||
)
|
||||
</insert>
|
||||
<insert id="syncProjectDetails">
|
||||
INSERT INTO archives_record_details
|
||||
(
|
||||
info_id,parent_id,`level`,doc_name,doc_type,del_flag,create_time
|
||||
) VALUES (
|
||||
#{id},'0','1',#{typeName},'文件夹','0',NOW()
|
||||
)
|
||||
</insert>
|
||||
|
||||
<delete id="deleteBackApply">
|
||||
delete from back_apply_info where id = #{id}
|
||||
|
|
@ -1558,4 +1574,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
from sys_user su
|
||||
where su.user_id = 474 and su.del_flag = 0
|
||||
</select>
|
||||
<select id="selectNotSyncProject" resultType="com.bonus.material.back.domain.BackApplyInfo">
|
||||
SELECT
|
||||
pro_id as proId,
|
||||
pro_name as proName
|
||||
FROM
|
||||
bm_project
|
||||
WHERE
|
||||
del_flag='0'
|
||||
and pro_id not in (
|
||||
SELECT
|
||||
archives_value
|
||||
FROM
|
||||
archives_record_info
|
||||
WHERE
|
||||
parent_id='22'
|
||||
and archives_value is not null
|
||||
)
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -490,8 +490,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
mi.ma_name as materialName,
|
||||
mi.ma_model as materialModel,
|
||||
mi.ma_code as maCode,
|
||||
mi.this_check_time as thisCheckTime,
|
||||
mi.next_check_time as nextCheckTime,
|
||||
LEFT(mi.this_check_time, 10) AS thisCheckTime,
|
||||
LEFT(mi.next_check_time, 10) AS nextCheckTime,
|
||||
mi.repair_man as repairMan,
|
||||
mi.check_man as checkMan,
|
||||
mi.phone,
|
||||
|
|
@ -500,15 +500,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
'1' as devType
|
||||
FROM
|
||||
ws_ma_info mi
|
||||
WHERE mi.ma_code LIKE CONCAT('%',#{maCode},'%') and mi.is_active = 1 and DATEDIFF(mi.next_check_time,NOW()) > 0
|
||||
WHERE mi.ma_code LIKE CONCAT('%',#{maCode},'%') and mi.is_active = 1
|
||||
UNION
|
||||
SELECT
|
||||
mm.ma_id AS id,
|
||||
mt2.type_name as maName,
|
||||
mt.type_name as maModel,
|
||||
mm.ma_code as maCode,
|
||||
mm.this_check_time as thisCheckTime,
|
||||
mm.next_check_time as nextCheckTime,
|
||||
LEFT(mm.this_check_time, 10) AS thisCheckTime,
|
||||
LEFT(mm.next_check_time, 10) AS nextCheckTime,
|
||||
mm.check_man as repairMan,
|
||||
ifnull(mm.inspect_man,"高民") as checkMan,
|
||||
"0551-63703966" as phone,
|
||||
|
|
@ -518,7 +518,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
FROM ma_machine mm
|
||||
LEFT JOIN ma_type mt on mm.type_id = mt.type_id
|
||||
LEFT JOIN ma_type mt2 on mt.parent_id = mt2.type_id
|
||||
WHERE mm.ma_code LIKE CONCAT('%',#{maCode},'%') and mt.MANAGE_TYPE =0 and DATEDIFF(mm.next_check_time,NOW()) > 0
|
||||
WHERE mm.ma_code LIKE CONCAT('%',#{maCode},'%') and mt.MANAGE_TYPE =0
|
||||
</select>
|
||||
|
||||
<delete id="deleteMachineByMaCodeAndTypeId">
|
||||
|
|
|
|||
Loading…
Reference in New Issue