| Line 28... |
Line 28... |
| 28 |
|
28 |
|
| 29 |
import com.spice.profitmandi.common.enumuration.DateTimePattern;
|
29 |
import com.spice.profitmandi.common.enumuration.DateTimePattern;
|
| 30 |
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
|
30 |
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
|
| 31 |
import com.spice.profitmandi.common.model.CreateSchemeRequest;
|
31 |
import com.spice.profitmandi.common.model.CreateSchemeRequest;
|
| 32 |
import com.spice.profitmandi.common.model.ProfitMandiConstants;
|
32 |
import com.spice.profitmandi.common.model.ProfitMandiConstants;
|
| - |
|
33 |
import com.spice.profitmandi.common.model.SchemeItems;
|
| 33 |
import com.spice.profitmandi.common.model.SchemeModel;
|
34 |
import com.spice.profitmandi.common.model.SchemeModel;
|
| 34 |
import com.spice.profitmandi.common.util.ExcelUtils;
|
35 |
import com.spice.profitmandi.common.util.ExcelUtils;
|
| 35 |
import com.spice.profitmandi.common.util.StringUtils;
|
36 |
import com.spice.profitmandi.common.util.StringUtils;
|
| 36 |
import com.spice.profitmandi.dao.entity.catalog.Scheme;
|
37 |
import com.spice.profitmandi.dao.entity.catalog.Scheme;
|
| 37 |
import com.spice.profitmandi.dao.entity.fofo.SchemeItem;
|
38 |
import com.spice.profitmandi.dao.entity.fofo.SchemeItem;
|
| Line 96... |
Line 97... |
| 96 |
}
|
97 |
}
|
| 97 |
return "update-schemes-page";
|
98 |
return "update-schemes-page";
|
| 98 |
}
|
99 |
}
|
| 99 |
|
100 |
|
| 100 |
@RequestMapping(value = "/schemes/update", method = RequestMethod.POST)
|
101 |
@RequestMapping(value = "/schemes/update", method = RequestMethod.POST)
|
| 101 |
public String updateShcemes(HttpServletRequest request, @RequestParam List<Integer> schemeIds, @RequestParam List<Integer> itemIds) throws ProfitMandiBusinessException {
|
102 |
public String updateShcemes(HttpServletRequest request, @RequestBody SchemeItems schemeItems) throws ProfitMandiBusinessException {
|
| 102 |
for(int schemeId : schemeIds) {
|
103 |
for(int schemeId : schemeItems.getSchemeIds()) {
|
| 103 |
if(schemeRepository.selectById(schemeId) != null)
|
104 |
if(schemeRepository.selectById(schemeId) != null)
|
| 104 |
for(int itemId : itemIds) {
|
105 |
for(int itemId : schemeItems.getItemIds()) {
|
| 105 |
if(tagListingRepository.selectByItemIdsAndTagIds(new HashSet<>(Arrays.asList(itemId)), new HashSet<>(Arrays.asList(4,7))).size() > 0) {
|
106 |
if(tagListingRepository.selectByItemIdsAndTagIds(new HashSet<>(Arrays.asList(itemId)), new HashSet<>(Arrays.asList(4,7))).size() > 0) {
|
| 106 |
SchemeItem si = new SchemeItem();
|
107 |
SchemeItem si = new SchemeItem();
|
| 107 |
si.setItemId(itemId);
|
108 |
si.setItemId(itemId);
|
| 108 |
si.setSchemeId(schemeId);
|
109 |
si.setSchemeId(schemeId);
|
| 109 |
try {
|
110 |
try {
|