联调问题
This commit is contained in:
parent
89045e34dc
commit
44c4bc3032
|
|
@ -48,9 +48,9 @@ public class DayPlanController extends BaseController {
|
||||||
//新增日计划
|
//新增日计划
|
||||||
@PreAuthorize("@ss.hasPermi('day:plan:add')")
|
@PreAuthorize("@ss.hasPermi('day:plan:add')")
|
||||||
@PostMapping("/addDayPlan")
|
@PostMapping("/addDayPlan")
|
||||||
public AjaxResult addMonthlyPlan(@RequestBody DayPlanVo dayPlanVo) {
|
public AjaxResult addMonthlyPlan(@RequestBody List<DayPlanVo> dayPlanVoList) {
|
||||||
try {
|
try {
|
||||||
int res = dayPlanService.addMonthlyPlan(dayPlanVo);
|
int res = dayPlanService.addMonthlyPlan(dayPlanVoList);
|
||||||
if (res > 0) {
|
if (res > 0) {
|
||||||
return AjaxResult.success();
|
return AjaxResult.success();
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -51,9 +51,12 @@ public class InspectionStationController extends BaseController {
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
int res = inspectionStationService.addInspectionStation(inspectionStationVo);
|
int res = inspectionStationService.addInspectionStation(inspectionStationVo);
|
||||||
if (res > 0) {
|
if (res == 1) {
|
||||||
return AjaxResult.success();
|
return AjaxResult.success();
|
||||||
}else {
|
} else if (res == 2) {
|
||||||
|
return AjaxResult.error("名称已经存在");
|
||||||
|
}
|
||||||
|
else {
|
||||||
return AjaxResult.error("新增失败");
|
return AjaxResult.error("新增失败");
|
||||||
}
|
}
|
||||||
}catch (Exception e) {
|
}catch (Exception e) {
|
||||||
|
|
@ -89,8 +92,10 @@ public class InspectionStationController extends BaseController {
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
int res = inspectionStationService.updateInspectionStation(inspectionStationVo);
|
int res = inspectionStationService.updateInspectionStation(inspectionStationVo);
|
||||||
if (res > 0) {
|
if (res == 1) {
|
||||||
return AjaxResult.success();
|
return AjaxResult.success();
|
||||||
|
} else if (res == 2) {
|
||||||
|
return AjaxResult.error("名称已经存在");
|
||||||
}else {
|
}else {
|
||||||
return AjaxResult.error("修改失败");
|
return AjaxResult.error("修改失败");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -26,4 +26,6 @@ public interface InspectionStationMapper {
|
||||||
int updateInspectionStation(InspectionStationVo inspectionStationVo);
|
int updateInspectionStation(InspectionStationVo inspectionStationVo);
|
||||||
|
|
||||||
InspectionStationVo getInspectionStationDetail(InspectionStationVo inspectionStationVo);
|
InspectionStationVo getInspectionStationDetail(InspectionStationVo inspectionStationVo);
|
||||||
|
|
||||||
|
InspectionStationVo getInspectionStation(InspectionStationVo inspectionStationVo);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ import java.util.List;
|
||||||
*/
|
*/
|
||||||
public interface DayPlanService {
|
public interface DayPlanService {
|
||||||
|
|
||||||
int addMonthlyPlan(DayPlanVo dayPlanVo);
|
int addMonthlyPlan(List<DayPlanVo> dayPlanVo);
|
||||||
|
|
||||||
int delDayPlan(DayPlanVo dayPlanVo);
|
int delDayPlan(DayPlanVo dayPlanVo);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@ import com.bonus.digital.dao.WorkloadSummaryExcelVo;
|
||||||
import com.bonus.digital.mapper.DayPlanMapper;
|
import com.bonus.digital.mapper.DayPlanMapper;
|
||||||
import com.bonus.digital.service.DayPlanService;
|
import com.bonus.digital.service.DayPlanService;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
@ -21,11 +22,16 @@ import java.util.List;
|
||||||
public class DayPlanServiceImpl implements DayPlanService {
|
public class DayPlanServiceImpl implements DayPlanService {
|
||||||
@Resource
|
@Resource
|
||||||
private DayPlanMapper dayPlanMapper;
|
private DayPlanMapper dayPlanMapper;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int addMonthlyPlan(DayPlanVo dayPlanVo) {
|
@Transactional
|
||||||
dayPlanVo.setCreateUser(SecurityUtils.getUserId().toString());
|
public int addMonthlyPlan(List<DayPlanVo> dayPlanVo) {
|
||||||
dayPlanVo.setCreateTime(new Date());
|
for (DayPlanVo dayPlanVo1 : dayPlanVo) {
|
||||||
return dayPlanMapper.addMonthlyPlan(dayPlanVo);
|
dayPlanVo1.setCreateUser(SecurityUtils.getUserId().toString());
|
||||||
|
dayPlanVo1.setCreateTime(new Date());
|
||||||
|
dayPlanMapper.addMonthlyPlan(dayPlanVo1);
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
|
|
@ -40,6 +40,10 @@ public class InspectionStationServiceImpl implements InspectionStationService {
|
||||||
Long userId = SecurityUtils.getUserId();
|
Long userId = SecurityUtils.getUserId();
|
||||||
inspectionStationVo.setCreateUser(userId.toString());
|
inspectionStationVo.setCreateUser(userId.toString());
|
||||||
inspectionStationVo.setCreateTime(new Date());
|
inspectionStationVo.setCreateTime(new Date());
|
||||||
|
InspectionStationVo res = inspectionStationMapper.getInspectionStation(inspectionStationVo);
|
||||||
|
if (res != null) {
|
||||||
|
return 2;
|
||||||
|
}
|
||||||
return inspectionStationMapper.addInspectionStation(inspectionStationVo);
|
return inspectionStationMapper.addInspectionStation(inspectionStationVo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -59,6 +63,10 @@ public class InspectionStationServiceImpl implements InspectionStationService {
|
||||||
Long userId = SecurityUtils.getUserId();
|
Long userId = SecurityUtils.getUserId();
|
||||||
inspectionStationVo.setUpdateUser(userId.toString());
|
inspectionStationVo.setUpdateUser(userId.toString());
|
||||||
inspectionStationVo.setUpdateTime(new Date());
|
inspectionStationVo.setUpdateTime(new Date());
|
||||||
|
InspectionStationVo res = inspectionStationMapper.getInspectionStation(inspectionStationVo);
|
||||||
|
if (res != null && inspectionStationVo.getInspectionStationId()!=res.getInspectionStationId()) {
|
||||||
|
return 2;
|
||||||
|
}
|
||||||
return inspectionStationMapper.updateInspectionStation(inspectionStationVo);
|
return inspectionStationMapper.updateInspectionStation(inspectionStationVo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -40,4 +40,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
select inspection_station_id,inspection_station_name,remark,category
|
select inspection_station_id,inspection_station_name,remark,category
|
||||||
from tb_inspection_station where inspection_station_name = #{inspectionStationName} and is_active = '1'
|
from tb_inspection_station where inspection_station_name = #{inspectionStationName} and is_active = '1'
|
||||||
</select>
|
</select>
|
||||||
|
<select id="getInspectionStation" resultType="com.bonus.digital.dao.InspectionStationVo">
|
||||||
|
select inspection_station_id,inspection_station_name,remark,category
|
||||||
|
from tb_inspection_station where category = #{category} and is_active = '1' and
|
||||||
|
inspection_station_name = #{inspectionStationName}
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue