web资产导出

duhanyu
杜函宇 14 hours ago
parent e753ba358f
commit cf42f890df

@ -151,7 +151,7 @@ public class AssetCurrentController extends BaseController {
throw new ServiceException("请选择已有单位!"); throw new ServiceException("请选择已有单位!");
} }
List<AssetCurrent> list1 = assetCurrentService.lambdaQuery().eq(AssetCurrent::getXtmc, assetCurrent.getXtmc()).eq(AssetCurrent::getDwmc, assetCurrent.getDwmc()).list(); List<AssetCurrent> list1 = assetCurrentService.lambdaQuery().eq(AssetCurrent::getXtmc, assetCurrent.getXtmc()).eq(AssetCurrent::getDwmc, assetCurrent.getDwmc()).list();
if (list1 != null&& !list1.isEmpty()){ if (list1 != null && !list1.isEmpty()) {
throw new ServiceException("不允许新增重复资产!"); throw new ServiceException("不允许新增重复资产!");
} }
@ -520,8 +520,8 @@ public class AssetCurrentController extends BaseController {
if (currentCpPo != null) { if (currentCpPo != null) {
//查询任务是否为进行中 //查询任务是否为进行中
AssetTask assetTask = assetTaskService.findByTaskId(currentCpPo.getTaskId()); AssetTask assetTask = assetTaskService.findByTaskId(currentCpPo.getTaskId());
if (assetTask.getTaskStatus().equals(1)){ if (assetTask.getTaskStatus().equals(1)) {
if (currentCpPo.getStatus()==5 ){ if (currentCpPo.getStatus() == 5) {
//修改任务中资产状态 //修改任务中资产状态
currentCpPo.setStatus(0); currentCpPo.setStatus(0);
currentCpPo.setBtgyy(null); currentCpPo.setBtgyy(null);
@ -684,7 +684,7 @@ public class AssetCurrentController extends BaseController {
} else { } else {
//根据资产id查询旧资产 //根据资产id查询旧资产
AssetCurrentCpPo assetCurrentCpPo = assetCurrentCpService.findDwmc(assetCurrent.getId()); AssetCurrentCpPo assetCurrentCpPo = assetCurrentCpService.findDwmc(assetCurrent.getId());
if (assetCurrentCpPo!=null){ if (assetCurrentCpPo != null) {
assetCurrentCpPo.setDwmc(assetCurrent.getDwmc()); assetCurrentCpPo.setDwmc(assetCurrent.getDwmc());
assetCurrentCpPo.setTaskId(assetTask.getId()); assetCurrentCpPo.setTaskId(assetTask.getId());
//修改 //修改

@ -55,8 +55,21 @@
l.* l.*
FROM FROM
asset_current a asset_current a
LEFT JOIN ( SELECT asset_id, NAME, tyshxydm, lxr, lxdh, gyszcdz, sfwtc FROM asset_supply_chain WHERE type = 5 LEFT JOIN (
GROUP BY asset_id,NAME, tyshxydm, lxr, lxdh, gyszcdz, sfwtc ) b ON a.id = b.asset_id SELECT
asset_id,
NAME,
tyshxydm,
lxr,
lxdh,
gyszcdz,
sfwtc,
ROW_NUMBER() OVER (PARTITION BY asset_id ORDER BY create_time) AS row_num
FROM
asset_supply_chain
WHERE
type = 5
) b ON a.id = b.asset_id AND b.row_num = 1
LEFT JOIN ( LEFT JOIN (
SELECT SELECT
asset_id, asset_id,
@ -65,20 +78,13 @@
lxr AS lxr1, lxr AS lxr1,
lxdh AS lxdh1, lxdh AS lxdh1,
gyszcdz AS gyszcdz1, gyszcdz AS gyszcdz1,
sfwtc AS sfwtc1 sfwtc AS sfwtc1,
ROW_NUMBER() OVER (PARTITION BY asset_id ORDER BY create_time) AS row_num
FROM FROM
asset_supply_chain asset_supply_chain
WHERE WHERE
type = 7 type = 7
GROUP BY ) c ON a.id = c.asset_id AND c.row_num = 1
asset_id,
NAME,
tyshxydm,
lxr,
lxdh,
gyszcdz,
sfwtc
) c ON a.id = c.asset_id
LEFT JOIN ( LEFT JOIN (
SELECT SELECT
asset_id, asset_id,
@ -91,18 +97,13 @@
yjxlh, yjxlh,
yjbbxx, yjbbxx,
yjyt, yjyt,
yjbsxx yjbsxx,
ROW_NUMBER() OVER (PARTITION BY asset_id ORDER BY create_time) AS row_num
FROM FROM
asset_basic_network asset_basic_network
WHERE WHERE
type = 1 type = 1
GROUP BY ) d ON a.id = d.asset_id AND d.row_num = 1
asset_id,
sblx,
pp,
sb_ip,
czxt,czxtbb,yjxh,yjxlh,yjbbxx,yjyt,yjbsxx
) d ON a.id = d.asset_id
LEFT JOIN ( LEFT JOIN (
SELECT SELECT
asset_id, asset_id,
@ -113,26 +114,32 @@
yjxlh AS wlyjxlh, yjxlh AS wlyjxlh,
yjbbxx AS wlyjbbxx, yjbbxx AS wlyjbbxx,
yjyt AS wlyjyt, yjyt AS wlyjyt,
yjbsxx AS wlyjbsxx yjbsxx AS wlyjbsxx,
ROW_NUMBER() OVER (PARTITION BY asset_id ORDER BY create_time) AS row_num
FROM FROM
asset_basic_network asset_basic_network
WHERE WHERE
type = 2 type = 2
GROUP BY ) e ON a.id = e.asset_id AND e.row_num = 1
LEFT JOIN (
SELECT
asset_id, asset_id,
sblx, sblx AS aqwlsblx,
pp,sb_ip,yjxh,yjxlh,yjbbxx,yjyt,yjbsxx pp AS aqwlpp,
) e ON a.id = e.asset_id sb_ip AS aqwlsbIp,
LEFT JOIN ( SELECT
asset_id, sblx AS aqwlsblx, pp AS aqwlpp, sb_ip AS aqwlsbIp,
yjxh AS aqyjxh, yjxh AS aqyjxh,
yjxlh AS aqyjxlh, yjxlh AS aqyjxlh,
yjbbxx AS aqyjbbxx, yjbbxx AS aqyjbbxx,
yjyt AS aqyjyt, yjyt AS aqyjyt,
yjbsxx AS aqyjbswz yjbsxx AS aqyjbswz,
FROM asset_basic_network WHERE type = 3 GROUP BY asset_id,sblx,pp,sb_ip,yjxh,yjxlh,yjbbxx,yjyt,yjbsxx ) l ON a.id = l.asset_id ROW_NUMBER() OVER (PARTITION BY asset_id ORDER BY create_time) AS row_num
FROM
asset_basic_network
WHERE
type = 3
) l ON a.id = l.asset_id AND l.row_num = 1
<where> <where>
a.del_flag = '0' and a.isbf = '0' a.del_flag = '0'
<if test="req.xtmc!=null and req.xtmc!='' "> <if test="req.xtmc!=null and req.xtmc!='' ">
and a.xtmc like concat('%',#{req.xtmc},'%') and a.xtmc like concat('%',#{req.xtmc},'%')
</if> </if>

Loading…
Cancel
Save