二级库功能修改+审计漏洞修复
This commit is contained in:
parent
39a952ae4c
commit
6b034e61d8
|
|
@ -128,6 +128,7 @@ public class TmTaskController extends BaseController {
|
|||
*/
|
||||
@Log(title = "删除任务", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{taskId}")
|
||||
@RequiresPermissions("picking:apply:del")
|
||||
public AjaxResult deleteTaskInfoByTaskId(@PathVariable String taskId) {
|
||||
if (StringUtils.isEmpty(taskId)) {
|
||||
return AjaxResult.error("参数错误,删除失败!");
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ import java.util.stream.Collectors;
|
|||
@RestController
|
||||
@RequestMapping("/base/bmUnitInfo")
|
||||
@Slf4j
|
||||
public class BmUnitInfoController extends BaseController{
|
||||
public class BmUnitInfoController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private BmUnitInfoService bmUnitInfoService;
|
||||
|
|
@ -46,31 +46,30 @@ public class BmUnitInfoController extends BaseController{
|
|||
@ApiOperation(value = "获取往来单位列表")
|
||||
@GetMapping("/unitInfoAll")
|
||||
@RequiresPermissions("comeAndGo:list")
|
||||
public TableDataInfo getUnitInfoAll(BmUnitInfo bmUnitInfo)
|
||||
{
|
||||
public TableDataInfo getUnitInfoAll(BmUnitInfo bmUnitInfo) {
|
||||
startPage();
|
||||
List<BmUnitInfo> list = bmUnitInfoService.getUnitInfoAll(bmUnitInfo);
|
||||
return getDataTable(list);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询单位类型配置表bm_unit_type(同数据字典合并)列表
|
||||
*/
|
||||
@ApiOperation("查询单位类型")
|
||||
@GetMapping("/typeList")
|
||||
public TableDataInfo typeList(BmUnitInfo bmUnitInfo)
|
||||
{
|
||||
public TableDataInfo typeList(BmUnitInfo bmUnitInfo) {
|
||||
startPage();
|
||||
List<BmUnitInfo> list = bmUnitInfoService.selectTypeList(bmUnitInfo);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询单位类型配置表bm_unit_type(同数据字典合并)列表
|
||||
*/
|
||||
@ApiOperation("查询单位类型")
|
||||
@GetMapping("/userList")
|
||||
public TableDataInfo UserAll(SysUser sysUser)
|
||||
{
|
||||
public TableDataInfo UserAll(SysUser sysUser) {
|
||||
startPage();
|
||||
List<SysUser> list = bmUnitInfoService.getUserAll(sysUser);
|
||||
return getDataTable(list);
|
||||
|
|
@ -81,8 +80,7 @@ public class BmUnitInfoController extends BaseController{
|
|||
*/
|
||||
@ApiOperation(value = "获取往来单位下拉选")
|
||||
@GetMapping("/getUnitInfoSelect")
|
||||
public AjaxResult getUnitInfoSelect(BmUnitInfo bmUnitInfo)
|
||||
{
|
||||
public AjaxResult getUnitInfoSelect(BmUnitInfo bmUnitInfo) {
|
||||
List<BmUnitInfo> list = bmUnitInfoService.getUnitInfoAll(bmUnitInfo);
|
||||
return AjaxResult.success(list);
|
||||
|
||||
|
|
@ -93,13 +91,13 @@ public class BmUnitInfoController extends BaseController{
|
|||
* 根据条件进行查询往来单位
|
||||
*/
|
||||
@ApiOperation(value = "根据条件进行查询往来单位")
|
||||
@PostMapping ("/getUnitInfo")
|
||||
public TableDataInfo getUnitInfo(@Validated @RequestBody BmUnitInfo bmUnitInfo)
|
||||
{
|
||||
@PostMapping("/getUnitInfo")
|
||||
public TableDataInfo getUnitInfo(@Validated @RequestBody BmUnitInfo bmUnitInfo) {
|
||||
startPage();
|
||||
List<BmUnitInfo> list = bmUnitInfoService.getUnitInfo(bmUnitInfo);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增往来单位
|
||||
*/
|
||||
|
|
@ -107,8 +105,7 @@ public class BmUnitInfoController extends BaseController{
|
|||
@Log(title = "参数管理", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
@RequiresPermissions("comeAndGo:list:add")
|
||||
public AjaxResult unitInfoAdd(@Validated @RequestBody BmUnitInfo bmUnitInfo)
|
||||
{
|
||||
public AjaxResult unitInfoAdd(@Validated @RequestBody BmUnitInfo bmUnitInfo) {
|
||||
log.info("新增往来单位参数:{}", bmUnitInfo);
|
||||
return bmUnitInfoService.unitInfoAdd(bmUnitInfo);
|
||||
}
|
||||
|
|
@ -125,14 +122,18 @@ public class BmUnitInfoController extends BaseController{
|
|||
}
|
||||
|
||||
*/
|
||||
|
||||
/**
|
||||
* 批量删除往来单位
|
||||
*/
|
||||
@ApiOperation(value = "批量删除往来单位")
|
||||
@Log(title = "参数管理", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping ("/{unitId}")
|
||||
public AjaxResult deleteUnitInfoById(@PathVariable Long unitId)
|
||||
{
|
||||
@DeleteMapping("/{unitId}")
|
||||
public AjaxResult deleteUnitInfoById(@PathVariable Long unitId) {
|
||||
// 首先判断是否已经绑定了二级库
|
||||
if (bmUnitInfoService.selectUnitBind(unitId) > 0) {
|
||||
return AjaxResult.error("该往来单位已绑定二级库,无法删除");
|
||||
}
|
||||
bmUnitInfoService.deleteUnitInfoById(unitId);
|
||||
return success();
|
||||
}
|
||||
|
|
@ -143,17 +144,16 @@ public class BmUnitInfoController extends BaseController{
|
|||
@ApiOperation(value = "修改往来单位")
|
||||
@Log(title = "参数管理", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@Validated @RequestBody BmUnitInfo bmUnitInfo)
|
||||
{
|
||||
public AjaxResult edit(@Validated @RequestBody BmUnitInfo bmUnitInfo) {
|
||||
|
||||
return bmUnitInfoService.updateBmUnitInfo(bmUnitInfo);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "往来单位导出")
|
||||
@Log(title = "往来单位导出", businessType = BusinessType.EXPORT)
|
||||
@RequiresPermissions("system:user:export")
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, BmUnitInfo bmUnitInfo)
|
||||
{
|
||||
public void export(HttpServletResponse response, BmUnitInfo bmUnitInfo) {
|
||||
List<BmUnitInfo> list;
|
||||
list = bmUnitInfoService.getUnitInfoAll(bmUnitInfo);
|
||||
//根据前端列表选中选择性列表导出
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import com.bonus.sgzb.common.core.constant.Constants;
|
|||
import com.bonus.sgzb.common.core.utils.poi.ExcelUtil;
|
||||
import com.bonus.sgzb.common.core.web.controller.BaseController;
|
||||
import com.bonus.sgzb.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.sgzb.common.security.annotation.RequiresPermissions;
|
||||
import com.bonus.sgzb.common.security.utils.SecurityUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
|
@ -149,11 +150,12 @@ public class MaPartTypeController extends BaseController {
|
|||
* @param paId
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/{paId}")
|
||||
/* @GetMapping("/{paId}")
|
||||
@RequiresPermissions("base:maPartType:paId")
|
||||
public AjaxResult getById (@PathVariable("paId") Long paId){
|
||||
MaPartType bean = maPartTypeService.getById(paId);
|
||||
return AjaxResult.success(bean);
|
||||
}
|
||||
}*/
|
||||
|
||||
/**
|
||||
* 根据id修改数据
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import com.bonus.sgzb.base.service.MaTypeHisPriceService;
|
|||
import com.bonus.sgzb.common.core.web.controller.BaseController;
|
||||
import com.bonus.sgzb.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.sgzb.common.core.web.page.TableDataInfo;
|
||||
import com.bonus.sgzb.common.security.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
|
@ -45,21 +46,23 @@ public class MaTypeHisPriceController extends BaseController {
|
|||
/**
|
||||
* 删除机具历史租赁价格
|
||||
*/
|
||||
@DeleteMapping("/{typeIds}")
|
||||
/*@DeleteMapping("/{typeIds}")
|
||||
@RequiresPermissions("base:typeHisPrice:remove")
|
||||
public AjaxResult remove(@PathVariable Long[] typeIds)
|
||||
{
|
||||
maTypeHisPriceService.remove(typeIds);
|
||||
return success();
|
||||
}
|
||||
}*/
|
||||
|
||||
/**
|
||||
* 修改机机具历史租赁价格
|
||||
*/
|
||||
@PutMapping
|
||||
/* @PutMapping
|
||||
@RequiresPermissions("base:typeHisPrice:updateTypeHisPrice")
|
||||
public AjaxResult updateTypeHisPrice(@Validated @RequestBody MaTypeHisPrice maTypeHisPrice)
|
||||
{
|
||||
|
||||
return toAjax(maTypeHisPriceService.updateTypeHisPrice(maTypeHisPrice));
|
||||
}
|
||||
}*/
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,4 +21,6 @@ public interface BmUnitPersonMapper {
|
|||
public void remove(Long[] unitIds);
|
||||
|
||||
public int updateBmUnitPerson(BmUnitPerson bmUnitPerson);
|
||||
|
||||
Integer selectUnitBind(Long unitId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,4 +37,6 @@ public interface BmUnitInfoService {
|
|||
public int deleteUnitInfoById(Long unitId);
|
||||
|
||||
String importUser(List<BmUnitInfo> bmUnitInfoList, boolean updateSupport, Long userId);
|
||||
|
||||
Integer selectUnitBind(Long unitId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -92,4 +92,9 @@ public class BmUnitInfoServiceImpl implements BmUnitInfoService {
|
|||
}
|
||||
return "导入成功";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer selectUnitBind(Long unitId) {
|
||||
return bmUnitPersonMapper.selectUnitBind(unitId);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
|
@ -96,6 +97,9 @@ public class SecondaryWarehouseController extends BaseController {
|
|||
@ApiOperation(value = "班组库存台账")
|
||||
@GetMapping("/getDevStockCount")
|
||||
public TableDataInfo getDevStockCount(SecondaryWarehouse bean) {
|
||||
if (bean.getUnitId() == null) {
|
||||
return getDataTable(new ArrayList<>());
|
||||
}
|
||||
startPage();
|
||||
return getDataTable(service.getDevStockCount(bean));
|
||||
}
|
||||
|
|
@ -148,14 +152,14 @@ public class SecondaryWarehouseController extends BaseController {
|
|||
|
||||
@ApiOperation(value = "二级库报废申请")
|
||||
@PostMapping("/seconfScrap")
|
||||
public AjaxResult seconfScrap(SecondCcrapApplyDetails bean) {
|
||||
public AjaxResult seconfScrap(@RequestBody SecondCcrapApplyDetails bean) {
|
||||
Integer i = service.seconfScrap(bean);
|
||||
return toAjax(i);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "二级库报废审核(通过/驳回)")
|
||||
@PostMapping("/auditSeconfScrap")
|
||||
public AjaxResult auditSeconfScrap(SecondCcrapApplyDetails bean) {
|
||||
public AjaxResult auditSeconfScrap(@RequestBody SecondCcrapApplyDetails bean) {
|
||||
Integer i = service.auditSeconfScrap(bean);
|
||||
return toAjax(i);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -51,6 +51,7 @@ public class TeamLeaseInfo {
|
|||
*/
|
||||
private String startTime;
|
||||
private String endTime;
|
||||
private String auditRemark;
|
||||
private String companyId;
|
||||
/**
|
||||
* 协议id
|
||||
|
|
|
|||
|
|
@ -127,8 +127,9 @@ public class SecondaryWarehouseServiceImpl implements SecondaryWarehouseService
|
|||
if (bean.getType() == 2) {
|
||||
// for (String maId : bean.getMaIds().split(",")) {
|
||||
List<MaMachine> maMachine = mapper.getUseMaStatusByMaId(/*maId,*/ bean.getTeamGroupId(), bean.getUnitId());
|
||||
if (maMachine != null) {
|
||||
list.addAll(maMachine);
|
||||
List<MaMachine> maList = maMachine.stream().filter(t -> t.getReceiveNum() != 0).collect(Collectors.toList());
|
||||
if (maList != null) {
|
||||
list.addAll(maList);
|
||||
}
|
||||
// }
|
||||
}
|
||||
|
|
@ -174,6 +175,7 @@ public class SecondaryWarehouseServiceImpl implements SecondaryWarehouseService
|
|||
teamLeaseInfo.setScrapNum(1);
|
||||
teamLeaseInfo.setCode(code);
|
||||
teamLeaseInfo.setStatus(0);
|
||||
teamLeaseInfo.setAuditRemark(bean.getAuditRemark());
|
||||
num = mapper.secondScrapApplyDetails(teamLeaseInfo);
|
||||
}
|
||||
} else {
|
||||
|
|
@ -183,6 +185,7 @@ public class SecondaryWarehouseServiceImpl implements SecondaryWarehouseService
|
|||
teamLeaseInfo.setMaId(null);
|
||||
teamLeaseInfo.setCode(code);
|
||||
teamLeaseInfo.setStatus(0);
|
||||
teamLeaseInfo.setAuditRemark(bean.getAuditRemark());
|
||||
num = mapper.secondScrapApplyDetails(teamLeaseInfo);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -41,6 +41,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<include refid="bmUnitPerson"/>
|
||||
where unit_id = #{unitId}
|
||||
</select>
|
||||
<select id="selectUnitBind" resultType="java.lang.Integer">
|
||||
select count(1) from second_lot_config where unit_id = #{unitId}
|
||||
</select>
|
||||
|
||||
<insert id="unitPersonAdd" parameterType="com.bonus.sgzb.base.domain.BmUnitPerson">
|
||||
insert into bm_unit_person (
|
||||
|
|
|
|||
|
|
@ -360,6 +360,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="unitId != null">
|
||||
and rd.unit_id = #{unitId}
|
||||
</if>
|
||||
order by rd.out_time desc
|
||||
</select>
|
||||
<select id="selectStockNum1" resultType="java.lang.Integer">
|
||||
SELECT
|
||||
|
|
@ -511,57 +512,52 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
WHERE id = #{id}
|
||||
</select>
|
||||
<select id="getDevStockCount" resultType="com.bonus.sgzb.base.api.domain.MaMachine">
|
||||
|
||||
SELECT DISTINCT
|
||||
mt.type_name modelName,
|
||||
mt.manage_type manageType,
|
||||
mt2.type_name typeName,
|
||||
rd.type_id typeId,
|
||||
tg.NAME groupName,
|
||||
rd.parent_id AS id,
|
||||
slc.name as name,
|
||||
mt.unit_name AS unitName,
|
||||
mt.unit_name AS nuitName,
|
||||
SUM(rd.out_num) receiveNum,
|
||||
GROUP_CONCAT(rd.ma_id) maIds
|
||||
FROM (
|
||||
SELECT rd.*,
|
||||
(SELECT type1_count FROM (SELECT tc.ma_id, tc.type1_count FROM (SELECT rd.ma_id,
|
||||
SUM(CASE WHEN rd.type = '1' THEN 1 ELSE 0 END) AS type1_count,
|
||||
SUM(CASE WHEN rd.type = '2' THEN 1 ELSE 0 END) AS type2_count
|
||||
FROM receive_detail rd
|
||||
WHERE rd.type IN ('1', '2')
|
||||
<if test="unitId != null">
|
||||
AND rd.unit_id = #{unitId}
|
||||
</if>
|
||||
GROUP BY rd.ma_id) tc WHERE tc.ma_id = rd.ma_id) ttc) AS type1_count,
|
||||
(SELECT type2_count FROM (SELECT tc.ma_id, tc.type2_count FROM (SELECT rd.ma_id,
|
||||
SUM(CASE WHEN rd.type = '1' THEN 1 ELSE 0 END) AS type1_count,
|
||||
SUM(CASE WHEN rd.type = '2' THEN 1 ELSE 0 END) AS type2_count
|
||||
FROM receive_detail rd
|
||||
WHERE rd.type IN ('1', '2')
|
||||
<if test="unitId != null">
|
||||
AND rd.unit_id = #{unitId}
|
||||
</if>
|
||||
GROUP BY rd.ma_id) tc WHERE tc.ma_id = rd.ma_id) ttc) AS type2_count,
|
||||
SELECT
|
||||
rd.*,
|
||||
tc.type1_count,
|
||||
tc.type2_count,
|
||||
@rn := IF(@prev_ma_id = rd.ma_id AND @prev_type = rd.type, @rn + 1, 1) AS rn,
|
||||
@prev_ma_id := rd.ma_id,
|
||||
@prev_type := rd.type
|
||||
FROM receive_detail rd,
|
||||
(SELECT
|
||||
rd.ma_id,
|
||||
SUM(CASE WHEN rd.type = '1' THEN 1 ELSE 0 END) as type1_count,
|
||||
SUM(CASE WHEN rd.type = '2' THEN 1 ELSE 0 END) as type2_count
|
||||
FROM receive_detail rd
|
||||
WHERE rd.type IN ('1', '2')
|
||||
|
||||
<if test="unitId != null">
|
||||
AND rd.unit_id = #{unitId}
|
||||
</if>
|
||||
GROUP BY rd.ma_id) tc,
|
||||
(SELECT @prev_ma_id := NULL, @prev_type := NULL, @rn := 0) vars
|
||||
WHERE rd.type IN ('1', '2')
|
||||
<if test="unitId != null">
|
||||
AND rd.unit_id = #{unitId}
|
||||
</if>
|
||||
AND rd.ma_id = tc.ma_id
|
||||
ORDER BY rd.ma_id, rd.type, rd.out_num DESC
|
||||
) rd
|
||||
LEFT JOIN ma_machine mm ON rd.ma_id = mm.ma_id
|
||||
LEFT JOIN team_group tg ON rd.team_group_id = tg.id
|
||||
LEFT JOIN second_lot_config slc ON rd.unit_id = slc.unit_id
|
||||
LEFT JOIN ma_machine mm ON rd.ma_id = mm.ma_id
|
||||
LEFT JOIN ma_type mt ON mt.type_id = mm.type_id
|
||||
LEFT JOIN ma_type mt2 ON mt2.type_id = mt.parent_id
|
||||
WHERE mm.ma_status = 132
|
||||
<if test="keyword != null and keyword != ''">
|
||||
AND tg.NAME LIKE CONCAT('%', #{keyword}, '%')
|
||||
AND tg.NAME like concat('%', #{keyword}, '%')
|
||||
</if>
|
||||
AND ((rd.type = '1' AND rd.rn <= GREATEST(0, rd.type1_count - rd.type2_count))
|
||||
OR (rd.type = '2' AND rd.rn <= GREATEST(0, rd.type2_count - rd.type1_count)))
|
||||
|
|
@ -575,7 +571,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
mt2.type_name typeName,
|
||||
rd.type_id typeId,
|
||||
tg.NAME groupName,
|
||||
rd.parent_id as id,
|
||||
slc.name as name,
|
||||
mt.unit_name AS nuitName,
|
||||
(SUM(CASE WHEN rd.type = '1' THEN rd.out_num ELSE 0 END)
|
||||
|
|
@ -588,18 +583,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
LEFT JOIN ma_type mt2 ON mt2.type_id = mt.parent_id
|
||||
WHERE rd.type IN ('1', '2')
|
||||
AND rd.ma_id IS NULL
|
||||
<if test="keyword != null and keyword != ''">
|
||||
AND tg.NAME LIKE CONCAT('%', #{keyword}, '%')
|
||||
</if>
|
||||
<if test="unitId != null">
|
||||
AND rd.unit_id = #{unitId}
|
||||
AND rd.unit_id = #{unitId}
|
||||
</if>
|
||||
<if test="keyword != null and keyword != ''">
|
||||
AND tg.NAME like concat('%', #{keyword}, '%')
|
||||
</if>
|
||||
AND NOT EXISTS (
|
||||
SELECT 1
|
||||
FROM receive_detail rd2
|
||||
WHERE rd2.ma_id = rd.ma_id
|
||||
AND ((
|
||||
rd2.type = '1'
|
||||
AND ((rd2.type = '1'
|
||||
AND EXISTS (
|
||||
SELECT 1
|
||||
FROM receive_detail rd3
|
||||
|
|
@ -607,10 +601,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
AND rd3.type = '2'
|
||||
AND rd3.type_id = rd2.type_id
|
||||
AND rd3.team_group_id = rd2.team_group_id
|
||||
AND rd3.unit_id = rd2.unit_id
|
||||
))
|
||||
OR (
|
||||
rd2.type = '2'
|
||||
AND rd3.unit_id = rd2.unit_id))
|
||||
OR (rd2.type = '2'
|
||||
AND EXISTS (
|
||||
SELECT 1
|
||||
FROM receive_detail rd4
|
||||
|
|
@ -618,8 +610,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
AND rd4.type = '1'
|
||||
AND rd4.type_id = rd2.type_id
|
||||
AND rd4.team_group_id = rd2.team_group_id
|
||||
AND rd4.unit_id = rd2.unit_id
|
||||
)))
|
||||
AND rd4.unit_id = rd2.unit_id)))
|
||||
)
|
||||
GROUP BY rd.type_id, rd.parent_id
|
||||
</select>
|
||||
|
|
|
|||
Loading…
Reference in New Issue