This commit is contained in:
mashuai 2024-04-20 13:55:53 +08:00
parent 5a88bafd89
commit 264bd77a41
21 changed files with 73 additions and 37 deletions

View File

@ -112,7 +112,7 @@ public class BmProjectInfoController extends BaseController{
public AjaxResult edit(@Validated @RequestBody BmProjectInfo bmProjectInfo)
{
return toAjax(bmProjectInfoService.updateBmProjectInfo(bmProjectInfo));
return bmProjectInfoService.updateBmProjectInfo(bmProjectInfo);
}
@Log(title = "项目管理导出", businessType = BusinessType.EXPORT)

View File

@ -85,7 +85,7 @@ public class BmProjectLotController extends BaseController {
@PutMapping
public AjaxResult edit(@Validated @RequestBody BmProjectLot bmProjectLot) {
return toAjax(bmProjectLotService.updateBmProjectLot(bmProjectLot));
return bmProjectLotService.updateBmProjectLot(bmProjectLot);
}
}

View File

@ -14,6 +14,7 @@ import com.bonus.sgzb.common.security.utils.SecurityUtils;
import com.bonus.sgzb.system.api.domain.SysUser;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
@ -33,6 +34,7 @@ import java.util.stream.Collectors;
@Api(tags = "往来单位")
@RestController
@RequestMapping("/bmUnitInfo")
@Slf4j
public class BmUnitInfoController extends BaseController{
@Autowired
@ -106,6 +108,7 @@ public class BmUnitInfoController extends BaseController{
@PostMapping
public AjaxResult unitInfoAdd(@Validated @RequestBody BmUnitInfo bmUnitInfo)
{
log.info("新增往来单位参数:{}", bmUnitInfo);
return bmUnitInfoService.unitInfoAdd(bmUnitInfo);
}

View File

@ -21,5 +21,5 @@ public interface BmProjectInfoMapper {
public int deleteProjectInfoById(Long proId);
int selectByName(String proName);
BmProjectInfo selectByName(String proName);
}

View File

@ -20,5 +20,5 @@ public interface BmProjectLotMapper {
public int deleteProjectLotById(Long lotId);
int selectByName(String lotName);
BmProjectLot selectByName(String lotName);
}

View File

@ -26,5 +26,5 @@ public interface BmUnitInfoMapper {
public int deleteUnitInfoById(Long unitId);
Integer selectByName(String unitName);
BmUnitInfo selectByName(String unitName);
}

View File

@ -82,5 +82,5 @@ public interface SysDicMapper
* @param name
* @return
*/
Integer selectByName(String name);
SysDic selectByName(String name);
}

View File

@ -16,7 +16,7 @@ public interface BmProjectInfoService {
public void remove(Long[] proIds);
public int updateBmProjectInfo(BmProjectInfo bmProjectInfo);
public AjaxResult updateBmProjectInfo(BmProjectInfo bmProjectInfo);
public int deleteProjectInfoById(Long proId);

View File

@ -15,7 +15,7 @@ public interface BmProjectLotService {
public void remove(Long[] proIds);
public int updateBmProjectLot(BmProjectLot bmProjectLot);
public AjaxResult updateBmProjectLot(BmProjectLot bmProjectLot);
public int deleteProjectLotById(Long lotId);

View File

@ -34,8 +34,8 @@ public class BmProjectInfoServiceImpl implements BmProjectInfoService {
@Override
public AjaxResult projectInfoAdd(BmProjectInfo bmProjectInfo) {
int count = bmProjectInfoMapper.selectByName(bmProjectInfo.getProName());
if (count != 0) {
BmProjectInfo info = bmProjectInfoMapper.selectByName(bmProjectInfo.getProName());
if (StringUtils.isNotNull(info)) {
return AjaxResult.error("新增工程项目名称重复,请重新提交!!!");
}
return AjaxResult.success(bmProjectInfoMapper.projectInfoAdd(bmProjectInfo));
@ -47,8 +47,14 @@ public class BmProjectInfoServiceImpl implements BmProjectInfoService {
}
@Override
public int updateBmProjectInfo(BmProjectInfo bmProjectInfo) {
return bmProjectInfoMapper.updateBmProjectInfo(bmProjectInfo);
public AjaxResult updateBmProjectInfo(BmProjectInfo bmProjectInfo) {
if (StringUtils.isNotEmpty(bmProjectInfo.getProName())) {
BmProjectInfo info = bmProjectInfoMapper.selectByName(bmProjectInfo.getProName());
if (StringUtils.isNotNull(info) && info.getProId() != bmProjectInfo.getProId()) {
return AjaxResult.error("修改工程项目名称重复,请重新提交!!!");
}
}
return AjaxResult.success(bmProjectInfoMapper.updateBmProjectInfo(bmProjectInfo));
}
@Override

View File

@ -4,6 +4,7 @@ package com.bonus.sgzb.base.service.impl;
import com.bonus.sgzb.base.domain.BmProjectLot;
import com.bonus.sgzb.base.mapper.BmProjectLotMapper;
import com.bonus.sgzb.base.service.BmProjectLotService;
import com.bonus.sgzb.common.core.utils.StringUtils;
import com.bonus.sgzb.common.core.web.domain.AjaxResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -30,8 +31,8 @@ public class BmProjectLotServiceImpl implements BmProjectLotService {
@Override
public AjaxResult projectLotAdd(BmProjectLot bmProjectLot) {
int count = bmProjectLotMapper.selectByName(bmProjectLot.getLotName());
if (count != 0) {
BmProjectLot info = bmProjectLotMapper.selectByName(bmProjectLot.getLotName());
if (StringUtils.isNotNull(info)) {
return AjaxResult.error("新增标段工程名称重复,请重新提交!!!");
}
return AjaxResult.success(bmProjectLotMapper.projectLotAdd(bmProjectLot));
@ -43,8 +44,14 @@ public class BmProjectLotServiceImpl implements BmProjectLotService {
}
@Override
public int updateBmProjectLot(BmProjectLot bmProjectLot) {
return bmProjectLotMapper.updateBmProjectLot(bmProjectLot);
public AjaxResult updateBmProjectLot(BmProjectLot bmProjectLot) {
if (StringUtils.isNotEmpty(bmProjectLot.getLotName())) {
BmProjectLot info = bmProjectLotMapper.selectByName(bmProjectLot.getLotName());
if (StringUtils.isNotNull(info) && info.getLotId() != bmProjectLot.getLotId()) {
return AjaxResult.error("修改标段工程名称重复,请重新提交!!!");
}
}
return AjaxResult.success(bmProjectLotMapper.updateBmProjectLot(bmProjectLot));
}
@Override

View File

@ -46,8 +46,8 @@ public class BmUnitInfoServiceImpl implements BmUnitInfoService {
@Override
public AjaxResult unitInfoAdd(BmUnitInfo bmUnitInfo) {
Integer count = bmUnitInfoMapper.selectByName(bmUnitInfo.getUnitName());
if (count != 0) {
BmUnitInfo info = bmUnitInfoMapper.selectByName(bmUnitInfo.getUnitName());
if (StringUtils.isNotNull(info)) {
return AjaxResult.error("新增往来单位名称重复,请重新提交!!!");
}
return AjaxResult.success(bmUnitInfoMapper.unitInfoAdd(bmUnitInfo));
@ -60,9 +60,11 @@ public class BmUnitInfoServiceImpl implements BmUnitInfoService {
@Override
public AjaxResult updateBmUnitInfo(BmUnitInfo bmUnitInfo) {
Integer count = bmUnitInfoMapper.selectByName(bmUnitInfo.getUnitName());
if (count != 0) {
return AjaxResult.error("往来单位名称已经存在,请重新修改提交!!!");
if (StringUtils.isNotEmpty(bmUnitInfo.getUnitName())) {
BmUnitInfo info = bmUnitInfoMapper.selectByName(bmUnitInfo.getUnitName());
if (StringUtils.isNotNull(info) && info.getUnitId() != bmUnitInfo.getUnitId()) {
return AjaxResult.error("往来单位名称已经存在,请重新修改提交!!!");
}
}
return AjaxResult.success(bmUnitInfoMapper.updateBmUnitInfo(bmUnitInfo));
}

View File

@ -7,6 +7,7 @@ import com.bonus.sgzb.base.domain.BmUnitType;
import com.bonus.sgzb.base.mapper.SysDicMapper;
import com.bonus.sgzb.base.service.ISysDicService;
import com.bonus.sgzb.common.core.utils.DateUtils;
import com.bonus.sgzb.common.core.utils.StringUtils;
import com.bonus.sgzb.common.core.web.domain.AjaxResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -79,8 +80,8 @@ public class SysDicServiceImpl implements ISysDicService
public AjaxResult insertSysDic(SysDic sysDic)
{
sysDic.setCreateTime(DateUtils.getNowDate());
Integer count = sysDicMapper.selectByName(sysDic.getName());
if (count != 0) {
SysDic info = sysDicMapper.selectByName(sysDic.getName());
if (StringUtils.isNotNull(info)) {
return AjaxResult.error("新增单位类型名称重复,请重新提交!!!");
}
return AjaxResult.success(sysDicMapper.insertSysDic(sysDic));
@ -95,8 +96,8 @@ public class SysDicServiceImpl implements ISysDicService
@Override
public AjaxResult updateSysDic(SysDic sysDic)
{
Integer count = sysDicMapper.selectByName(sysDic.getName());
if (count != 0) {
SysDic info = sysDicMapper.selectByName(sysDic.getName());
if (StringUtils.isNotNull(info) && info.getId().longValue() != sysDic.getId()) {
return AjaxResult.error("单位类型名称已经存在,请重新修改提交!!!");
}
return AjaxResult.success(sysDicMapper.updateSysDic(sysDic));

View File

@ -138,8 +138,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and a.company_id = #{companyId}
</if>
</select>
<select id="selectByName" resultType="java.lang.Integer">
select count(*) from bm_project_info
<select id="selectByName" resultType="com.bonus.sgzb.base.domain.BmProjectInfo">
select * from bm_project_info
where
1 = 1
<if test="proName != null and proName != ''">and pro_name = #{proName}</if>

View File

@ -86,12 +86,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</if>
ORDER BY a.lot_id DESC
</select>
<select id="selectByName" resultType="java.lang.Integer">
select count(*) from bm_project_lot
<select id="selectByName" resultType="com.bonus.sgzb.base.domain.BmProjectLot">
select * from bm_project_lot
where
1 = 1
<if test="lotName != null and lotName != ''">and lot_name = #{lotName}</if>
</select>
<insert id="projectLotAdd" parameterType="com.bonus.sgzb.base.domain.BmProjectLot">
insert into bm_project_lot (
<if test="lotName != null and lotName != '' ">lot_name,</if>

View File

@ -171,8 +171,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
AND type_name = #{typeName}
</if>
</select>
<select id="selectByName" resultType="java.lang.Integer">
select count(*) from bm_unit_info
<select id="selectByName" resultType="com.bonus.sgzb.base.domain.BmUnitInfo">
select * from bm_unit_info
where
1 = 1
<if test="unitName != null and unitName != '' ">and unit_name = #{unitName}</if>

View File

@ -63,12 +63,13 @@
<include refid="selectSysDicVo"/>
where id = '0'
</select>
<select id="selectByName" resultType="java.lang.Integer">
select count(*) from sys_dic
where
1 = 1
<if test="name != null and name != ''">and name = #{name}</if>
<select id="selectByName" resultType="com.bonus.sgzb.base.api.domain.SysDic">
select * from sys_dic
where
1 = 1
<if test="name != null and name != ''">and name = #{name}</if>
</select>
<insert id="insertSysDic" parameterType="com.bonus.sgzb.base.api.domain.SysDic">
insert into sys_dic
<trim prefix="(" suffix=")" suffixOverrides=",">

View File

@ -130,7 +130,7 @@ public class PlanManagementController extends BaseController {
*/
@ApiOperation("根据id删除计划管理")
@DeleteMapping("/deleteById/{planId}")
public AjaxResult addOrUpdate(@PathVariable(name = "计划ID",value = "planId") Long planId){
public AjaxResult addOrUpdate(@PathVariable(value = "planId") Long planId){
return AjaxResult.success(planManagementService.deleteById(planId));
}

View File

@ -7,6 +7,7 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
import java.util.List;
/**
* @author lsun
@ -129,4 +130,9 @@ public class AgreementInfo extends BaseEntity {
private String cost;
@ApiModelProperty(value = "结算状态")
private String sltStatus;
/** 导出选中列表 */
@ApiModelProperty(value = "导出选中列表")
private List<Long> dataCondition;
}

View File

@ -121,6 +121,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="projectId != null and projectId != ''">
and bp.lot_id = #{projectId}
</if>
<if test="dataCondition != null and dataCondition.size()>0">
AND bai.agreement_id in
<foreach collection="dataCondition" item="agreementId" index="index" open="(" separator="," close=")">
#{agreementId}
</foreach>
</if>
ORDER BY bai.agreement_id DESC
</select>

View File

@ -688,6 +688,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="time != null and time != ''">
and bai.back_time =#{time}
</if>
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
<![CDATA[AND DATE_FORMAT( bai.back_time, '%Y-%m-%d' ) BETWEEN #{startTime} AND #{endTime} ]]>
</if>
GROUP BY bai.id, us.user_name, bai.phone, bpl.lot_name, bui.unit_name, bagi.plan_start_time
ORDER BY bai.create_time desc
</select>