Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
2410c20a0c
|
|
@ -1,5 +1,6 @@
|
||||||
package com.bonus.material.basic.controller;
|
package com.bonus.material.basic.controller;
|
||||||
|
|
||||||
|
import com.bonus.common.biz.enums.HttpCodeEnum;
|
||||||
import com.bonus.common.core.web.page.TableDataInfo;
|
import com.bonus.common.core.web.page.TableDataInfo;
|
||||||
import com.bonus.common.log.enums.OperaType;
|
import com.bonus.common.log.enums.OperaType;
|
||||||
import com.bonus.material.basic.domain.BmUnit;
|
import com.bonus.material.basic.domain.BmUnit;
|
||||||
|
|
@ -44,6 +45,19 @@ public class BmUnitPersonController extends BaseController
|
||||||
return getDataTable(list);
|
return getDataTable(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 统计往来单位人员
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "统计往来单位人员")
|
||||||
|
@RequiresPermissions("basic:person:list")
|
||||||
|
@SysLog(title = "往来单位管理", businessType = OperaType.QUERY, logType = 1,module = "仓储管理->统计往来单位人员")
|
||||||
|
@GetMapping("/{unitId}")
|
||||||
|
public AjaxResult countBmUnitPersonByUnitId(@PathVariable Long unitId)
|
||||||
|
{
|
||||||
|
int result = bmUnitPersonService.countBmUnitPersonByUnitId(unitId);
|
||||||
|
return AjaxResult.success(HttpCodeEnum.SUCCESS.getMsg(), result);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 绑定往来单位人员列表
|
* 绑定往来单位人员列表
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -71,5 +71,5 @@ public interface BmUnitMapper
|
||||||
* @param unitId
|
* @param unitId
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
Integer selectBmUnitPersonByUnitId(Long unitId);
|
Integer countBmUnitPersonByUnitId(Long unitId);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -37,4 +37,6 @@ public interface IBmUnitPersonService
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<BmUnit> selectBmUnitList(BmUnitPerson bmUnitPerson);
|
List<BmUnit> selectBmUnitList(BmUnitPerson bmUnitPerson);
|
||||||
|
|
||||||
|
int countBmUnitPersonByUnitId(Long unitId);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -116,7 +116,7 @@ public class BmUnitPersonServiceImpl implements IBmUnitPersonService
|
||||||
}
|
}
|
||||||
if (item.getUnitId() != null) {
|
if (item.getUnitId() != null) {
|
||||||
//根据单位id去人员绑定中查询是否绑定,赋值绑定状态
|
//根据单位id去人员绑定中查询是否绑定,赋值绑定状态
|
||||||
item.setIsBind(bmUnitMapper.selectBmUnitPersonByUnitId(item.getUnitId()) > 0 ? 1 : 0);
|
item.setIsBind(bmUnitMapper.countBmUnitPersonByUnitId(item.getUnitId()) > 0 ? 1 : 0);
|
||||||
}
|
}
|
||||||
extracted(item);
|
extracted(item);
|
||||||
});
|
});
|
||||||
|
|
@ -124,6 +124,11 @@ public class BmUnitPersonServiceImpl implements IBmUnitPersonService
|
||||||
return bmUnitList;
|
return bmUnitList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int countBmUnitPersonByUnitId(Long unitId) {
|
||||||
|
return bmUnitMapper.countBmUnitPersonByUnitId(unitId);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 方法抽取
|
* 方法抽取
|
||||||
* @param unit
|
* @param unit
|
||||||
|
|
@ -132,7 +137,7 @@ public class BmUnitPersonServiceImpl implements IBmUnitPersonService
|
||||||
Map<String, String> labelMap = remoteConfig.getDictValue("bm_unit_type");
|
Map<String, String> labelMap = remoteConfig.getDictValue("bm_unit_type");
|
||||||
if (unit.getUnitId() != null) {
|
if (unit.getUnitId() != null) {
|
||||||
//根据单位id去人员绑定中查询是否绑定,赋值绑定状态
|
//根据单位id去人员绑定中查询是否绑定,赋值绑定状态
|
||||||
unit.setIsBind(bmUnitMapper.selectBmUnitPersonByUnitId(unit.getUnitId()) > 0 ? 1 : 0);
|
unit.setIsBind(bmUnitMapper.countBmUnitPersonByUnitId(unit.getUnitId()) > 0 ? 1 : 0);
|
||||||
}
|
}
|
||||||
if (unit.getTypeId() != null) {
|
if (unit.getTypeId() != null) {
|
||||||
unit.setTypeName(labelMap.get(unit.getTypeId().toString()) == null ? "" : labelMap.get(unit.getTypeId().toString()));
|
unit.setTypeName(labelMap.get(unit.getTypeId().toString()) == null ? "" : labelMap.get(unit.getTypeId().toString()));
|
||||||
|
|
|
||||||
|
|
@ -87,7 +87,7 @@ public class BmUnitServiceImpl implements IBmUnitService
|
||||||
Map<String, String> labelMap = remoteConfig.getDictValue("bm_unit_type");
|
Map<String, String> labelMap = remoteConfig.getDictValue("bm_unit_type");
|
||||||
if (unit.getUnitId() != null) {
|
if (unit.getUnitId() != null) {
|
||||||
//根据单位id去人员绑定中查询是否绑定,赋值绑定状态
|
//根据单位id去人员绑定中查询是否绑定,赋值绑定状态
|
||||||
unit.setIsBind(bmUnitMapper.selectBmUnitPersonByUnitId(unit.getUnitId()) > 0 ? 1 : 0);
|
unit.setIsBind(bmUnitMapper.countBmUnitPersonByUnitId(unit.getUnitId()) > 0 ? 1 : 0);
|
||||||
}
|
}
|
||||||
if (unit.getTypeId() != null) {
|
if (unit.getTypeId() != null) {
|
||||||
unit.setTypeName(labelMap.get(unit.getTypeId().toString()) == null ? "" : labelMap.get(unit.getTypeId().toString()));
|
unit.setTypeName(labelMap.get(unit.getTypeId().toString()) == null ? "" : labelMap.get(unit.getTypeId().toString()));
|
||||||
|
|
@ -189,7 +189,7 @@ public class BmUnitServiceImpl implements IBmUnitService
|
||||||
public AjaxResult deleteBmUnitByUnitId(Long unitId)
|
public AjaxResult deleteBmUnitByUnitId(Long unitId)
|
||||||
{
|
{
|
||||||
//先查看往来单位是否被绑定,绑定则不能删除
|
//先查看往来单位是否被绑定,绑定则不能删除
|
||||||
if (bmUnitMapper.selectBmUnitPersonByUnitId(unitId) > 0) {
|
if (bmUnitMapper.countBmUnitPersonByUnitId(unitId) > 0) {
|
||||||
return AjaxResult.error(HttpCodeEnum.FAIL.getCode(), "该单位还绑定相关人员,无法删除");
|
return AjaxResult.error(HttpCodeEnum.FAIL.getCode(), "该单位还绑定相关人员,无法删除");
|
||||||
}
|
}
|
||||||
int result = bmUnitMapper.deleteBmUnitByUnitId(unitId);
|
int result = bmUnitMapper.deleteBmUnitByUnitId(unitId);
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,7 @@ public class Type extends BaseEntity {
|
||||||
/** 实时库存 */
|
/** 实时库存 */
|
||||||
@Excel(name = "实时库存")
|
@Excel(name = "实时库存")
|
||||||
@ApiModelProperty(value = "实时库存")
|
@ApiModelProperty(value = "实时库存")
|
||||||
private Long storageNum = 0L;
|
private Long storageNum;
|
||||||
|
|
||||||
/** 是否扣费 */
|
/** 是否扣费 */
|
||||||
@ApiModelProperty(value = "是否扣费,0:扣费, 1:不扣费")
|
@ApiModelProperty(value = "是否扣费,0:扣费, 1:不扣费")
|
||||||
|
|
|
||||||
|
|
@ -19,11 +19,13 @@ public class WhHouseInfo extends BaseEntity {
|
||||||
private static final long serialVersionUID = -6993602646196064834L;
|
private static final long serialVersionUID = -6993602646196064834L;
|
||||||
|
|
||||||
/** 仓库ID */
|
/** 仓库ID */
|
||||||
|
@Excel(name = "仓库ID")
|
||||||
|
@ApiModelProperty(value = "仓库ID")
|
||||||
private Long houseId;
|
private Long houseId;
|
||||||
|
|
||||||
/** 工程项目名称 */
|
/** 仓库名称 */
|
||||||
@Excel(name = "工程项目名称")
|
@Excel(name = "仓库名称")
|
||||||
@ApiModelProperty(value = "工程项目名称")
|
@ApiModelProperty(value = "仓库名称")
|
||||||
private String houseName;
|
private String houseName;
|
||||||
|
|
||||||
/** 实物库名称 */
|
/** 实物库名称 */
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
select unit_id as unitId, unit_name as unitName from bm_unit where del_flag = 0 and unit_name = #{unitName}
|
select unit_id as unitId, unit_name as unitName from bm_unit where del_flag = 0 and unit_name = #{unitName}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectBmUnitPersonByUnitId" resultType="java.lang.Integer">
|
<select id="countBmUnitPersonByUnitId" resultType="java.lang.Integer">
|
||||||
select count(1) from bm_unit_person where unit_id = #{unitId}
|
select count(1) from bm_unit_person where unit_id = #{unitId}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue