aggiunto n uovo campo su testata dei listini
All checks were successful
IntegryManagementSystem_Multi/pipeline/head This commit looks good
All checks were successful
IntegryManagementSystem_Multi/pipeline/head This commit looks good
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
package it.integry.ems.migration.model;
|
||||
|
||||
import it.integry.ems.migration._base.BaseMigration;
|
||||
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||
|
||||
public class Migration_20251111171747 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;createOrUpdateFunction("lisv_getTipoUm", "CREATE FUNCTION dbo.lisv_getTipoUm\n" +
|
||||
"( \n" +
|
||||
" @codMart varchar(15), @tipoUmLisv tinyint\n" +
|
||||
")\n" +
|
||||
"RETURNS TABLE \n" +
|
||||
"AS\n" +
|
||||
"RETURN \n" +
|
||||
"(\n" +
|
||||
" with um as (\n" +
|
||||
"select cod_mart, unt_mis, rap_conv\n" +
|
||||
"from dbo.getUntMisArticolo(@codMart, null ) um\n" +
|
||||
"where @tipoUmLisv is not null\n" +
|
||||
"and ( (@tipoUmLisv = 1 and um.tipo_um = 'UI' ) or \n" +
|
||||
"(@tipoUmLisv = 2 and flag_unita_kg = 'S'))\n" +
|
||||
")\n" +
|
||||
"\n" +
|
||||
"select mtb_aart.cod_mart, \n" +
|
||||
"case \n" +
|
||||
"when @tipoUmLisv IS null then mtb_aart.unt_mis\n" +
|
||||
"when @tipoUmLisv = 1 and mtb_aart.qta_cnf not in (0, 1) then mtb_aart.unt_mis\n" +
|
||||
"when @tipoUmLisv = 2 and mtb_aart.peso_kg not in (0, 1) then mtb_aart.unt_mis\n" +
|
||||
" else ISNULL(um.unt_mis, mtb_aart.unt_mis) end as unt_mis_ven, \n" +
|
||||
"case \n" +
|
||||
"when @tipoUmLisv IS null then 1\n" +
|
||||
"when @tipoUmLisv = 1 and mtb_aart.qta_cnf not in (0, 1) then 1\n" +
|
||||
"when @tipoUmLisv = 2 and mtb_aart.peso_kg not in (0, 1) then 1\n" +
|
||||
" else ISNULL(um.rap_conv, 1) end as rap_conv_vend\n" +
|
||||
"from mtb_aart left outer join um on mtb_aart.cod_mart = um.cod_mart\n" +
|
||||
"where (@codMart is null or mtb_aart.cod_mart = @codMart )\n" +
|
||||
")");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void down() throws Exception {
|
||||
}
|
||||
}
|
||||
@@ -2,9 +2,9 @@ package it.integry.ems_model.entity;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import it.integry.ems.rules.businessLogic.enums.TipoPartita;
|
||||
import it.integry.ems_model.annotation.*;
|
||||
import it.integry.ems_model.base.EntityBase;
|
||||
import it.integry.ems_model.entity._enum.IBaseEnum;
|
||||
import org.kie.api.definition.type.PropertyReactive;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
@@ -390,9 +390,11 @@ public class VtbList extends EntityBase {
|
||||
vtbListPremi.deleteAllEntities(connection, this);
|
||||
}
|
||||
|
||||
public enum TipoUm {
|
||||
public enum TipoUm implements IBaseEnum<TipoUm> {
|
||||
ARTICOLO(null),
|
||||
COLLI((short) 1),
|
||||
PESO_KG((short) 2);
|
||||
PESO_KG((short) 2),
|
||||
CICCIO((short) 3);
|
||||
|
||||
private Short value;
|
||||
|
||||
@@ -400,7 +402,7 @@ public class VtbList extends EntityBase {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public static TipoUm fromValue(Short value) {
|
||||
public static TipoUm fromValue(Object value) {
|
||||
for (TipoUm tipoUm : TipoUm.values()) {
|
||||
if (tipoUm.value==value) {
|
||||
return tipoUm;
|
||||
@@ -412,5 +414,20 @@ public class VtbList extends EntityBase {
|
||||
public Short getValue() {
|
||||
return this.value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object get() {
|
||||
return this.value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TipoUm fromInternal(Object val) {
|
||||
return fromValue(val);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.valueOf(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@ import it.integry.ems.status.ServiceChecker;
|
||||
import it.integry.ems.utility.UtilityEntity;
|
||||
import it.integry.ems_model.base.EntityBase;
|
||||
import it.integry.ems_model.entity.MtbLisvData;
|
||||
import it.integry.ems_model.entity.VtbList;
|
||||
import it.integry.ems_model.utility.UtilityDate;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
@@ -23,8 +24,11 @@ import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@RestController
|
||||
@Scope(value = "request")
|
||||
@@ -40,7 +44,7 @@ public class ListiniVenditaController {
|
||||
@Autowired
|
||||
Lisv4LisaService lisv4LisaService;
|
||||
|
||||
@RequestMapping(value = "status", method = RequestMethod.GET)
|
||||
@GetMapping(value = "status")
|
||||
public @ResponseBody
|
||||
List<StatusResponse> status(HttpServletRequest request) {
|
||||
|
||||
@@ -49,7 +53,7 @@ public class ListiniVenditaController {
|
||||
return serviceChecker.getServiceStatus(methods, clazz);
|
||||
}
|
||||
|
||||
@RequestMapping(value = "duplica-promozioni", method = RequestMethod.POST)
|
||||
@PostMapping(value = "duplica-promozioni")
|
||||
public @ResponseBody
|
||||
ServiceRestResponse duplicaPromoVend(HttpServletRequest request,
|
||||
@RequestParam(CommonConstants.PROFILE_DB) String configuration,
|
||||
@@ -60,7 +64,7 @@ public class ListiniVenditaController {
|
||||
return ServiceRestResponse.createEntityPositiveResponse(listiniVenditaServices.duplicaPromozione(codVlis, versione, whereCondLisv));
|
||||
}
|
||||
|
||||
@RequestMapping(value = "consolida-variazioni", method = RequestMethod.POST)
|
||||
@PostMapping(value = "consolida-variazioni")
|
||||
public @ResponseBody
|
||||
ServiceRestResponse consolidaListinoVend(HttpServletRequest request,
|
||||
@RequestParam(CommonConstants.PROFILE_DB) String configuration,
|
||||
@@ -72,7 +76,7 @@ public class ListiniVenditaController {
|
||||
return ServiceRestResponse.createPositiveResponse();
|
||||
}
|
||||
|
||||
@RequestMapping(value = "update", method = RequestMethod.POST)
|
||||
@PostMapping(value = "update")
|
||||
public @ResponseBody
|
||||
ServiceRestResponse updateLisv(HttpServletRequest request,
|
||||
@RequestParam(CommonConstants.PROFILE_DB) String configuration,
|
||||
@@ -81,7 +85,7 @@ public class ListiniVenditaController {
|
||||
return ServiceRestResponse.createEntityPositiveResponse(listiniVenditaServices.updateLisv(entityList, true));
|
||||
}
|
||||
|
||||
@RequestMapping(value = "duplica", method = RequestMethod.POST)
|
||||
@PostMapping(value = "duplica")
|
||||
public @ResponseBody
|
||||
List<ServiceRestResponse> duplicaListino(@RequestBody DuplicaListinoDTO duplicaListinoDTO) throws Exception {
|
||||
|
||||
@@ -89,7 +93,7 @@ public class ListiniVenditaController {
|
||||
return UtilityEntity.toServiceRestResponse(entities);
|
||||
}
|
||||
|
||||
@RequestMapping(value = "insertPromo", method = RequestMethod.POST)
|
||||
@PostMapping(value = "insertPromo")
|
||||
public ServiceRestResponse insertPromo(@RequestParam(CommonConstants.PROFILE_DB) String config,
|
||||
@RequestBody InsertPromoRequestDTO insertPromoRequest) throws Exception {
|
||||
|
||||
@@ -100,14 +104,14 @@ public class ListiniVenditaController {
|
||||
).setMessagesFromAnomalie(response.getAnomalie());
|
||||
}
|
||||
|
||||
@RequestMapping(value = "insertVariazioni", method = RequestMethod.POST)
|
||||
@PostMapping(value = "insertVariazioni")
|
||||
public ServiceRestResponse insertVariazioni(@RequestParam(CommonConstants.PROFILE_DB) String config,
|
||||
@RequestBody InsertVariazioniRequestDTO insertVariazioniRequestDTO) throws Exception {
|
||||
|
||||
return ServiceRestResponse.createPositiveResponse(listiniVenditaServices.inserisciVariazioni(insertVariazioniRequestDTO));
|
||||
}
|
||||
|
||||
@RequestMapping(value = "aggiorna4Lisa", method = RequestMethod.POST)
|
||||
@PostMapping(value = "aggiorna4Lisa")
|
||||
public @ResponseBody
|
||||
ServiceRestResponse aggiorna4Lisa(@RequestParam(CommonConstants.PROFILE_DB) String configuration,
|
||||
@RequestParam (required = false) boolean headless,
|
||||
@@ -115,5 +119,19 @@ public class ListiniVenditaController {
|
||||
return ServiceRestResponse.createPositiveResponse(lisv4LisaService.importAggiornaLisv(lisv4LisaDTO, headless));
|
||||
|
||||
}
|
||||
|
||||
@GetMapping(value = "tipoUm")
|
||||
public @ResponseBody
|
||||
ServiceRestResponse getTipoUm() {
|
||||
List<HashMap<Object, Object>> list = Arrays.stream(VtbList.TipoUm.values())
|
||||
.map(e -> {
|
||||
HashMap<Object, Object> m = new HashMap<>();
|
||||
m.put("valore", e.getValue());
|
||||
m.put("chiave", e.name());
|
||||
return m;
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
return ServiceRestResponse.createPositiveResponse(list);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user