Browse Source

公众号页面相关接口

master
qushutong 1 year ago
parent
commit
5e36c6690c
  1. 28
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/ScreenEnterpriseOutputController.java
  2. 2
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/ScreenEnterpriseOutputService.java
  3. 16
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/ScreenEnterpriseOutputServiceImpl.java

28
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/ScreenEnterpriseOutputController.java

@ -24,12 +24,14 @@ import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.commons.tools.validator.group.AddGroup; import com.epmet.commons.tools.validator.group.AddGroup;
import com.epmet.commons.tools.validator.group.DefaultGroup; import com.epmet.commons.tools.validator.group.DefaultGroup;
import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.modules.partymember.entity.ScreenEnterpriseOutputEntity;
import com.epmet.modules.partymember.service.ScreenEnterpriseOutputService; import com.epmet.modules.partymember.service.ScreenEnterpriseOutputService;
import com.epmet.resi.partymember.dto.ScreenEnterpriseOutputDTO; import com.epmet.resi.partymember.dto.ScreenEnterpriseOutputDTO;
import com.epmet.resi.partymember.dto.partymember.form.vegetableFormDTO; import com.epmet.resi.partymember.dto.partymember.form.vegetableFormDTO;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Map; import java.util.Map;
@ -42,42 +44,47 @@ import java.util.Map;
@RestController @RestController
@RequestMapping("screenenterpriseoutput") @RequestMapping("screenenterpriseoutput")
public class ScreenEnterpriseOutputController { public class ScreenEnterpriseOutputController {
@Autowired @Autowired
private ScreenEnterpriseOutputService screenEnterpriseOutputService; private ScreenEnterpriseOutputService screenEnterpriseOutputService;
@GetMapping("page") @GetMapping("page")
public Result<PageData<ScreenEnterpriseOutputDTO>> page(@RequestParam Map<String, Object> params){ public Result<PageData<ScreenEnterpriseOutputDTO>> page(@RequestParam Map<String, Object> params) {
PageData<ScreenEnterpriseOutputDTO> page = screenEnterpriseOutputService.page(params); PageData<ScreenEnterpriseOutputDTO> page = screenEnterpriseOutputService.page(params);
return new Result<PageData<ScreenEnterpriseOutputDTO>>().ok(page); return new Result<PageData<ScreenEnterpriseOutputDTO>>().ok(page);
} }
@GetMapping("{id}") @GetMapping("{id}")
public Result<ScreenEnterpriseOutputDTO> get(@PathVariable("id") String id){ public Result<ScreenEnterpriseOutputDTO> get(@PathVariable("id") String id) {
ScreenEnterpriseOutputDTO data = screenEnterpriseOutputService.get(id); ScreenEnterpriseOutputDTO data = screenEnterpriseOutputService.get(id);
return new Result<ScreenEnterpriseOutputDTO>().ok(data); return new Result<ScreenEnterpriseOutputDTO>().ok(data);
} }
/** /**
* * @param
* @return com.epmet.commons.tools.utils.Result
* @description: 上报 * @description: 上报
* @author qushutong * @author qushutong
* @date 2024/3/22 14:52 * @date 2024/3/22 14:52
* @param
* @return com.epmet.commons.tools.utils.Result
* @Version1.0 * @Version1.0
**/ **/
@PostMapping("yifengScreen/submitOutput") @PostMapping("yifengScreen/submitOutput")
public Result submitOutput(@RequestBody vegetableFormDTO dto){ public Result submitOutput(@RequestBody vegetableFormDTO dto) {
//效验数据 //效验数据
// ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); // ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
screenEnterpriseOutputService.submitOutput(dto); screenEnterpriseOutputService.submitOutput(dto);
return new Result(); return new Result();
} }
@GetMapping("yifengScreen/getVegetableByEnterprise/{placeOrgName}")
public Result<List<ScreenEnterpriseOutputEntity>> getVegetableByEnterprise(@PathVariable("placeOrgName") String placeOrgName) {
return new Result<List<ScreenEnterpriseOutputEntity>>().ok(screenEnterpriseOutputService.getListVegetable(placeOrgName));
}
@PutMapping @PutMapping
public Result update(@RequestBody ScreenEnterpriseOutputDTO dto){ public Result update(@RequestBody ScreenEnterpriseOutputDTO dto) {
//效验数据 //效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
screenEnterpriseOutputService.update(dto); screenEnterpriseOutputService.update(dto);
@ -85,7 +92,7 @@ public class ScreenEnterpriseOutputController {
} }
@DeleteMapping @DeleteMapping
public Result delete(@RequestBody String[] ids){ public Result delete(@RequestBody String[] ids) {
//效验数据 //效验数据
AssertUtils.isArrayEmpty(ids, "id"); AssertUtils.isArrayEmpty(ids, "id");
screenEnterpriseOutputService.delete(ids); screenEnterpriseOutputService.delete(ids);
@ -94,11 +101,12 @@ public class ScreenEnterpriseOutputController {
@PostMapping @PostMapping
public Result save(@RequestBody ScreenEnterpriseOutputDTO dto){ public Result save(@RequestBody ScreenEnterpriseOutputDTO dto) {
//效验数据 //效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
screenEnterpriseOutputService.save(dto); screenEnterpriseOutputService.save(dto);
return new Result(); return new Result();
} }
} }

2
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/ScreenEnterpriseOutputService.java

@ -96,4 +96,6 @@ public interface ScreenEnterpriseOutputService extends BaseService<ScreenEnterpr
void delete(String[] ids); void delete(String[] ids);
Result submitOutput(vegetableFormDTO dto); Result submitOutput(vegetableFormDTO dto);
List<ScreenEnterpriseOutputEntity> getListVegetable(String placeOrgName);
} }

16
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/ScreenEnterpriseOutputServiceImpl.java

@ -65,8 +65,8 @@ public class ScreenEnterpriseOutputServiceImpl extends BaseServiceImpl<ScreenEnt
return ConvertUtils.sourceToTarget(entityList, ScreenEnterpriseOutputDTO.class); return ConvertUtils.sourceToTarget(entityList, ScreenEnterpriseOutputDTO.class);
} }
private QueryWrapper<ScreenEnterpriseOutputEntity> getWrapper(Map<String, Object> params){ private QueryWrapper<ScreenEnterpriseOutputEntity> getWrapper(Map<String, Object> params) {
String id = (String)params.get(FieldConstant.ID_HUMP); String id = (String) params.get(FieldConstant.ID_HUMP);
QueryWrapper<ScreenEnterpriseOutputEntity> wrapper = new QueryWrapper<>(); QueryWrapper<ScreenEnterpriseOutputEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
@ -105,7 +105,7 @@ public class ScreenEnterpriseOutputServiceImpl extends BaseServiceImpl<ScreenEnt
public Result submitOutput(vegetableFormDTO dto) { public Result submitOutput(vegetableFormDTO dto) {
String placeOrgName = dto.getVegetableList().get(0).getPlaceOrgName(); String placeOrgName = dto.getVegetableList().get(0).getPlaceOrgName();
Map map = new HashMap(); Map map = new HashMap();
map.put("PLACE_ORG_NAME",placeOrgName); map.put("PLACE_ORG_NAME", placeOrgName);
baseDao.deleteByMap(map); baseDao.deleteByMap(map);
List<vegetableFormDTO.VegetableListEntity> vegetableList = dto.getVegetableList(); List<vegetableFormDTO.VegetableListEntity> vegetableList = dto.getVegetableList();
List<ScreenEnterpriseOutputEntity> screenEnterpriseOutputEntities = ConvertUtils.sourceToTarget(vegetableList, ScreenEnterpriseOutputEntity.class); List<ScreenEnterpriseOutputEntity> screenEnterpriseOutputEntities = ConvertUtils.sourceToTarget(vegetableList, ScreenEnterpriseOutputEntity.class);
@ -113,4 +113,14 @@ public class ScreenEnterpriseOutputServiceImpl extends BaseServiceImpl<ScreenEnt
return new Result(); return new Result();
} }
@Override
public List<ScreenEnterpriseOutputEntity> getListVegetable(String placeOrgName) {
Map map = new HashMap();
map.put("DEL_FLAG", "0");
map.put("PLACE_ORG_NAME", placeOrgName);
List<ScreenEnterpriseOutputEntity> entityList = baseDao.selectByMap(map);
return entityList;
}
} }
Loading…
Cancel
Save